diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/system_archive/time_zone_binary.cpp | 2 | ||||
| -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 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/core/file_sys/system_archive/time_zone_binary.cpp b/src/core/file_sys/system_archive/time_zone_binary.cpp index ceb0b41c6..7c17bbefa 100644 --- a/src/core/file_sys/system_archive/time_zone_binary.cpp +++ b/src/core/file_sys/system_archive/time_zone_binary.cpp | |||
| @@ -15,7 +15,7 @@ namespace FileSys::SystemArchive { | |||
| 15 | const static std::map<std::string, const std::map<const char*, const std::vector<u8>>&> | 15 | const static std::map<std::string, const std::map<const char*, const std::vector<u8>>&> |
| 16 | tzdb_zoneinfo_dirs = {{"Africa", NxTzdb::africa}, | 16 | tzdb_zoneinfo_dirs = {{"Africa", NxTzdb::africa}, |
| 17 | {"America", NxTzdb::america}, | 17 | {"America", NxTzdb::america}, |
| 18 | {"Antartica", NxTzdb::antartica}, | 18 | {"Antarctica", NxTzdb::antarctica}, |
| 19 | {"Arctic", NxTzdb::arctic}, | 19 | {"Arctic", NxTzdb::arctic}, |
| 20 | {"Asia", NxTzdb::asia}, | 20 | {"Asia", NxTzdb::asia}, |
| 21 | {"Atlantic", NxTzdb::atlantic}, | 21 | {"Atlantic", NxTzdb::atlantic}, |
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& | |||
| 849 | static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, | 849 | static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, |
| 850 | CalendarTimeInternal& calendar_time, | 850 | CalendarTimeInternal& calendar_time, |
| 851 | CalendarAdditionalInfo& calendar_additional_info) { | 851 | CalendarAdditionalInfo& calendar_additional_info) { |
| 852 | if ((rules.go_ahead && time < rules.ats[0]) || | 852 | ASSERT(rules.go_ahead ? rules.time_count > 0 : true); |
| 853 | (rules.go_back && time > rules.ats[rules.time_count - 1])) { | 853 | if ((rules.go_back && time < rules.ats[0]) || |
| 854 | (rules.go_ahead && time > rules.ats[rules.time_count - 1])) { | ||
| 854 | s64 seconds{}; | 855 | s64 seconds{}; |
| 855 | if (time < rules.ats[0]) { | 856 | if (time < rules.ats[0]) { |
| 856 | seconds = rules.ats[0] - time; | 857 | 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) { | |||
| 112 | LOG_DEBUG(Service_Time, "called, location_name={}", location_name); | 112 | LOG_DEBUG(Service_Time, "called, location_name={}", location_name); |
| 113 | 113 | ||
| 114 | TimeZone::TimeZoneRule time_zone_rule{}; | 114 | TimeZone::TimeZoneRule time_zone_rule{}; |
| 115 | if (const Result result{ | 115 | const Result result{time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; |
| 116 | time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; | ||
| 117 | result != ResultSuccess) { | ||
| 118 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 119 | rb.Push(result); | ||
| 120 | return; | ||
| 121 | } | ||
| 122 | 116 | ||
| 123 | std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule)); | 117 | std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule)); |
| 124 | std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule)); | 118 | std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule)); |
| 125 | ctx.WriteBuffer(time_zone_rule_outbuffer); | 119 | ctx.WriteBuffer(time_zone_rule_outbuffer); |
| 126 | 120 | ||
| 127 | IPC::ResponseBuilder rb{ctx, 2}; | 121 | IPC::ResponseBuilder rb{ctx, 2}; |
| 128 | rb.Push(ResultSuccess); | 122 | rb.Push(result); |
| 129 | } | 123 | } |
| 130 | 124 | ||
| 131 | void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) { | 125 | void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) { |