diff options
author | kcgen <1557255+kcgen@users.noreply.github.com> | 2021-10-04 07:02:26 +0300 |
---|---|---|
committer | kcgen <kcgen@users.noreply.github.com> | 2022-11-04 06:12:50 +0300 |
commit | 0f6ad5fb7e02ef0d57a548a120c5a3a025aa434c (patch) | |
tree | 65ad3d0505ecf2bf510fdd9e654f81fa4fe9ddd6 | |
parent | 0a0cd3fc7642246431e829785e4b119173052b9a (diff) |
Squash a couple warningskc/fps-pacing-1
-rw-r--r-- | src/dosbox.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 2078995d9..373da342f 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -170,9 +170,9 @@ void increaseticks(); void increaseticks_fixed(); static constexpr auto frame_pace_us = usT(static_cast<int>(1000000.0 / FRAME_RATE)); -static constexpr auto frame_pace_ms = static_cast<uint32_t>(frame_pace_us.count()) / +static constexpr auto frame_pace_ms = static_cast<int>(frame_pace_us.count()) / 1000; -static constexpr auto max_latency_ms = static_cast<uint32_t>(frame_pace_us.count()) * +static constexpr auto max_latency_ms = static_cast<int>(frame_pace_us.count()) * MAX_FRAME_QUEUE / 1000; static std::atomic<int> pic_balance = {}; @@ -203,7 +203,7 @@ bool cycles_below_max() return cycle_selector < cycle_range.end(); } -void increase_cycles(const uint32_t current_latency_ms) +void increase_cycles(const int current_latency_ms) { if (cycles_below_max() && !cycle_adjust_tempo) { const auto original_cycles = CPU_CycleMax; @@ -212,7 +212,7 @@ void increase_cycles(const uint32_t current_latency_ms) ? cycle_range.back() : *cycle_selector; if (CPU_CycleMax != original_cycles) - LOG_MSG("SCHED: %u ms queue, increased cycles to %u", + LOG_MSG("SCHED: %d ms queue, increased cycles to %u", current_latency_ms, CPU_CycleMax); } } @@ -222,7 +222,7 @@ bool cycles_above_min() return cycle_selector > cycle_range.begin(); } -void decrease_cycles(uint32_t current_latency_ms) +void decrease_cycles(const int current_latency_ms) { const auto original_cycles = CPU_CycleMax; const auto frames_delayed = 1 + (current_latency_ms - max_latency_ms) / @@ -236,7 +236,7 @@ void decrease_cycles(uint32_t current_latency_ms) } } if (CPU_CycleMax != original_cycles) - LOG_MSG("SCHED: %u ms queue, decreasing cycles to %u", + LOG_MSG("SCHED: %d ms queue, decreasing cycles to %u", current_latency_ms, CPU_CycleMax); } @@ -285,7 +285,7 @@ void increaseticks_fixed() const auto ticksNew = GetTicks(); if (ticksNew > ticksLast) { - ticksRemain = ticksNew - ticksLast; + ticksRemain = static_cast<int>(ticksNew - ticksLast); ticksLast = ticksNew; if (ticksRemain > max_latency_ms) { decrease_cycles(ticksRemain); |