From 12c1766997f2596b4b1b1a6a411e4f6d56605ee7 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Fri, 21 May 2021 01:05:04 -0400 Subject: general: Replace RESULT_SUCCESS with ResultSuccess Transition to PascalCase for result names. --- src/core/hle/service/time/clock_types.h | 4 +- .../time/local_system_clock_context_writer.h | 2 +- .../time/network_system_clock_context_writer.h | 2 +- .../time/standard_network_system_clock_core.h | 4 +- .../time/standard_user_system_clock_core.cpp | 14 +++---- .../time/system_clock_context_update_callback.cpp | 6 +-- src/core/hle/service/time/system_clock_core.cpp | 12 +++--- src/core/hle/service/time/system_clock_core.h | 4 +- src/core/hle/service/time/time.cpp | 46 +++++++++++----------- src/core/hle/service/time/time_manager.cpp | 8 ++-- .../hle/service/time/time_zone_content_manager.cpp | 6 +-- src/core/hle/service/time/time_zone_manager.cpp | 22 +++++------ src/core/hle/service/time/time_zone_service.cpp | 24 +++++------ 13 files changed, 76 insertions(+), 78 deletions(-) (limited to 'src/core/hle/service/time') diff --git a/src/core/hle/service/time/clock_types.h b/src/core/hle/service/time/clock_types.h index a9cfe3eb0..392e16863 100644 --- a/src/core/hle/service/time/clock_types.h +++ b/src/core/hle/service/time/clock_types.h @@ -32,7 +32,7 @@ struct SteadyClockTimePoint { span = other.time_point - time_point; - return RESULT_SUCCESS; + return ResultSuccess; } static SteadyClockTimePoint GetRandom() { @@ -101,7 +101,7 @@ struct ClockSnapshot { return ERROR_TIME_MISMATCH; } current_time = steady_clock_time_point.time_point + context.offset; - return RESULT_SUCCESS; + return ResultSuccess; } }; static_assert(sizeof(ClockSnapshot) == 0xD0, "ClockSnapshot is incorrect size"); diff --git a/src/core/hle/service/time/local_system_clock_context_writer.h b/src/core/hle/service/time/local_system_clock_context_writer.h index 490d0ef3e..6be617392 100644 --- a/src/core/hle/service/time/local_system_clock_context_writer.h +++ b/src/core/hle/service/time/local_system_clock_context_writer.h @@ -18,7 +18,7 @@ public: protected: ResultCode Update() override { shared_memory.UpdateLocalSystemClockContext(context); - return RESULT_SUCCESS; + return ResultSuccess; } private: diff --git a/src/core/hle/service/time/network_system_clock_context_writer.h b/src/core/hle/service/time/network_system_clock_context_writer.h index e2920b8eb..a54fd7fe1 100644 --- a/src/core/hle/service/time/network_system_clock_context_writer.h +++ b/src/core/hle/service/time/network_system_clock_context_writer.h @@ -18,7 +18,7 @@ public: protected: ResultCode Update() override { shared_memory.UpdateNetworkSystemClockContext(context); - return RESULT_SUCCESS; + return ResultSuccess; } private: diff --git a/src/core/hle/service/time/standard_network_system_clock_core.h b/src/core/hle/service/time/standard_network_system_clock_core.h index 9d0aeaedb..95923a27b 100644 --- a/src/core/hle/service/time/standard_network_system_clock_core.h +++ b/src/core/hle/service/time/standard_network_system_clock_core.h @@ -25,13 +25,13 @@ public: bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) const { SystemClockContext clock_ctx{}; - if (GetClockContext(system, clock_ctx) != RESULT_SUCCESS) { + if (GetClockContext(system, clock_ctx) != ResultSuccess) { return {}; } s64 span{}; if (clock_ctx.steady_time_point.GetSpanBetween( - GetSteadyClockCore().GetCurrentTimePoint(system), span) != RESULT_SUCCESS) { + GetSteadyClockCore().GetCurrentTimePoint(system), span) != ResultSuccess) { return {}; } diff --git a/src/core/hle/service/time/standard_user_system_clock_core.cpp b/src/core/hle/service/time/standard_user_system_clock_core.cpp index 41bc01abd..ef79ab917 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.cpp +++ b/src/core/hle/service/time/standard_user_system_clock_core.cpp @@ -24,20 +24,18 @@ StandardUserSystemClockCore::StandardUserSystemClockCore( ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system, bool value) { - if (const ResultCode result{ApplyAutomaticCorrection(system, value)}; - result != RESULT_SUCCESS) { + if (const ResultCode result{ApplyAutomaticCorrection(system, value)}; result != ResultSuccess) { return result; } auto_correction_enabled = value; - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system, SystemClockContext& ctx) const { - if (const ResultCode result{ApplyAutomaticCorrection(system, false)}; - result != RESULT_SUCCESS) { + if (const ResultCode result{ApplyAutomaticCorrection(system, false)}; result != ResultSuccess) { return result; } @@ -57,7 +55,7 @@ ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& system, bool value) const { if (auto_correction_enabled == value) { - return RESULT_SUCCESS; + return ResultSuccess; } if (!network_system_clock_core.IsClockSetup(system)) { @@ -66,13 +64,13 @@ ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& s SystemClockContext ctx{}; if (const ResultCode result{network_system_clock_core.GetClockContext(system, ctx)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } local_system_clock_core.SetClockContext(ctx); - return RESULT_SUCCESS; + return ResultSuccess; } } // namespace Service::Time::Clock diff --git a/src/core/hle/service/time/system_clock_context_update_callback.cpp b/src/core/hle/service/time/system_clock_context_update_callback.cpp index bca7d869e..f656fab1c 100644 --- a/src/core/hle/service/time/system_clock_context_update_callback.cpp +++ b/src/core/hle/service/time/system_clock_context_update_callback.cpp @@ -32,7 +32,7 @@ void SystemClockContextUpdateCallback::BroadcastOperationEvent() { } ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& value) { - ResultCode result{RESULT_SUCCESS}; + ResultCode result{ResultSuccess}; if (NeedUpdate(value)) { context = value; @@ -40,7 +40,7 @@ ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& va result = Update(); - if (result == RESULT_SUCCESS) { + if (result == ResultSuccess) { BroadcastOperationEvent(); } } @@ -49,7 +49,7 @@ ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& va } ResultCode SystemClockContextUpdateCallback::Update() { - return RESULT_SUCCESS; + return ResultSuccess; } } // namespace Service::Time::Clock diff --git a/src/core/hle/service/time/system_clock_core.cpp b/src/core/hle/service/time/system_clock_core.cpp index 2ef442b56..bd334bbef 100644 --- a/src/core/hle/service/time/system_clock_core.cpp +++ b/src/core/hle/service/time/system_clock_core.cpp @@ -21,7 +21,7 @@ ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time const SteadyClockTimePoint current_time_point{steady_clock_core.GetCurrentTimePoint(system)}; SystemClockContext clock_context{}; - if (const ResultCode result{GetClockContext(system, clock_context)}; result != RESULT_SUCCESS) { + if (const ResultCode result{GetClockContext(system, clock_context)}; result != ResultSuccess) { return result; } @@ -31,7 +31,7 @@ ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time posix_time = clock_context.offset + current_time_point.time_point; - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) { @@ -39,7 +39,7 @@ ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) const SystemClockContext clock_context{posix_time - current_time_point.time_point, current_time_point}; - if (const ResultCode result{SetClockContext(clock_context)}; result != RESULT_SUCCESS) { + if (const ResultCode result{SetClockContext(clock_context)}; result != ResultSuccess) { return result; } return Flush(clock_context); @@ -47,13 +47,13 @@ ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) ResultCode SystemClockCore::Flush(const SystemClockContext& clock_context) { if (!system_clock_context_update_callback) { - return RESULT_SUCCESS; + return ResultSuccess; } return system_clock_context_update_callback->Update(clock_context); } ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& clock_context) { - if (const ResultCode result{SetClockContext(clock_context)}; result != RESULT_SUCCESS) { + if (const ResultCode result{SetClockContext(clock_context)}; result != ResultSuccess) { return result; } return Flush(clock_context); @@ -61,7 +61,7 @@ ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& cloc bool SystemClockCore::IsClockSetup(Core::System& system) const { SystemClockContext value{}; - if (GetClockContext(system, value) == RESULT_SUCCESS) { + if (GetClockContext(system, value) == ResultSuccess) { const SteadyClockTimePoint steady_clock_time_point{ steady_clock_core.GetCurrentTimePoint(system)}; return steady_clock_time_point.clock_source_id == value.steady_time_point.clock_source_id; diff --git a/src/core/hle/service/time/system_clock_core.h b/src/core/hle/service/time/system_clock_core.h index b8e6122bf..83d0e5d62 100644 --- a/src/core/hle/service/time/system_clock_core.h +++ b/src/core/hle/service/time/system_clock_core.h @@ -35,12 +35,12 @@ public: virtual ResultCode GetClockContext([[maybe_unused]] Core::System& system, SystemClockContext& value) const { value = context; - return RESULT_SUCCESS; + return ResultSuccess; } virtual ResultCode SetClockContext(const SystemClockContext& value) { context = value; - return RESULT_SUCCESS; + return ResultSuccess; } virtual ResultCode Flush(const SystemClockContext& clock_context); diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index e7991012b..d6f710eba 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -54,7 +54,7 @@ private: } IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(posix_time); } @@ -76,7 +76,7 @@ private: } IPC::ResponseBuilder rb{ctx, sizeof(Clock::SystemClockContext) / 4 + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(system_clock_context); } @@ -112,7 +112,7 @@ private: const Clock::SteadyClockTimePoint time_point{clock_core.GetCurrentTimePoint(system)}; IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(time_point); } @@ -135,7 +135,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( if (const ResultCode result{ time_manager.GetTimeZoneContentManager().GetTimeZoneManager().GetDeviceLocationName( clock_snapshot.location_name)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } @@ -144,7 +144,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime( clock_snapshot.user_time, clock_snapshot.steady_clock_time_point, clock_snapshot.user_context)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } @@ -152,7 +152,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( if (const ResultCode result{ time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules( clock_snapshot.user_time, userCalendarInfo)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } @@ -163,7 +163,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( if (Clock::ClockSnapshot::GetCurrentTime(clock_snapshot.network_time, clock_snapshot.steady_clock_time_point, - clock_snapshot.network_context) != RESULT_SUCCESS) { + clock_snapshot.network_context) != ResultSuccess) { clock_snapshot.network_time = 0; } @@ -171,20 +171,20 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( if (const ResultCode result{ time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules( clock_snapshot.network_time, networkCalendarInfo)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } clock_snapshot.network_calendar_time = networkCalendarInfo.time; clock_snapshot.network_calendar_additional_time = networkCalendarInfo.additional_info; - return RESULT_SUCCESS; + return ResultSuccess; } void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(system.GetTimeManager().GetStandardUserSystemClockCore(), system); } @@ -192,7 +192,7 @@ void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ct void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(system.GetTimeManager().GetStandardNetworkSystemClockCore(), system); } @@ -200,14 +200,14 @@ void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(system.GetTimeManager().GetStandardSteadyClockCore(), system); } void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(system, system.GetTimeManager().GetTimeZoneContentManager()); } @@ -215,7 +215,7 @@ void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushIpcInterface(system.GetTimeManager().GetStandardLocalSystemClockCore(), system); } @@ -225,7 +225,7 @@ void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient( LOG_DEBUG(Service_Time, "called"); auto& clock_core{system.GetTimeManager().GetStandardNetworkSystemClockCore()}; IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.Push(clock_core.IsStandardNetworkSystemClockAccuracySufficient(system)); } @@ -249,7 +249,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe const s64 base_time_point{context.offset + current_time_point.time_point - ticks.ToSeconds()}; IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(base_time_point); return; } @@ -296,7 +296,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { ctx.WriteBuffer(clock_snapshot); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLERequestContext& ctx) { @@ -313,7 +313,7 @@ void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLEReques Clock::ClockSnapshot clock_snapshot{}; if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal( &ctx.GetThread(), user_context, network_context, type, clock_snapshot)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -322,7 +322,7 @@ void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLEReques ctx.WriteBuffer(clock_snapshot); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser( @@ -349,7 +349,7 @@ void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser( } IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(time_span_type.nanoseconds); } @@ -370,7 +370,7 @@ void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) { if (const ResultCode result{snapshot_a.steady_clock_time_point.GetSpanBetween( snapshot_b.steady_clock_time_point, span)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { if (snapshot_a.network_time && snapshot_b.network_time) { time_span_type = Clock::TimeSpanType::FromSeconds(snapshot_b.network_time - snapshot_a.network_time); @@ -384,14 +384,14 @@ void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) { } IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(time_span_type.nanoseconds); } void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 1}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushCopyObjects(&system.Kernel().GetTimeSharedMem()); } diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index 4f9684de8..4bbc606a1 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp @@ -108,7 +108,7 @@ struct TimeManager::Impl final { std::size_t total_location_name_count, u128 time_zone_rule_version, FileSys::VirtualFile& vfs_file) { if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule( - location_name, vfs_file) != RESULT_SUCCESS) { + location_name, vfs_file) != ResultSuccess) { UNREACHABLE(); return; } @@ -152,7 +152,7 @@ struct TimeManager::Impl final { standard_local_system_clock_core.SetSystemClockContext(clock_context); } else { if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) != - RESULT_SUCCESS) { + ResultSuccess) { UNREACHABLE(); return; } @@ -167,7 +167,7 @@ struct TimeManager::Impl final { network_system_clock_context_writer); if (standard_network_system_clock_core.SetSystemClockContext(clock_context) != - RESULT_SUCCESS) { + ResultSuccess) { UNREACHABLE(); return; } @@ -180,7 +180,7 @@ struct TimeManager::Impl final { void SetupStandardUserSystemClock(Core::System& system_, bool is_automatic_correction_enabled, Clock::SteadyClockTimePoint steady_clock_time_point) { if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( - system_, is_automatic_correction_enabled) != RESULT_SUCCESS) { + system_, is_automatic_correction_enabled) != ResultSuccess) { UNREACHABLE(); return; } diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp index 57f71e6f0..bf4402308 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp @@ -81,7 +81,7 @@ void TimeZoneContentManager::Initialize(TimeManager& time_manager) { } if (FileSys::VirtualFile vfs_file; - GetTimeZoneInfoFile(location_name, vfs_file) == RESULT_SUCCESS) { + GetTimeZoneInfoFile(location_name, vfs_file) == ResultSuccess) { const auto time_point{ time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; time_manager.SetupTimeZoneManager(location_name, time_point, location_name_cache.size(), {}, @@ -95,7 +95,7 @@ ResultCode TimeZoneContentManager::LoadTimeZoneRule(TimeZoneRule& rules, const std::string& location_name) const { FileSys::VirtualFile vfs_file; if (const ResultCode result{GetTimeZoneInfoFile(location_name, vfs_file)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } @@ -138,7 +138,7 @@ ResultCode TimeZoneContentManager::GetTimeZoneInfoFile(const std::string& locati return ERROR_TIME_NOT_FOUND; } - return RESULT_SUCCESS; + return ResultSuccess; } } // namespace Service::Time::TimeZone diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 3032ca193..6da893790 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -742,7 +742,7 @@ static ResultCode CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInter calendar_additional_info.is_dst = false; calendar_additional_info.gmt_offset = gmt_offset; - return RESULT_SUCCESS; + return ResultSuccess; } static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, @@ -772,7 +772,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, } if (const ResultCode result{ ToCalendarTimeInternal(rules, new_time, calendar_time, calendar_additional_info)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } if (time < rules.ats[0]) { @@ -781,7 +781,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, calendar_time.year += years; } - return RESULT_SUCCESS; + return ResultSuccess; } s32 tti_index{}; @@ -803,7 +803,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, if (const ResultCode result{CreateCalendarTime(time, rules.ttis[tti_index].gmt_offset, calendar_time, calendar_additional_info)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { return result; } @@ -812,7 +812,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, for (int index{}; time_zone[index] != '\0'; ++index) { calendar_additional_info.timezone_name[index] = time_zone[index]; } - return RESULT_SUCCESS; + return ResultSuccess; } static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) { @@ -845,14 +845,14 @@ ResultCode TimeZoneManager::SetDeviceLocationNameWithTimeZoneRule(const std::str if (ParseTimeZoneBinary(rule, vfs_file)) { device_location_name = location_name; time_zone_rule = rule; - return RESULT_SUCCESS; + return ResultSuccess; } return ERROR_TIME_ZONE_CONVERSION_FAILED; } ResultCode TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) { time_zone_update_time_point = value; - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const { @@ -868,7 +868,7 @@ ResultCode TimeZoneManager::ParseTimeZoneRuleBinary(TimeZoneRule& rules, if (!ParseTimeZoneBinary(rules, vfs_file)) { return ERROR_TIME_ZONE_CONVERSION_FAILED; } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, @@ -981,7 +981,7 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, CalendarTimeInternal candidate_calendar_time{}; CalendarAdditionalInfo unused{}; if (ToCalendarTimeInternal(rules, pivot, candidate_calendar_time, unused) != - RESULT_SUCCESS) { + ResultSuccess) { if (pivot > 0) { direction = 1; } else { @@ -1021,7 +1021,7 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, } } } - return RESULT_SUCCESS; + return ResultSuccess; } ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time, @@ -1038,7 +1038,7 @@ ResultCode TimeZoneManager::GetDeviceLocationName(LocationName& value) const { return ERROR_UNINITIALIZED_CLOCK; } std::memcpy(value.data(), device_location_name.c_str(), device_location_name.size()); - return RESULT_SUCCESS; + return ResultSuccess; } } // namespace Service::Time::TimeZone diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp index 19d7a1a0c..5c3108768 100644 --- a/src/core/hle/service/time/time_zone_service.cpp +++ b/src/core/hle/service/time/time_zone_service.cpp @@ -35,14 +35,14 @@ void ITimeZoneService::GetDeviceLocationName(Kernel::HLERequestContext& ctx) { TimeZone::LocationName location_name{}; if (const ResultCode result{ time_zone_content_manager.GetTimeZoneManager().GetDeviceLocationName(location_name)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; } IPC::ResponseBuilder rb{ctx, (sizeof(location_name) / 4) + 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(location_name); } @@ -64,7 +64,7 @@ void ITimeZoneService::LoadTimeZoneRule(Kernel::HLERequestContext& ctx) { TimeZone::TimeZoneRule time_zone_rule{}; if (const ResultCode result{ time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -75,7 +75,7 @@ void ITimeZoneService::LoadTimeZoneRule(Kernel::HLERequestContext& ctx) { ctx.WriteBuffer(time_zone_rule_outbuffer); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); } void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) { @@ -91,14 +91,14 @@ void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) { TimeZone::CalendarInfo calendar_info{}; if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToCalendarTime( time_zone_rule, posix_time, calendar_info)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; } IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(calendar_info); } @@ -112,14 +112,14 @@ void ITimeZoneService::ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) if (const ResultCode result{ time_zone_content_manager.GetTimeZoneManager().ToCalendarTimeWithMyRules( posix_time, calendar_info)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; } IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(calendar_info); } @@ -134,7 +134,7 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) { s64 posix_time{}; if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToPosixTime( time_zone_rule, calendar_time, posix_time)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -144,7 +144,7 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) { // TODO(bunnei): Handle multiple times IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(1); // Number of times we're returning } @@ -158,7 +158,7 @@ void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) { if (const ResultCode result{ time_zone_content_manager.GetTimeZoneManager().ToPosixTimeWithMyRule(calendar_time, posix_time)}; - result != RESULT_SUCCESS) { + result != ResultSuccess) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -167,7 +167,7 @@ void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) { ctx.WriteBuffer(posix_time); IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); + rb.Push(ResultSuccess); rb.PushRaw(1); // Number of times we're returning } -- cgit v1.2.3