From dd5b9f3b82098bcf99304662bb6c7df5b9668d8a Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 19 Mar 2020 18:22:55 +0300 Subject: [PATCH] Resolve sign mismatch warnings --- lib/platform.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/platform.h b/lib/platform.h index 2d83b7393..3140b6aba 100644 --- a/lib/platform.h +++ b/lib/platform.h @@ -61,7 +61,8 @@ namespace cppcheck { } 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 { @@ -69,11 +70,13 @@ namespace cppcheck { } 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 { - 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