summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-05-27 12:26:17 -0400
committerGravatar GitHub2019-05-27 12:26:17 -0400
commitcfd885163feff37e29c710e15237ef77fd92f6a5 (patch)
tree0a9c78326fbf25693679b0837af8bd0d9ce15eda /src
parentMerge pull request #2524 from ReinUsesLisp/fixup-extension (diff)
parentcore_timing_util: Silence sign-comparison warnings (diff)
downloadyuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.gz
yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.xz
yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.zip
Merge pull request #2519 from lioncash/sign
loader/nso, core/core_timing_util: Silence sign-comparison warning
Diffstat (limited to 'src')
-rw-r--r--src/core/core_timing_util.cpp8
-rw-r--r--src/core/loader/nso.cpp2
2 files changed, 5 insertions, 5 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 {
14constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; 14constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE;
15 15
16s64 usToCycles(s64 us) { 16s64 usToCycles(s64 us) {
17 if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { 17 if (static_cast<u64>(us / 1000000) > MAX_VALUE_TO_MULTIPLY) {
18 LOG_ERROR(Core_Timing, "Integer overflow, use max value"); 18 LOG_ERROR(Core_Timing, "Integer overflow, use max value");
19 return std::numeric_limits<s64>::max(); 19 return std::numeric_limits<s64>::max();
20 } 20 }
21 if (us > MAX_VALUE_TO_MULTIPLY) { 21 if (static_cast<u64>(us) > MAX_VALUE_TO_MULTIPLY) {
22 LOG_DEBUG(Core_Timing, "Time very big, do rounding"); 22 LOG_DEBUG(Core_Timing, "Time very big, do rounding");
23 return BASE_CLOCK_RATE * (us / 1000000); 23 return BASE_CLOCK_RATE * (us / 1000000);
24 } 24 }
@@ -38,11 +38,11 @@ s64 usToCycles(u64 us) {
38} 38}
39 39
40s64 nsToCycles(s64 ns) { 40s64 nsToCycles(s64 ns) {
41 if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { 41 if (static_cast<u64>(ns / 1000000000) > MAX_VALUE_TO_MULTIPLY) {
42 LOG_ERROR(Core_Timing, "Integer overflow, use max value"); 42 LOG_ERROR(Core_Timing, "Integer overflow, use max value");
43 return std::numeric_limits<s64>::max(); 43 return std::numeric_limits<s64>::max();
44 } 44 }
45 if (ns > MAX_VALUE_TO_MULTIPLY) { 45 if (static_cast<u64>(ns) > MAX_VALUE_TO_MULTIPLY) {
46 LOG_DEBUG(Core_Timing, "Time very big, do rounding"); 46 LOG_DEBUG(Core_Timing, "Time very big, do rounding");
47 return BASE_CLOCK_RATE * (ns / 1000000000); 47 return BASE_CLOCK_RATE * (ns / 1000000000);
48 } 48 }
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<u8> DecompressSegment(const std::vector<u8>& compressed_data,
39 const std::vector<u8> uncompressed_data = 39 const std::vector<u8> uncompressed_data =
40 Common::Compression::DecompressDataLZ4(compressed_data, header.size); 40 Common::Compression::DecompressDataLZ4(compressed_data, header.size);
41 41
42 ASSERT_MSG(uncompressed_data.size() == static_cast<int>(header.size), "{} != {}", header.size, 42 ASSERT_MSG(uncompressed_data.size() == header.size, "{} != {}", header.size,
43 uncompressed_data.size()); 43 uncompressed_data.size());
44 44
45 return uncompressed_data; 45 return uncompressed_data;