From 3c0d4b7d8fd7c2fbb0f3741dfd892693d439689e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Aug 2021 08:13:23 -0400 Subject: [PATCH] NetKDTime: Eliminate implicit sign conversions Silences compiler warnings and also makes the conversions here explicit to the reader. --- Source/Core/Core/IOS/Network/KD/NetKDTime.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp b/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp index 5e4098ff5f..5011647e6e 100644 --- a/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp +++ b/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp @@ -85,13 +85,17 @@ std::optional NetKDTimeDevice::IOCtl(const IOCtlRequest& request) u64 NetKDTimeDevice::GetAdjustedUTC() const { - return ExpansionInterface::CEXIIPL::GetEmulatedTime(ExpansionInterface::CEXIIPL::UNIX_EPOCH) + - utcdiff; + using namespace ExpansionInterface; + + const u32 emulated_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH); + return u64(s64(emulated_time) + utcdiff); } void NetKDTimeDevice::SetAdjustedUTC(u64 wii_utc) { - utcdiff = ExpansionInterface::CEXIIPL::GetEmulatedTime(ExpansionInterface::CEXIIPL::UNIX_EPOCH) - - wii_utc; + using namespace ExpansionInterface; + + const u32 emulated_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH); + utcdiff = s64(emulated_time - wii_utc); } } // namespace IOS::HLE