Use std mechanism to detect signedness
This commit is contained in:
parent
465c86faa7
commit
45032f7d3b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue