[*] Clean up

This commit is contained in:
Reece Wilson 2022-03-08 01:36:12 +00:00
parent e1e1da8e1b
commit 6afe6c7342
2 changed files with 14 additions and 14 deletions

View File

@ -126,4 +126,4 @@ namespace Aurora::Logging::Sinks
{
AuSafeDelete< EventLogSink *>(sink);
}
}
}

View File

@ -198,25 +198,25 @@ namespace Aurora::Time
AUKN_SYM tm ToCivilTime(AuInt64 time, bool UTC)
{
std::tm ret{};
std::tm ret {};
auto timet = MSToCTime(time);
if (UTC)
{
#if defined(AURORA_COMPILER_MSVC)
#if defined(AURORA_COMPILER_MSVC)
auto tm = gmtime_s(&ret, &timet);
#else
#else
auto tm = gmtime_r(&timet, &ret);
#endif
#if defined(AURORA_COMPILER_MSVC)
#endif
#if defined(AURORA_COMPILER_MSVC)
SysAssert(!tm, "couldn't convert civil time");
#else
#else
SysAssert(tm, "couldn't convert civil time");
#endif
#endif
}
else
{
#if defined(AURORA_COMPILER_MSVC)
#if defined(AURORA_COMPILER_MSVC)
if (localtime_s(&ret, &timet))
#else
if (!localtime_r(&timet, &ret))
@ -235,7 +235,7 @@ namespace Aurora::Time
{
::tm tm;
time_t timet;
time.CopyTo(tm);
if (UTC)
@ -248,12 +248,12 @@ namespace Aurora::Time
tm.tm_isdst = -1; // out of the 2 crts i've bothered to check, out of 3, this is legal
timet = mktime(&tm);
}
if ((timet == 0) || (timet == -1))
{
return 0;
}
return std::chrono::duration_cast<std::chrono::milliseconds>(NormalizeEpoch(std::chrono::system_clock::from_time_t(timet).time_since_epoch())).count();
}
@ -266,4 +266,4 @@ namespace Aurora::Time
return ToCivilTime(FromCivilTime(time, shift == ETimezoneShift::eUTC));
}
}
}