diff options
Diffstat (limited to 'src/core/core_timing.h')
| -rw-r--r-- | src/core/core_timing.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index b9eb38ea4..26e4b1134 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h | |||
| @@ -51,11 +51,11 @@ inline s64 usToCycles(int us) { | |||
| 51 | 51 | ||
| 52 | inline s64 usToCycles(s64 us) { | 52 | inline s64 usToCycles(s64 us) { |
| 53 | if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { | 53 | if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { |
| 54 | LOG_ERROR(Core_Timing, "Integer overflow, use max value"); | 54 | NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); |
| 55 | return std::numeric_limits<s64>::max(); | 55 | return std::numeric_limits<s64>::max(); |
| 56 | } | 56 | } |
| 57 | if (us > MAX_VALUE_TO_MULTIPLY) { | 57 | if (us > MAX_VALUE_TO_MULTIPLY) { |
| 58 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 58 | NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 59 | return BASE_CLOCK_RATE * (us / 1000000); | 59 | return BASE_CLOCK_RATE * (us / 1000000); |
| 60 | } | 60 | } |
| 61 | return (BASE_CLOCK_RATE * us) / 1000000; | 61 | return (BASE_CLOCK_RATE * us) / 1000000; |
| @@ -63,11 +63,11 @@ inline s64 usToCycles(s64 us) { | |||
| 63 | 63 | ||
| 64 | inline s64 usToCycles(u64 us) { | 64 | inline s64 usToCycles(u64 us) { |
| 65 | if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { | 65 | if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { |
| 66 | LOG_ERROR(Core_Timing, "Integer overflow, use max value"); | 66 | NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); |
| 67 | return std::numeric_limits<s64>::max(); | 67 | return std::numeric_limits<s64>::max(); |
| 68 | } | 68 | } |
| 69 | if (us > MAX_VALUE_TO_MULTIPLY) { | 69 | if (us > MAX_VALUE_TO_MULTIPLY) { |
| 70 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 70 | NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 71 | return BASE_CLOCK_RATE * static_cast<s64>(us / 1000000); | 71 | return BASE_CLOCK_RATE * static_cast<s64>(us / 1000000); |
| 72 | } | 72 | } |
| 73 | return (BASE_CLOCK_RATE * static_cast<s64>(us)) / 1000000; | 73 | return (BASE_CLOCK_RATE * static_cast<s64>(us)) / 1000000; |
| @@ -83,11 +83,11 @@ inline s64 nsToCycles(int ns) { | |||
| 83 | 83 | ||
| 84 | inline s64 nsToCycles(s64 ns) { | 84 | inline s64 nsToCycles(s64 ns) { |
| 85 | if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { | 85 | if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { |
| 86 | LOG_ERROR(Core_Timing, "Integer overflow, use max value"); | 86 | NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); |
| 87 | return std::numeric_limits<s64>::max(); | 87 | return std::numeric_limits<s64>::max(); |
| 88 | } | 88 | } |
| 89 | if (ns > MAX_VALUE_TO_MULTIPLY) { | 89 | if (ns > MAX_VALUE_TO_MULTIPLY) { |
| 90 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 90 | NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 91 | return BASE_CLOCK_RATE * (ns / 1000000000); | 91 | return BASE_CLOCK_RATE * (ns / 1000000000); |
| 92 | } | 92 | } |
| 93 | return (BASE_CLOCK_RATE * ns) / 1000000000; | 93 | return (BASE_CLOCK_RATE * ns) / 1000000000; |
| @@ -95,11 +95,11 @@ inline s64 nsToCycles(s64 ns) { | |||
| 95 | 95 | ||
| 96 | inline s64 nsToCycles(u64 ns) { | 96 | inline s64 nsToCycles(u64 ns) { |
| 97 | if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { | 97 | if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { |
| 98 | LOG_ERROR(Core_Timing, "Integer overflow, use max value"); | 98 | NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); |
| 99 | return std::numeric_limits<s64>::max(); | 99 | return std::numeric_limits<s64>::max(); |
| 100 | } | 100 | } |
| 101 | if (ns > MAX_VALUE_TO_MULTIPLY) { | 101 | if (ns > MAX_VALUE_TO_MULTIPLY) { |
| 102 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 102 | NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 103 | return BASE_CLOCK_RATE * (static_cast<s64>(ns) / 1000000000); | 103 | return BASE_CLOCK_RATE * (static_cast<s64>(ns) / 1000000000); |
| 104 | } | 104 | } |
| 105 | return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; | 105 | return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; |