From f11b87ebf1cd5770f9128e62931183b0c9331067 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 12 Nov 2019 05:38:12 -0500 Subject: service: Resolve sign conversion errors These are fairly trivial to resolve and most of the changes entail using RESULT_UNKNOWN over ResultCode(-1). --- src/core/hle/service/time/time.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/core/hle/service/time/time.cpp') diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 1b9ab8401..62efe021e 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -34,12 +34,12 @@ static void PosixToCalendar(u64 posix_time, CalendarTime& calendar_time, additional_info = {}; return; } - calendar_time.year = tm->tm_year + 1900; - calendar_time.month = tm->tm_mon + 1; - calendar_time.day = tm->tm_mday; - calendar_time.hour = tm->tm_hour; - calendar_time.minute = tm->tm_min; - calendar_time.second = tm->tm_sec; + calendar_time.year = static_cast(tm->tm_year + 1900); + calendar_time.month = static_cast(tm->tm_mon + 1); + calendar_time.day = static_cast(tm->tm_mday); + calendar_time.hour = static_cast(tm->tm_hour); + calendar_time.minute = static_cast(tm->tm_min); + calendar_time.second = static_cast(tm->tm_sec); additional_info.day_of_week = tm->tm_wday; additional_info.day_of_year = tm->tm_yday; @@ -322,7 +322,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { if (tm == nullptr) { LOG_ERROR(Service_Time, "tm is a nullptr"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultCode(-1)); // TODO(ogniK): Find appropriate error code + rb.Push(RESULT_UNKNOWN); // TODO(ogniK): Find appropriate error code return; } @@ -331,12 +331,12 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { const SteadyClockTimePoint steady_clock_time_point{static_cast(ms.count() / 1000), {}}; CalendarTime calendar_time{}; - calendar_time.year = tm->tm_year + 1900; - calendar_time.month = tm->tm_mon + 1; - calendar_time.day = tm->tm_mday; - calendar_time.hour = tm->tm_hour; - calendar_time.minute = tm->tm_min; - calendar_time.second = tm->tm_sec; + calendar_time.year = static_cast(tm->tm_year + 1900); + calendar_time.month = static_cast(tm->tm_mon + 1); + calendar_time.day = static_cast(tm->tm_mday); + calendar_time.hour = static_cast(tm->tm_hour); + calendar_time.minute = static_cast(tm->tm_min); + calendar_time.second = static_cast(tm->tm_sec); ClockSnapshot clock_snapshot{}; clock_snapshot.system_posix_time = time_since_epoch; -- cgit v1.2.3