From ebc43239f0ad088c47db88a1e7ed21a9fe77c61c Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 20 Aug 2019 22:25:18 +0800 Subject: [PATCH] core_timing: Silence sign comparison warnings This is causing a lot of warnings all over the place. --- src/core/core_timing.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/core_timing.h b/src/core/core_timing.h index a51c00bba..229fc37f4 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -56,11 +56,11 @@ inline s64 usToCycles(int us) { } inline s64 usToCycles(s64 us) { - if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { + if (us / 1000000 > static_cast(MAX_VALUE_TO_MULTIPLY)) { LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } - if (us > MAX_VALUE_TO_MULTIPLY) { + if (us > static_cast(MAX_VALUE_TO_MULTIPLY)) { LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * (us / 1000000); } @@ -88,11 +88,11 @@ inline s64 nsToCycles(int ns) { } inline s64 nsToCycles(s64 ns) { - if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { + if (ns / 1000000000 > static_cast(MAX_VALUE_TO_MULTIPLY)) { LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } - if (ns > MAX_VALUE_TO_MULTIPLY) { + if (ns > static_cast(MAX_VALUE_TO_MULTIPLY)) { LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * (ns / 1000000000); }