mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-13 14:20:05 +00:00
common: Resolve C4267 warning on MSVC
Also removes Timer::GetDoubleTime() as it is unused.
This commit is contained in:
parent
46c6e5c4c0
commit
1cc1c33a15
6 changed files with 7 additions and 28 deletions
|
@ -137,24 +137,4 @@ std::string Timer::GetTimeFormatted() {
|
|||
return fmt::format("{}:{:03}", tmp, milliseconds);
|
||||
}
|
||||
|
||||
// Returns a timestamp with decimals for precise time comparisons
|
||||
// ----------------
|
||||
double Timer::GetDoubleTime() {
|
||||
// Get continuous timestamp
|
||||
u64 TmpSeconds = static_cast<u64>(Common::Timer::GetTimeSinceJan1970().count());
|
||||
double ms = static_cast<u64>(GetTimeMs().count()) % 1000;
|
||||
|
||||
// Remove a few years. We only really want enough seconds to make
|
||||
// sure that we are detecting actual actions, perhaps 60 seconds is
|
||||
// enough really, but I leave a year of seconds anyway, in case the
|
||||
// user's clock is incorrect or something like that.
|
||||
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
||||
|
||||
// Make a smaller integer that fits in the double
|
||||
u32 Seconds = static_cast<u32>(TmpSeconds);
|
||||
double TmpTime = Seconds + ms;
|
||||
|
||||
return TmpTime;
|
||||
}
|
||||
|
||||
} // Namespace Common
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue