summaryrefslogtreecommitdiff
path: root/src/common/timer.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2020-10-30 15:02:02 -0400
committerGravatar Lioncash2020-11-02 15:50:58 -0500
commit4a4b685a0420b0ac7c026cd2370c23d54f469976 (patch)
tree8de9e9a72563a369dac5ec8183e417e40ee4b8bf /src/common/timer.cpp
parentCMakeLists: Resolve MSVC build failures (diff)
downloadyuzu-4a4b685a0420b0ac7c026cd2370c23d54f469976.tar.gz
yuzu-4a4b685a0420b0ac7c026cd2370c23d54f469976.tar.xz
yuzu-4a4b685a0420b0ac7c026cd2370c23d54f469976.zip
common: Enable warnings as errors
Cleans up common so that we can enable warnings as errors.
Diffstat (limited to 'src/common/timer.cpp')
-rw-r--r--src/common/timer.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/common/timer.cpp b/src/common/timer.cpp
index 2dc15e434..d17dc2a50 100644
--- a/src/common/timer.cpp
+++ b/src/common/timer.cpp
@@ -142,20 +142,18 @@ std::string Timer::GetTimeFormatted() {
142// ---------------- 142// ----------------
143double Timer::GetDoubleTime() { 143double Timer::GetDoubleTime() {
144 // Get continuous timestamp 144 // Get continuous timestamp
145 u64 TmpSeconds = static_cast<u64>(Common::Timer::GetTimeSinceJan1970().count()); 145 auto tmp_seconds = static_cast<u64>(GetTimeSinceJan1970().count());
146 double ms = static_cast<u64>(GetTimeMs().count()) % 1000; 146 const auto ms = static_cast<double>(static_cast<u64>(GetTimeMs().count()) % 1000);
147 147
148 // Remove a few years. We only really want enough seconds to make 148 // Remove a few years. We only really want enough seconds to make
149 // sure that we are detecting actual actions, perhaps 60 seconds is 149 // sure that we are detecting actual actions, perhaps 60 seconds is
150 // enough really, but I leave a year of seconds anyway, in case the 150 // enough really, but I leave a year of seconds anyway, in case the
151 // user's clock is incorrect or something like that. 151 // user's clock is incorrect or something like that.
152 TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60); 152 tmp_seconds = tmp_seconds - (38 * 365 * 24 * 60 * 60);
153 153
154 // Make a smaller integer that fits in the double 154 // Make a smaller integer that fits in the double
155 u32 Seconds = static_cast<u32>(TmpSeconds); 155 const auto seconds = static_cast<u32>(tmp_seconds);
156 double TmpTime = Seconds + ms; 156 return seconds + ms;
157
158 return TmpTime;
159} 157}
160 158
161} // Namespace Common 159} // Namespace Common