Skip to content

Commit dd5b9f3

Browse files
committed
Resolve sign mismatch warnings
1 parent b302896 commit dd5b9f3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/platform.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,22 @@ namespace cppcheck {
6161
}
6262

6363
bool isIntValue(unsigned long long value) const {
64-
return value <= max_value(int_bit);
64+
unsigned long long intMax = max_value(int_bit);
65+
return value <= intMax;
6566
}
6667

6768
bool isLongValue(long long value) const {
6869
return value >= min_value(long_bit) && value <= max_value(long_bit);
6970
}
7071

7172
bool isLongValue(unsigned long long value) const {
72-
return value <= max_value(long_bit);
73+
unsigned long long longMax = max_value(long_bit);
74+
return value <= longMax;
7375
}
7476

7577
bool isLongLongValue(unsigned long long value) const {
76-
return value <= max_value(long_long_bit);
78+
unsigned long long longLongMax = max_value(long_long_bit);
79+
return value <= longLongMax;
7780
}
7881

7982
nonneg int char_bit; /// bits in char

0 commit comments

Comments
 (0)