summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time/time.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-11-12 11:38:12 +0100
committerLioncash <mathew1800@gmail.com>2019-11-12 13:55:39 +0100
commitf11b87ebf1cd5770f9128e62931183b0c9331067 (patch)
tree286bed12845e8843e88d2a317388d115b69d2d95 /src/core/hle/service/time/time.cpp
parentperf_stats: Resolve implicit int to double conversion error (diff)
downloadyuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar.gz
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar.bz2
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar.lz
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar.xz
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.tar.zst
yuzu-f11b87ebf1cd5770f9128e62931183b0c9331067.zip
Diffstat (limited to 'src/core/hle/service/time/time.cpp')
-rw-r--r--src/core/hle/service/time/time.cpp26
1 files changed, 13 insertions, 13 deletions
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<u16_le>(tm->tm_year + 1900);
+ calendar_time.month = static_cast<u8>(tm->tm_mon + 1);
+ calendar_time.day = static_cast<u8>(tm->tm_mday);
+ calendar_time.hour = static_cast<u8>(tm->tm_hour);
+ calendar_time.minute = static_cast<u8>(tm->tm_min);
+ calendar_time.second = static_cast<u8>(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<u64_le>(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<u16_le>(tm->tm_year + 1900);
+ calendar_time.month = static_cast<u8>(tm->tm_mon + 1);
+ calendar_time.day = static_cast<u8>(tm->tm_mday);
+ calendar_time.hour = static_cast<u8>(tm->tm_hour);
+ calendar_time.minute = static_cast<u8>(tm->tm_min);
+ calendar_time.second = static_cast<u8>(tm->tm_sec);
ClockSnapshot clock_snapshot{};
clock_snapshot.system_posix_time = time_since_epoch;