summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-25 23:01:16 +0200
committerLioncash <mathew1800@gmail.com>2019-05-25 23:01:18 +0200
commit0fa039d8d0d61bc12365684b9924ff78eda75f8a (patch)
tree25803b5d01d3639f3f77a1658dac7e9b503c6641
parentloader/nso: Silence sign-comparison warning (diff)
downloadyuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar.gz
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar.bz2
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar.lz
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar.xz
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.tar.zst
yuzu-0fa039d8d0d61bc12365684b9924ff78eda75f8a.zip
-rw-r--r--src/core/core_timing_util.cpp8
1 files 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<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);
}