Use std mechanism to detect signedness
This commit is contained in:
parent
465c86faa7
commit
45032f7d3b
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
cppcheck::Platform::Platform()
|
cppcheck::Platform::Platform()
|
||||||
{
|
{
|
||||||
|
@ -56,8 +57,7 @@ bool cppcheck::Platform::platform(cppcheck::Platform::PlatformType type)
|
||||||
if (type == Unspecified) {
|
if (type == Unspecified) {
|
||||||
defaultSign = '\0';
|
defaultSign = '\0';
|
||||||
} else {
|
} else {
|
||||||
char x = -1;
|
defaultSign = (std::numeric_limits<char>::is_signed) ? 's' : 'u';
|
||||||
defaultSign = (x < 0) ? 's' : 'u';
|
|
||||||
}
|
}
|
||||||
char_bit = 8;
|
char_bit = 8;
|
||||||
short_bit = char_bit * sizeof_short;
|
short_bit = char_bit * sizeof_short;
|
||||||
|
|
Loading…
Reference in New Issue