diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-06-29 01:59:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 01:59:33 +0200 |
commit | 01bc0c84f021ad389309aeb23bdb063070aeb2fe (patch) | |
tree | 720dc203d1eeb85e47c6f9b0d57cd00ec8a69038 /src/core/hle/service/time/time_zone_manager.cpp | |
parent | Merge pull request #8504 from comex/mesosphere-current-process (diff) | |
parent | video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueue (diff) | |
download | yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar.gz yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar.bz2 yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar.lz yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar.xz yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.tar.zst yuzu-01bc0c84f021ad389309aeb23bdb063070aeb2fe.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index fee05ec7a..2aa675df9 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -666,8 +666,8 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi return true; } -static ResultCode CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInternal& calendar_time, - CalendarAdditionalInfo& calendar_additional_info) { +static Result CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInternal& calendar_time, + CalendarAdditionalInfo& calendar_additional_info) { s64 year{epoch_year}; s64 time_days{time / seconds_per_day}; s64 remaining_seconds{time % seconds_per_day}; @@ -741,9 +741,9 @@ static ResultCode CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInter return ResultSuccess; } -static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, - CalendarTimeInternal& calendar_time, - CalendarAdditionalInfo& calendar_additional_info) { +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])) { s64 seconds{}; @@ -766,7 +766,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, if (new_time < rules.ats[0] && new_time > rules.ats[rules.time_count - 1]) { return ERROR_TIME_NOT_FOUND; } - if (const ResultCode result{ + if (const Result result{ ToCalendarTimeInternal(rules, new_time, calendar_time, calendar_additional_info)}; result != ResultSuccess) { return result; @@ -797,8 +797,8 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, tti_index = rules.types[low - 1]; } - if (const ResultCode result{CreateCalendarTime(time, rules.ttis[tti_index].gmt_offset, - calendar_time, calendar_additional_info)}; + if (const Result result{CreateCalendarTime(time, rules.ttis[tti_index].gmt_offset, + calendar_time, calendar_additional_info)}; result != ResultSuccess) { return result; } @@ -811,9 +811,9 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, return ResultSuccess; } -static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) { +static Result ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) { CalendarTimeInternal calendar_time{}; - const ResultCode result{ + const Result result{ ToCalendarTimeInternal(rules, time, calendar_time, calendar.additional_info)}; calendar.time.year = static_cast<s16>(calendar_time.year); @@ -830,13 +830,13 @@ static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, Calend TimeZoneManager::TimeZoneManager() = default; TimeZoneManager::~TimeZoneManager() = default; -ResultCode TimeZoneManager::ToCalendarTime(const TimeZoneRule& rules, s64 time, - CalendarInfo& calendar) const { +Result TimeZoneManager::ToCalendarTime(const TimeZoneRule& rules, s64 time, + CalendarInfo& calendar) const { return ToCalendarTimeImpl(rules, time, calendar); } -ResultCode TimeZoneManager::SetDeviceLocationNameWithTimeZoneRule(const std::string& location_name, - FileSys::VirtualFile& vfs_file) { +Result TimeZoneManager::SetDeviceLocationNameWithTimeZoneRule(const std::string& location_name, + FileSys::VirtualFile& vfs_file) { TimeZoneRule rule{}; if (ParseTimeZoneBinary(rule, vfs_file)) { device_location_name = location_name; @@ -846,12 +846,12 @@ ResultCode TimeZoneManager::SetDeviceLocationNameWithTimeZoneRule(const std::str return ERROR_TIME_ZONE_CONVERSION_FAILED; } -ResultCode TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) { +Result TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) { time_zone_update_time_point = value; return ResultSuccess; } -ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const { +Result TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const { if (is_initialized) { return ToCalendarTime(time_zone_rule, time, calendar); } else { @@ -859,16 +859,16 @@ ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& ca } } -ResultCode TimeZoneManager::ParseTimeZoneRuleBinary(TimeZoneRule& rules, - FileSys::VirtualFile& vfs_file) const { +Result TimeZoneManager::ParseTimeZoneRuleBinary(TimeZoneRule& rules, + FileSys::VirtualFile& vfs_file) const { if (!ParseTimeZoneBinary(rules, vfs_file)) { return ERROR_TIME_ZONE_CONVERSION_FAILED; } return ResultSuccess; } -ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, - const CalendarTime& calendar_time, s64& posix_time) const { +Result TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, const CalendarTime& calendar_time, + s64& posix_time) const { posix_time = 0; CalendarTimeInternal internal_time{ @@ -1020,8 +1020,8 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, return ResultSuccess; } -ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time, - s64& posix_time) const { +Result TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time, + s64& posix_time) const { if (is_initialized) { return ToPosixTime(time_zone_rule, calendar_time, posix_time); } @@ -1029,7 +1029,7 @@ ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_t return ERROR_UNINITIALIZED_CLOCK; } -ResultCode TimeZoneManager::GetDeviceLocationName(LocationName& value) const { +Result TimeZoneManager::GetDeviceLocationName(LocationName& value) const { if (!is_initialized) { return ERROR_UNINITIALIZED_CLOCK; } |