Resolve sign mismatch warnings

This commit is contained in:
Dmitry-Me 2020-03-19 18:22:55 +03:00
parent b302896751
commit dd5b9f3b82
1 changed files with 6 additions and 3 deletions

View File

@ -61,7 +61,8 @@ namespace cppcheck {
} }
bool isIntValue(unsigned long long value) const { bool isIntValue(unsigned long long value) const {
return value <= max_value(int_bit); unsigned long long intMax = max_value(int_bit);
return value <= intMax;
} }
bool isLongValue(long long value) const { bool isLongValue(long long value) const {
@ -69,11 +70,13 @@ namespace cppcheck {
} }
bool isLongValue(unsigned long long value) const { bool isLongValue(unsigned long long value) const {
return value <= max_value(long_bit); unsigned long long longMax = max_value(long_bit);
return value <= longMax;
} }
bool isLongLongValue(unsigned long long value) const { bool isLongLongValue(unsigned long long value) const {
return value <= max_value(long_long_bit); unsigned long long longLongMax = max_value(long_long_bit);
return value <= longLongMax;
} }
nonneg int char_bit; /// bits in char nonneg int char_bit; /// bits in char