summaryrefslogtreecommitdiffstats
path: root/src/core/core_timing.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-21 04:07:39 +0200
committerGitHub <noreply@github.com>2020-10-21 04:07:39 +0200
commit3d592972dc3fd61cc88771b889eff237e4e03e0f (patch)
tree0dbc65ac86e609ae22087c7be9d4759ac6b73004 /src/core/core_timing.cpp
parentkernel: Fix build with recent compiler flag changes (diff)
downloadyuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.gz
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.bz2
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.lz
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.xz
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.zst
yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.zip
Diffstat (limited to 'src/core/core_timing.cpp')
-rw-r--r--src/core/core_timing.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 9b01f6293..e6c8461a5 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -140,8 +140,7 @@ void CoreTiming::AddTicks(u64 ticks) {
void CoreTiming::Idle() {
if (!event_queue.empty()) {
const u64 next_event_time = event_queue.front().time;
- const u64 next_ticks =
- static_cast<u64>(nsToCycles(std::chrono::nanoseconds(next_event_time))) + 10;
+ const u64 next_ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U;
if (next_ticks > ticks) {
ticks = next_ticks;
}
@@ -188,7 +187,7 @@ void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) {
std::optional<s64> CoreTiming::Advance() {
std::scoped_lock lock{advance_lock, basic_lock};
- global_timer = static_cast<u64>(GetGlobalTimeNs().count());
+ global_timer = GetGlobalTimeNs().count();
while (!event_queue.empty() && event_queue.front().time <= global_timer) {
Event evt = std::move(event_queue.front());
@@ -202,11 +201,11 @@ std::optional<s64> CoreTiming::Advance() {
}
basic_lock.lock();
- global_timer = static_cast<u64>(GetGlobalTimeNs().count());
+ global_timer = GetGlobalTimeNs().count();
}
if (!event_queue.empty()) {
- const auto next_time = static_cast<s64>(event_queue.front().time - global_timer);
+ const s64 next_time = event_queue.front().time - global_timer;
return next_time;
} else {
return std::nullopt;
@@ -241,14 +240,14 @@ std::chrono::nanoseconds CoreTiming::GetGlobalTimeNs() const {
if (is_multicore) {
return clock->GetTimeNS();
}
- return CyclesToNs(static_cast<s64>(ticks));
+ return CyclesToNs(ticks);
}
std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const {
if (is_multicore) {
return clock->GetTimeUS();
}
- return CyclesToUs(static_cast<s64>(ticks));
+ return CyclesToUs(ticks);
}
} // namespace Core::Timing