diff options
author | bunnei <bunneidev@gmail.com> | 2023-06-18 08:47:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-18 08:47:16 +0200 |
commit | 6e293be20bf958a5a8ee940ff1a0e01d81d44ef4 (patch) | |
tree | 1fd668b23ce6987a410cdde56b8a626c8bedec78 /src/core/hle | |
parent | Merge pull request #10828 from liamwhite/somehow-still-using-llvm-14 (diff) | |
parent | time_zone_service: Always write time zone rule data (diff) | |
download | yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar.gz yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar.bz2 yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar.lz yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar.xz yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.tar.zst yuzu-6e293be20bf958a5a8ee940ff1a0e01d81d44ef4.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/time/time_zone_service.cpp | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index e1728c06d..63aacd19f 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -849,8 +849,9 @@ static Result CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInternal& static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, CalendarTimeInternal& calendar_time, CalendarAdditionalInfo& calendar_additional_info) { - if ((rules.go_ahead && time < rules.ats[0]) || - (rules.go_back && time > rules.ats[rules.time_count - 1])) { + ASSERT(rules.go_ahead ? rules.time_count > 0 : true); + if ((rules.go_back && time < rules.ats[0]) || + (rules.go_ahead && time > rules.ats[rules.time_count - 1])) { s64 seconds{}; if (time < rules.ats[0]) { seconds = rules.ats[0] - time; diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp index e8273e152..8171c82a5 100644 --- a/src/core/hle/service/time/time_zone_service.cpp +++ b/src/core/hle/service/time/time_zone_service.cpp @@ -112,20 +112,14 @@ void ITimeZoneService::LoadTimeZoneRule(HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called, location_name={}", location_name); TimeZone::TimeZoneRule time_zone_rule{}; - if (const Result result{ - time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; - result != ResultSuccess) { - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(result); - return; - } + const Result result{time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule)); std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule)); ctx.WriteBuffer(time_zone_rule_outbuffer); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); + rb.Push(result); } void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) { |