diff options
Diffstat (limited to 'src/core/hle/service/glue/time')
-rw-r--r-- | src/core/hle/service/glue/time/manager.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/service/glue/time/worker.cpp | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hle/service/glue/time/manager.cpp b/src/core/hle/service/glue/time/manager.cpp index 059ac3fc9..cb88486dd 100644 --- a/src/core/hle/service/glue/time/manager.cpp +++ b/src/core/hle/service/glue/time/manager.cpp @@ -51,16 +51,17 @@ s64 CalendarTimeToEpoch(Service::PSC::Time::CalendarTime calendar) { } s64 GetEpochTimeFromInitialYear(std::shared_ptr<Service::Set::ISystemSettingsServer>& set_sys) { + s32 year{2000}; + set_sys->GetSettingsItemValueImpl(year, "time", "standard_user_clock_initial_year"); + Service::PSC::Time::CalendarTime calendar{ - .year = 2000, + .year = static_cast<s16>(year), .month = 1, .day = 1, .hour = 0, .minute = 0, .second = 0, }; - set_sys->GetSettingsItemValueImpl<s16>(calendar.year, "time", - "standard_user_clock_initial_year"); return CalendarTimeToEpoch(calendar); } diff --git a/src/core/hle/service/glue/time/worker.cpp b/src/core/hle/service/glue/time/worker.cpp index b28569b68..b6bbd7965 100644 --- a/src/core/hle/service/glue/time/worker.cpp +++ b/src/core/hle/service/glue/time/worker.cpp @@ -26,12 +26,9 @@ Service::PSC::Time::SystemClockContext g_report_ephemeral_clock_context{}; template <typename T> T GetSettingsItemValue(std::shared_ptr<Service::Set::ISystemSettingsServer>& set_sys, const char* category, const char* name) { - std::vector<u8> interval_buf; - auto res = set_sys->GetSettingsItemValueImpl(interval_buf, category, name); - ASSERT(res == ResultSuccess); - T v{}; - std::memcpy(&v, interval_buf.data(), sizeof(T)); + auto res = set_sys->GetSettingsItemValueImpl(v, category, name); + ASSERT(res == ResultSuccess); return v; } |