diff options
| author | 2020-10-15 14:49:45 -0400 | |
|---|---|---|
| committer | 2020-10-17 19:50:39 -0400 | |
| commit | be1954e04cb5a0c3a526f78ed5490a5e65310280 (patch) | |
| tree | 267db7ae4be88dbbc288fa605e35d4a2a13839f6 /src/core/core_timing.cpp | |
| parent | Merge pull request #4787 from lioncash/conversion (diff) | |
| download | yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.gz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.xz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.zip | |
core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
Diffstat (limited to 'src/core/core_timing.cpp')
| -rw-r--r-- | src/core/core_timing.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index e6c8461a5..9b01f6293 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -140,7 +140,8 @@ void CoreTiming::AddTicks(u64 ticks) { | |||
| 140 | void CoreTiming::Idle() { | 140 | void CoreTiming::Idle() { |
| 141 | if (!event_queue.empty()) { | 141 | if (!event_queue.empty()) { |
| 142 | const u64 next_event_time = event_queue.front().time; | 142 | const u64 next_event_time = event_queue.front().time; |
| 143 | const u64 next_ticks = nsToCycles(std::chrono::nanoseconds(next_event_time)) + 10U; | 143 | const u64 next_ticks = |
| 144 | static_cast<u64>(nsToCycles(std::chrono::nanoseconds(next_event_time))) + 10; | ||
| 144 | if (next_ticks > ticks) { | 145 | if (next_ticks > ticks) { |
| 145 | ticks = next_ticks; | 146 | ticks = next_ticks; |
| 146 | } | 147 | } |
| @@ -187,7 +188,7 @@ void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) { | |||
| 187 | 188 | ||
| 188 | std::optional<s64> CoreTiming::Advance() { | 189 | std::optional<s64> CoreTiming::Advance() { |
| 189 | std::scoped_lock lock{advance_lock, basic_lock}; | 190 | std::scoped_lock lock{advance_lock, basic_lock}; |
| 190 | global_timer = GetGlobalTimeNs().count(); | 191 | global_timer = static_cast<u64>(GetGlobalTimeNs().count()); |
| 191 | 192 | ||
| 192 | while (!event_queue.empty() && event_queue.front().time <= global_timer) { | 193 | while (!event_queue.empty() && event_queue.front().time <= global_timer) { |
| 193 | Event evt = std::move(event_queue.front()); | 194 | Event evt = std::move(event_queue.front()); |
| @@ -201,11 +202,11 @@ std::optional<s64> CoreTiming::Advance() { | |||
| 201 | } | 202 | } |
| 202 | 203 | ||
| 203 | basic_lock.lock(); | 204 | basic_lock.lock(); |
| 204 | global_timer = GetGlobalTimeNs().count(); | 205 | global_timer = static_cast<u64>(GetGlobalTimeNs().count()); |
| 205 | } | 206 | } |
| 206 | 207 | ||
| 207 | if (!event_queue.empty()) { | 208 | if (!event_queue.empty()) { |
| 208 | const s64 next_time = event_queue.front().time - global_timer; | 209 | const auto next_time = static_cast<s64>(event_queue.front().time - global_timer); |
| 209 | return next_time; | 210 | return next_time; |
| 210 | } else { | 211 | } else { |
| 211 | return std::nullopt; | 212 | return std::nullopt; |
| @@ -240,14 +241,14 @@ std::chrono::nanoseconds CoreTiming::GetGlobalTimeNs() const { | |||
| 240 | if (is_multicore) { | 241 | if (is_multicore) { |
| 241 | return clock->GetTimeNS(); | 242 | return clock->GetTimeNS(); |
| 242 | } | 243 | } |
| 243 | return CyclesToNs(ticks); | 244 | return CyclesToNs(static_cast<s64>(ticks)); |
| 244 | } | 245 | } |
| 245 | 246 | ||
| 246 | std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const { | 247 | std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const { |
| 247 | if (is_multicore) { | 248 | if (is_multicore) { |
| 248 | return clock->GetTimeUS(); | 249 | return clock->GetTimeUS(); |
| 249 | } | 250 | } |
| 250 | return CyclesToUs(ticks); | 251 | return CyclesToUs(static_cast<s64>(ticks)); |
| 251 | } | 252 | } |
| 252 | 253 | ||
| 253 | } // namespace Core::Timing | 254 | } // namespace Core::Timing |