Use std mechanism to detect signedness

This commit is contained in:
Dmitry-Me 2017-08-11 18:44:14 +03:00
parent 465c86faa7
commit 45032f7d3b
1 changed files with 2 additions and 2 deletions

View File

@ -22,6 +22,7 @@
#include <cstdlib>
#include <cstring>
#include <limits>
cppcheck::Platform::Platform()
{
@ -56,8 +57,7 @@ bool cppcheck::Platform::platform(cppcheck::Platform::PlatformType type)
if (type == Unspecified) {
defaultSign = '\0';
} else {
char x = -1;
defaultSign = (x < 0) ? 's' : 'u';
defaultSign = (std::numeric_limits<char>::is_signed) ? 's' : 'u';
}
char_bit = 8;
short_bit = char_bit * sizeof_short;