mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-15 09:10:46 -04:00
scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
This commit is contained in:
@@ -144,7 +144,9 @@ Result StaticService::GetStandardSteadyClockRtcValue(Out<s64> out_rtc_value) {
|
||||
|
||||
Result StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled(
|
||||
Out<bool> out_is_enabled) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_is_enabled={}", *out_is_enabled); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_is_enabled={}", *out_is_enabled);
|
||||
};
|
||||
|
||||
R_UNLESS(m_user_system_clock.IsInitialized(), ResultClockUninitialized);
|
||||
|
||||
@@ -180,7 +182,9 @@ Result StaticService::GetStandardUserSystemClockInitialYear(Out<s32> out_year) {
|
||||
}
|
||||
|
||||
Result StaticService::IsStandardNetworkSystemClockAccuracySufficient(Out<bool> out_is_sufficient) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_is_sufficient={}", *out_is_sufficient); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_is_sufficient={}", *out_is_sufficient);
|
||||
};
|
||||
|
||||
*out_is_sufficient = m_network_system_clock.IsAccuracySufficient();
|
||||
|
||||
@@ -189,7 +193,9 @@ Result StaticService::IsStandardNetworkSystemClockAccuracySufficient(Out<bool> o
|
||||
|
||||
Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
Out<SteadyClockTimePoint> 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_user_system_clock.IsInitialized(), ResultClockUninitialized);
|
||||
|
||||
@@ -200,7 +206,9 @@ Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
|
||||
Result StaticService::CalculateMonotonicSystemClockBaseTimePoint(
|
||||
Out<s64> out_time, const SystemClockContext& context) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time);
|
||||
};
|
||||
|
||||
R_UNLESS(m_time->m_standard_steady_clock.IsInitialized(), ResultClockUninitialized);
|
||||
|
||||
@@ -219,8 +227,9 @@ Result StaticService::CalculateMonotonicSystemClockBaseTimePoint(
|
||||
}
|
||||
|
||||
Result StaticService::GetClockSnapshot(OutClockSnapshot out_snapshot, TimeType type) {
|
||||
SCOPE_EXIT(
|
||||
{ LOG_DEBUG(Service_Time, "called. type={} out_snapshot={}", type, *out_snapshot); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. type={} out_snapshot={}", type, *out_snapshot);
|
||||
};
|
||||
|
||||
SystemClockContext user_context{};
|
||||
R_TRY(m_user_system_clock.GetContext(user_context));
|
||||
@@ -234,11 +243,11 @@ Result StaticService::GetClockSnapshot(OutClockSnapshot out_snapshot, TimeType t
|
||||
Result StaticService::GetClockSnapshotFromSystemClockContext(
|
||||
TimeType type, OutClockSnapshot out_snapshot, const SystemClockContext& user_context,
|
||||
const SystemClockContext& network_context) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time,
|
||||
"called. type={} user_context={} network_context={} out_snapshot={}", type,
|
||||
user_context, network_context, *out_snapshot);
|
||||
});
|
||||
};
|
||||
|
||||
R_RETURN(GetClockSnapshotImpl(out_snapshot, user_context, network_context, type));
|
||||
}
|
||||
@@ -246,9 +255,9 @@ Result StaticService::GetClockSnapshotFromSystemClockContext(
|
||||
Result StaticService::CalculateStandardUserSystemClockDifferenceByUser(Out<s64> out_difference,
|
||||
InClockSnapshot a,
|
||||
InClockSnapshot b) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. a={} b={} out_difference={}", *a, *b, *out_difference);
|
||||
});
|
||||
};
|
||||
|
||||
auto diff_s =
|
||||
std::chrono::seconds(b->user_context.offset) - std::chrono::seconds(a->user_context.offset);
|
||||
@@ -276,7 +285,9 @@ Result StaticService::CalculateStandardUserSystemClockDifferenceByUser(Out<s64>
|
||||
|
||||
Result StaticService::CalculateSpanBetween(Out<s64> out_time, InClockSnapshot a,
|
||||
InClockSnapshot b) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time);
|
||||
};
|
||||
|
||||
s64 time_s{};
|
||||
auto res =
|
||||
|
||||
@@ -29,7 +29,9 @@ SteadyClock::SteadyClock(Core::System& system_, std::shared_ptr<TimeManager> man
|
||||
}
|
||||
|
||||
Result SteadyClock::GetCurrentTimePoint(Out<SteadyClockTimePoint> 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<SteadyClockTimePoint> out_time_point
|
||||
}
|
||||
|
||||
Result SteadyClock::GetTestOffset(Out<s64> 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<s64> 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<s64> out_rtc_value) {
|
||||
}
|
||||
|
||||
Result SteadyClock::IsRtcResetDetected(Out<bool> 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<bool> out_is_detected) {
|
||||
}
|
||||
|
||||
Result SteadyClock::GetSetupResultValue(Out<Result> 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<Result> out_result) {
|
||||
}
|
||||
|
||||
Result SteadyClock::GetInternalOffset(Out<s64> 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);
|
||||
|
||||
@@ -26,7 +26,9 @@ SystemClock::SystemClock(Core::System& system_, SystemClockCore& clock_core, boo
|
||||
}
|
||||
|
||||
Result SystemClock::GetCurrentTime(Out<s64> out_time) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_time={}", *out_time); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_time={}", *out_time);
|
||||
};
|
||||
|
||||
R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(),
|
||||
ResultClockUninitialized);
|
||||
@@ -45,7 +47,9 @@ Result SystemClock::SetCurrentTime(s64 time) {
|
||||
}
|
||||
|
||||
Result SystemClock::GetSystemClockContext(Out<SystemClockContext> out_context) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_context={}", *out_context); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_context={}", *out_context);
|
||||
};
|
||||
|
||||
R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(),
|
||||
ResultClockUninitialized);
|
||||
|
||||
@@ -37,7 +37,9 @@ TimeZoneService::TimeZoneService(Core::System& system_, StandardSteadyClockCore&
|
||||
}
|
||||
|
||||
Result TimeZoneService::GetDeviceLocationName(Out<LocationName> out_location_name) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_location_name={}", *out_location_name); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_location_name={}", *out_location_name);
|
||||
};
|
||||
|
||||
R_RETURN(m_time_zone.GetLocationName(*out_location_name));
|
||||
}
|
||||
@@ -50,7 +52,9 @@ Result TimeZoneService::SetDeviceLocationName(const LocationName& location_name)
|
||||
}
|
||||
|
||||
Result TimeZoneService::GetTotalLocationNameCount(Out<u32> out_count) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_count={}", *out_count); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_count={}", *out_count);
|
||||
};
|
||||
|
||||
R_RETURN(m_time_zone.GetTotalLocationCount(*out_count));
|
||||
}
|
||||
@@ -69,17 +73,19 @@ Result TimeZoneService::LoadTimeZoneRule(OutRule out_rule, const LocationName& l
|
||||
}
|
||||
|
||||
Result TimeZoneService::GetTimeZoneRuleVersion(Out<RuleVersion> out_rule_version) {
|
||||
SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_rule_version={}", *out_rule_version); });
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_rule_version={}", *out_rule_version);
|
||||
};
|
||||
|
||||
R_RETURN(m_time_zone.GetRuleVersion(*out_rule_version));
|
||||
}
|
||||
|
||||
Result TimeZoneService::GetDeviceLocationNameAndUpdatedTime(
|
||||
Out<LocationName> out_location_name, Out<SteadyClockTimePoint> out_time_point) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_location_name={} out_time_point={}",
|
||||
*out_location_name, *out_time_point);
|
||||
});
|
||||
};
|
||||
|
||||
R_TRY(m_time_zone.GetLocationName(*out_location_name));
|
||||
R_RETURN(m_time_zone.GetTimePoint(*out_time_point));
|
||||
@@ -116,10 +122,10 @@ Result TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle(
|
||||
Result TimeZoneService::ToCalendarTime(Out<CalendarTime> out_calendar_time,
|
||||
Out<CalendarAdditionalInfo> out_additional_info, s64 time,
|
||||
InRule rule) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time,
|
||||
*out_calendar_time, *out_additional_info);
|
||||
});
|
||||
};
|
||||
|
||||
R_RETURN(
|
||||
m_time_zone.ToCalendarTime(*out_calendar_time, *out_additional_info, time, *rule.Get()));
|
||||
@@ -128,10 +134,10 @@ Result TimeZoneService::ToCalendarTime(Out<CalendarTime> out_calendar_time,
|
||||
Result TimeZoneService::ToCalendarTimeWithMyRule(Out<CalendarTime> out_calendar_time,
|
||||
Out<CalendarAdditionalInfo> out_additional_info,
|
||||
s64 time) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time,
|
||||
*out_calendar_time, *out_additional_info);
|
||||
});
|
||||
};
|
||||
|
||||
R_RETURN(m_time_zone.ToCalendarTimeWithMyRule(*out_calendar_time, *out_additional_info, time));
|
||||
}
|
||||
@@ -139,11 +145,11 @@ Result TimeZoneService::ToCalendarTimeWithMyRule(Out<CalendarTime> out_calendar_
|
||||
Result TimeZoneService::ToPosixTime(Out<u32> out_count,
|
||||
OutArray<s64, BufferAttr_HipcPointer> out_times,
|
||||
const CalendarTime& calendar_time, InRule rule) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time,
|
||||
"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={} ",
|
||||
calendar_time, *out_count, out_times[0], out_times[1]);
|
||||
});
|
||||
};
|
||||
|
||||
R_RETURN(
|
||||
m_time_zone.ToPosixTime(*out_count, out_times, out_times.size(), calendar_time, *rule));
|
||||
@@ -152,11 +158,11 @@ Result TimeZoneService::ToPosixTime(Out<u32> out_count,
|
||||
Result TimeZoneService::ToPosixTimeWithMyRule(Out<u32> out_count,
|
||||
OutArray<s64, BufferAttr_HipcPointer> out_times,
|
||||
const CalendarTime& calendar_time) {
|
||||
SCOPE_EXIT({
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time,
|
||||
"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={} ",
|
||||
calendar_time, *out_count, out_times[0], out_times[1]);
|
||||
});
|
||||
};
|
||||
|
||||
R_RETURN(
|
||||
m_time_zone.ToPosixTimeWithMyRule(*out_count, out_times, out_times.size(), calendar_time));
|
||||
|
||||
Reference in New Issue
Block a user