From e5159cfb84ef3e987cc1a5595b9c009117b1b264 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 25 May 2019 16:53:31 -0400 Subject: loader/nso: Silence sign-comparison warning This was previously performing a size_t == int comparison. Silences a -Wsign-compare warning. --- src/core/loader/nso.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 8592b1f44..62c090353 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -39,7 +39,7 @@ std::vector DecompressSegment(const std::vector& compressed_data, const std::vector uncompressed_data = Common::Compression::DecompressDataLZ4(compressed_data, header.size); - ASSERT_MSG(uncompressed_data.size() == static_cast(header.size), "{} != {}", header.size, + ASSERT_MSG(uncompressed_data.size() == header.size, "{} != {}", header.size, uncompressed_data.size()); return uncompressed_data; -- cgit v1.2.3 From 0fa039d8d0d61bc12365684b9924ff78eda75f8a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 25 May 2019 17:01:16 -0400 Subject: core_timing_util: Silence sign-comparison warnings We can just make the conversion explicit instead of implicit here to silence -Wsign-compare warnings. --- src/core/core_timing_util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/core_timing_util.cpp b/src/core/core_timing_util.cpp index 7942f30d6..c0f08cddb 100644 --- a/src/core/core_timing_util.cpp +++ b/src/core/core_timing_util.cpp @@ -14,11 +14,11 @@ namespace Core::Timing { constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits::max() / BASE_CLOCK_RATE; s64 usToCycles(s64 us) { - if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { + if (static_cast(us / 1000000) > 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 (static_cast(us) > MAX_VALUE_TO_MULTIPLY) { LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (us / 1000000); } @@ -38,11 +38,11 @@ s64 usToCycles(u64 us) { } s64 nsToCycles(s64 ns) { - if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { + if (static_cast(ns / 1000000000) > 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 (static_cast(ns) > MAX_VALUE_TO_MULTIPLY) { LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (ns / 1000000000); } -- cgit v1.2.3