From 310c1f50beb77fc5c6f9075029973161d4e51a4a Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 19 Feb 2024 16:00:46 +0100 Subject: scope_exit: Make constexpr Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it. --- src/core/hle/service/psc/time/steady_clock.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/core/hle/service/psc/time/steady_clock.cpp') diff --git a/src/core/hle/service/psc/time/steady_clock.cpp b/src/core/hle/service/psc/time/steady_clock.cpp index 948610a2b..78dcf532c 100644 --- a/src/core/hle/service/psc/time/steady_clock.cpp +++ b/src/core/hle/service/psc/time/steady_clock.cpp @@ -29,7 +29,9 @@ SteadyClock::SteadyClock(Core::System& system_, std::shared_ptr man } Result SteadyClock::GetCurrentTimePoint(Out out_time_point) { - SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_time_point={}", *out_time_point); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_time_point={}", *out_time_point); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); @@ -38,7 +40,9 @@ Result SteadyClock::GetCurrentTimePoint(Out out_time_point } Result SteadyClock::GetTestOffset(Out out_test_offset) { - SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_test_offset={}", *out_test_offset); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_test_offset={}", *out_test_offset); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); @@ -59,7 +63,9 @@ Result SteadyClock::SetTestOffset(s64 test_offset) { } Result SteadyClock::GetRtcValue(Out out_rtc_value) { - SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_rtc_value={}", *out_rtc_value); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_rtc_value={}", *out_rtc_value); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); @@ -68,7 +74,9 @@ Result SteadyClock::GetRtcValue(Out out_rtc_value) { } Result SteadyClock::IsRtcResetDetected(Out out_is_detected) { - SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_is_detected={}", *out_is_detected); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_is_detected={}", *out_is_detected); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); @@ -78,7 +86,9 @@ Result SteadyClock::IsRtcResetDetected(Out out_is_detected) { } Result SteadyClock::GetSetupResultValue(Out out_result) { - SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_result=0x{:X}", out_result->raw); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_result=0x{:X}", out_result->raw); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); @@ -88,8 +98,9 @@ Result SteadyClock::GetSetupResultValue(Out out_result) { } Result SteadyClock::GetInternalOffset(Out out_internal_offset) { - SCOPE_EXIT( - { LOG_DEBUG(Service_Time, "called. out_internal_offset={}", *out_internal_offset); }); + SCOPE_EXIT { + LOG_DEBUG(Service_Time, "called. out_internal_offset={}", *out_internal_offset); + }; R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(), ResultClockUninitialized); -- cgit v1.2.3