diff options
author | bunnei <bunneidev@gmail.com> | 2019-05-27 18:26:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 18:26:17 +0200 |
commit | cfd885163feff37e29c710e15237ef77fd92f6a5 (patch) | |
tree | 0a9c78326fbf25693679b0837af8bd0d9ce15eda | |
parent | Merge pull request #2524 from ReinUsesLisp/fixup-extension (diff) | |
parent | core_timing_util: Silence sign-comparison warnings (diff) | |
download | yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.gz yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.bz2 yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.lz yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.xz yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.tar.zst yuzu-cfd885163feff37e29c710e15237ef77fd92f6a5.zip |
-rw-r--r-- | src/core/core_timing_util.cpp | 8 | ||||
-rw-r--r-- | src/core/loader/nso.cpp | 2 |
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 { constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; s64 usToCycles(s64 us) { - if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { + if (static_cast<u64>(us / 1000000) > MAX_VALUE_TO_MULTIPLY) { LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } - if (us > MAX_VALUE_TO_MULTIPLY) { + if (static_cast<u64>(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<u64>(ns / 1000000000) > MAX_VALUE_TO_MULTIPLY) { LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } - if (ns > MAX_VALUE_TO_MULTIPLY) { + if (static_cast<u64>(ns) > MAX_VALUE_TO_MULTIPLY) { LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (ns / 1000000000); } 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, const std::vector<u8> uncompressed_data = Common::Compression::DecompressDataLZ4(compressed_data, header.size); - ASSERT_MSG(uncompressed_data.size() == static_cast<int>(header.size), "{} != {}", header.size, + ASSERT_MSG(uncompressed_data.size() == header.size, "{} != {}", header.size, uncompressed_data.size()); return uncompressed_data; |