diff options
| author | 2024-02-19 16:00:46 +0100 | |
|---|---|---|
| committer | 2024-02-19 16:00:46 +0100 | |
| commit | 310c1f50beb77fc5c6f9075029973161d4e51a4a (patch) | |
| tree | 43a5699123e4930560fc5016faac7efb15b63f4e /src/core/hle/service/glue | |
| parent | core/CMakeLists: Sort alphabetically (diff) | |
| download | yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.tar.gz yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.tar.xz yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.zip | |
scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
Diffstat (limited to 'src/core/hle/service/glue')
| -rw-r--r-- | src/core/hle/service/glue/time/static.cpp | 41 | ||||
| -rw-r--r-- | src/core/hle/service/glue/time/time_zone.cpp | 36 |
2 files changed, 49 insertions, 28 deletions
diff --git a/src/core/hle/service/glue/time/static.cpp b/src/core/hle/service/glue/time/static.cpp index ec9b0efb1..b801faef2 100644 --- a/src/core/hle/service/glue/time/static.cpp +++ b/src/core/hle/service/glue/time/static.cpp | |||
| @@ -142,16 +142,18 @@ Result StaticService::SetStandardSteadyClockInternalOffset(s64 offset_ns) { | |||
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | Result StaticService::GetStandardSteadyClockRtcValue(Out<s64> out_rtc_value) { | 144 | Result StaticService::GetStandardSteadyClockRtcValue(Out<s64> out_rtc_value) { |
| 145 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_rtc_value={}", *out_rtc_value); }); | 145 | SCOPE_EXIT { |
| 146 | LOG_DEBUG(Service_Time, "called. out_rtc_value={}", *out_rtc_value); | ||
| 147 | }; | ||
| 146 | 148 | ||
| 147 | R_RETURN(m_standard_steady_clock_resource.GetRtcTimeInSeconds(*out_rtc_value)); | 149 | R_RETURN(m_standard_steady_clock_resource.GetRtcTimeInSeconds(*out_rtc_value)); |
| 148 | } | 150 | } |
| 149 | 151 | ||
| 150 | Result StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled( | 152 | Result StaticService::IsStandardUserSystemClockAutomaticCorrectionEnabled( |
| 151 | Out<bool> out_automatic_correction) { | 153 | Out<bool> out_automatic_correction) { |
| 152 | SCOPE_EXIT({ | 154 | SCOPE_EXIT { |
| 153 | LOG_DEBUG(Service_Time, "called. out_automatic_correction={}", *out_automatic_correction); | 155 | LOG_DEBUG(Service_Time, "called. out_automatic_correction={}", *out_automatic_correction); |
| 154 | }); | 156 | }; |
| 155 | 157 | ||
| 156 | R_RETURN(m_wrapped_service->IsStandardUserSystemClockAutomaticCorrectionEnabled( | 158 | R_RETURN(m_wrapped_service->IsStandardUserSystemClockAutomaticCorrectionEnabled( |
| 157 | out_automatic_correction)); | 159 | out_automatic_correction)); |
| @@ -166,21 +168,27 @@ Result StaticService::SetStandardUserSystemClockAutomaticCorrectionEnabled( | |||
| 166 | } | 168 | } |
| 167 | 169 | ||
| 168 | Result StaticService::GetStandardUserSystemClockInitialYear(Out<s32> out_year) { | 170 | Result StaticService::GetStandardUserSystemClockInitialYear(Out<s32> out_year) { |
| 169 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_year={}", *out_year); }); | 171 | SCOPE_EXIT { |
| 172 | LOG_DEBUG(Service_Time, "called. out_year={}", *out_year); | ||
| 173 | }; | ||
| 170 | 174 | ||
| 171 | R_RETURN(m_set_sys->GetSettingsItemValueImpl<s32>(*out_year, "time", | 175 | R_RETURN(m_set_sys->GetSettingsItemValueImpl<s32>(*out_year, "time", |
| 172 | "standard_user_clock_initial_year")); | 176 | "standard_user_clock_initial_year")); |
| 173 | } | 177 | } |
| 174 | 178 | ||
| 175 | Result StaticService::IsStandardNetworkSystemClockAccuracySufficient(Out<bool> out_is_sufficient) { | 179 | Result StaticService::IsStandardNetworkSystemClockAccuracySufficient(Out<bool> out_is_sufficient) { |
| 176 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_is_sufficient={}", *out_is_sufficient); }); | 180 | SCOPE_EXIT { |
| 181 | LOG_DEBUG(Service_Time, "called. out_is_sufficient={}", *out_is_sufficient); | ||
| 182 | }; | ||
| 177 | 183 | ||
| 178 | R_RETURN(m_wrapped_service->IsStandardNetworkSystemClockAccuracySufficient(out_is_sufficient)); | 184 | R_RETURN(m_wrapped_service->IsStandardNetworkSystemClockAccuracySufficient(out_is_sufficient)); |
| 179 | } | 185 | } |
| 180 | 186 | ||
| 181 | Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( | 187 | Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( |
| 182 | Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point) { | 188 | Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point) { |
| 183 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_time_point={}", *out_time_point); }); | 189 | SCOPE_EXIT { |
| 190 | LOG_DEBUG(Service_Time, "called. out_time_point={}", *out_time_point); | ||
| 191 | }; | ||
| 184 | 192 | ||
| 185 | R_RETURN(m_wrapped_service->GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( | 193 | R_RETURN(m_wrapped_service->GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( |
| 186 | out_time_point)); | 194 | out_time_point)); |
| @@ -188,15 +196,18 @@ Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( | |||
| 188 | 196 | ||
| 189 | Result StaticService::CalculateMonotonicSystemClockBaseTimePoint( | 197 | Result StaticService::CalculateMonotonicSystemClockBaseTimePoint( |
| 190 | Out<s64> out_time, const Service::PSC::Time::SystemClockContext& context) { | 198 | Out<s64> out_time, const Service::PSC::Time::SystemClockContext& context) { |
| 191 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time); }); | 199 | SCOPE_EXIT { |
| 200 | LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time); | ||
| 201 | }; | ||
| 192 | 202 | ||
| 193 | R_RETURN(m_wrapped_service->CalculateMonotonicSystemClockBaseTimePoint(out_time, context)); | 203 | R_RETURN(m_wrapped_service->CalculateMonotonicSystemClockBaseTimePoint(out_time, context)); |
| 194 | } | 204 | } |
| 195 | 205 | ||
| 196 | Result StaticService::GetClockSnapshot(OutClockSnapshot out_snapshot, | 206 | Result StaticService::GetClockSnapshot(OutClockSnapshot out_snapshot, |
| 197 | Service::PSC::Time::TimeType type) { | 207 | Service::PSC::Time::TimeType type) { |
| 198 | SCOPE_EXIT( | 208 | SCOPE_EXIT { |
| 199 | { LOG_DEBUG(Service_Time, "called. type={} out_snapshot={}", type, *out_snapshot); }); | 209 | LOG_DEBUG(Service_Time, "called. type={} out_snapshot={}", type, *out_snapshot); |
| 210 | }; | ||
| 200 | 211 | ||
| 201 | R_RETURN(m_wrapped_service->GetClockSnapshot(out_snapshot, type)); | 212 | R_RETURN(m_wrapped_service->GetClockSnapshot(out_snapshot, type)); |
| 202 | } | 213 | } |
| @@ -205,11 +216,11 @@ Result StaticService::GetClockSnapshotFromSystemClockContext( | |||
| 205 | Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot, | 216 | Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot, |
| 206 | const Service::PSC::Time::SystemClockContext& user_context, | 217 | const Service::PSC::Time::SystemClockContext& user_context, |
| 207 | const Service::PSC::Time::SystemClockContext& network_context) { | 218 | const Service::PSC::Time::SystemClockContext& network_context) { |
| 208 | SCOPE_EXIT({ | 219 | SCOPE_EXIT { |
| 209 | LOG_DEBUG(Service_Time, | 220 | LOG_DEBUG(Service_Time, |
| 210 | "called. type={} out_snapshot={} user_context={} network_context={}", type, | 221 | "called. type={} out_snapshot={} user_context={} network_context={}", type, |
| 211 | *out_snapshot, user_context, network_context); | 222 | *out_snapshot, user_context, network_context); |
| 212 | }); | 223 | }; |
| 213 | 224 | ||
| 214 | R_RETURN(m_wrapped_service->GetClockSnapshotFromSystemClockContext( | 225 | R_RETURN(m_wrapped_service->GetClockSnapshotFromSystemClockContext( |
| 215 | type, out_snapshot, user_context, network_context)); | 226 | type, out_snapshot, user_context, network_context)); |
| @@ -218,14 +229,18 @@ Result StaticService::GetClockSnapshotFromSystemClockContext( | |||
| 218 | Result StaticService::CalculateStandardUserSystemClockDifferenceByUser(Out<s64> out_time, | 229 | Result StaticService::CalculateStandardUserSystemClockDifferenceByUser(Out<s64> out_time, |
| 219 | InClockSnapshot a, | 230 | InClockSnapshot a, |
| 220 | InClockSnapshot b) { | 231 | InClockSnapshot b) { |
| 221 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time); }); | 232 | SCOPE_EXIT { |
| 233 | LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time); | ||
| 234 | }; | ||
| 222 | 235 | ||
| 223 | R_RETURN(m_wrapped_service->CalculateStandardUserSystemClockDifferenceByUser(out_time, a, b)); | 236 | R_RETURN(m_wrapped_service->CalculateStandardUserSystemClockDifferenceByUser(out_time, a, b)); |
| 224 | } | 237 | } |
| 225 | 238 | ||
| 226 | Result StaticService::CalculateSpanBetween(Out<s64> out_time, InClockSnapshot a, | 239 | Result StaticService::CalculateSpanBetween(Out<s64> out_time, InClockSnapshot a, |
| 227 | InClockSnapshot b) { | 240 | InClockSnapshot b) { |
| 228 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time); }); | 241 | SCOPE_EXIT { |
| 242 | LOG_DEBUG(Service_Time, "called. a={} b={} out_time={}", *a, *b, *out_time); | ||
| 243 | }; | ||
| 229 | 244 | ||
| 230 | R_RETURN(m_wrapped_service->CalculateSpanBetween(out_time, a, b)); | 245 | R_RETURN(m_wrapped_service->CalculateSpanBetween(out_time, a, b)); |
| 231 | } | 246 | } |
diff --git a/src/core/hle/service/glue/time/time_zone.cpp b/src/core/hle/service/glue/time/time_zone.cpp index 36f163419..f4d0c87d5 100644 --- a/src/core/hle/service/glue/time/time_zone.cpp +++ b/src/core/hle/service/glue/time/time_zone.cpp | |||
| @@ -57,7 +57,9 @@ TimeZoneService::~TimeZoneService() = default; | |||
| 57 | 57 | ||
| 58 | Result TimeZoneService::GetDeviceLocationName( | 58 | Result TimeZoneService::GetDeviceLocationName( |
| 59 | Out<Service::PSC::Time::LocationName> out_location_name) { | 59 | Out<Service::PSC::Time::LocationName> out_location_name) { |
| 60 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_location_name={}", *out_location_name); }); | 60 | SCOPE_EXIT { |
| 61 | LOG_DEBUG(Service_Time, "called. out_location_name={}", *out_location_name); | ||
| 62 | }; | ||
| 61 | 63 | ||
| 62 | R_RETURN(m_wrapped_service->GetDeviceLocationName(out_location_name)); | 64 | R_RETURN(m_wrapped_service->GetDeviceLocationName(out_location_name)); |
| 63 | } | 65 | } |
| @@ -94,7 +96,9 @@ Result TimeZoneService::SetDeviceLocationName( | |||
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | Result TimeZoneService::GetTotalLocationNameCount(Out<u32> out_count) { | 98 | Result TimeZoneService::GetTotalLocationNameCount(Out<u32> out_count) { |
| 97 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_count={}", *out_count); }); | 99 | SCOPE_EXIT { |
| 100 | LOG_DEBUG(Service_Time, "called. out_count={}", *out_count); | ||
| 101 | }; | ||
| 98 | 102 | ||
| 99 | R_RETURN(m_wrapped_service->GetTotalLocationNameCount(out_count)); | 103 | R_RETURN(m_wrapped_service->GetTotalLocationNameCount(out_count)); |
| 100 | } | 104 | } |
| @@ -102,10 +106,10 @@ Result TimeZoneService::GetTotalLocationNameCount(Out<u32> out_count) { | |||
| 102 | Result TimeZoneService::LoadLocationNameList( | 106 | Result TimeZoneService::LoadLocationNameList( |
| 103 | Out<u32> out_count, | 107 | Out<u32> out_count, |
| 104 | OutArray<Service::PSC::Time::LocationName, BufferAttr_HipcMapAlias> out_names, u32 index) { | 108 | OutArray<Service::PSC::Time::LocationName, BufferAttr_HipcMapAlias> out_names, u32 index) { |
| 105 | SCOPE_EXIT({ | 109 | SCOPE_EXIT { |
| 106 | LOG_DEBUG(Service_Time, "called. index={} out_count={} out_names[0]={} out_names[1]={}", | 110 | LOG_DEBUG(Service_Time, "called. index={} out_count={} out_names[0]={} out_names[1]={}", |
| 107 | index, *out_count, out_names[0], out_names[1]); | 111 | index, *out_count, out_names[0], out_names[1]); |
| 108 | }); | 112 | }; |
| 109 | 113 | ||
| 110 | std::scoped_lock l{m_mutex}; | 114 | std::scoped_lock l{m_mutex}; |
| 111 | R_RETURN(GetTimeZoneLocationList(*out_count, out_names, out_names.size(), index)); | 115 | R_RETURN(GetTimeZoneLocationList(*out_count, out_names, out_names.size(), index)); |
| @@ -124,7 +128,9 @@ Result TimeZoneService::LoadTimeZoneRule(OutRule out_rule, | |||
| 124 | 128 | ||
| 125 | Result TimeZoneService::GetTimeZoneRuleVersion( | 129 | Result TimeZoneService::GetTimeZoneRuleVersion( |
| 126 | Out<Service::PSC::Time::RuleVersion> out_rule_version) { | 130 | Out<Service::PSC::Time::RuleVersion> out_rule_version) { |
| 127 | SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. out_rule_version={}", *out_rule_version); }); | 131 | SCOPE_EXIT { |
| 132 | LOG_DEBUG(Service_Time, "called. out_rule_version={}", *out_rule_version); | ||
| 133 | }; | ||
| 128 | 134 | ||
| 129 | R_RETURN(m_wrapped_service->GetTimeZoneRuleVersion(out_rule_version)); | 135 | R_RETURN(m_wrapped_service->GetTimeZoneRuleVersion(out_rule_version)); |
| 130 | } | 136 | } |
| @@ -132,10 +138,10 @@ Result TimeZoneService::GetTimeZoneRuleVersion( | |||
| 132 | Result TimeZoneService::GetDeviceLocationNameAndUpdatedTime( | 138 | Result TimeZoneService::GetDeviceLocationNameAndUpdatedTime( |
| 133 | Out<Service::PSC::Time::LocationName> location_name, | 139 | Out<Service::PSC::Time::LocationName> location_name, |
| 134 | Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point) { | 140 | Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point) { |
| 135 | SCOPE_EXIT({ | 141 | SCOPE_EXIT { |
| 136 | LOG_DEBUG(Service_Time, "called. location_name={} out_time_point={}", *location_name, | 142 | LOG_DEBUG(Service_Time, "called. location_name={} out_time_point={}", *location_name, |
| 137 | *out_time_point); | 143 | *out_time_point); |
| 138 | }); | 144 | }; |
| 139 | 145 | ||
| 140 | R_RETURN(m_wrapped_service->GetDeviceLocationNameAndUpdatedTime(location_name, out_time_point)); | 146 | R_RETURN(m_wrapped_service->GetDeviceLocationNameAndUpdatedTime(location_name, out_time_point)); |
| 141 | } | 147 | } |
| @@ -178,10 +184,10 @@ Result TimeZoneService::GetDeviceLocationNameOperationEventReadableHandle( | |||
| 178 | Result TimeZoneService::ToCalendarTime( | 184 | Result TimeZoneService::ToCalendarTime( |
| 179 | Out<Service::PSC::Time::CalendarTime> out_calendar_time, | 185 | Out<Service::PSC::Time::CalendarTime> out_calendar_time, |
| 180 | Out<Service::PSC::Time::CalendarAdditionalInfo> out_additional_info, s64 time, InRule rule) { | 186 | Out<Service::PSC::Time::CalendarAdditionalInfo> out_additional_info, s64 time, InRule rule) { |
| 181 | SCOPE_EXIT({ | 187 | SCOPE_EXIT { |
| 182 | LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time, | 188 | LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time, |
| 183 | *out_calendar_time, *out_additional_info); | 189 | *out_calendar_time, *out_additional_info); |
| 184 | }); | 190 | }; |
| 185 | 191 | ||
| 186 | R_RETURN(m_wrapped_service->ToCalendarTime(out_calendar_time, out_additional_info, time, rule)); | 192 | R_RETURN(m_wrapped_service->ToCalendarTime(out_calendar_time, out_additional_info, time, rule)); |
| 187 | } | 193 | } |
| @@ -189,10 +195,10 @@ Result TimeZoneService::ToCalendarTime( | |||
| 189 | Result TimeZoneService::ToCalendarTimeWithMyRule( | 195 | Result TimeZoneService::ToCalendarTimeWithMyRule( |
| 190 | Out<Service::PSC::Time::CalendarTime> out_calendar_time, | 196 | Out<Service::PSC::Time::CalendarTime> out_calendar_time, |
| 191 | Out<Service::PSC::Time::CalendarAdditionalInfo> out_additional_info, s64 time) { | 197 | Out<Service::PSC::Time::CalendarAdditionalInfo> out_additional_info, s64 time) { |
| 192 | SCOPE_EXIT({ | 198 | SCOPE_EXIT { |
| 193 | LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time, | 199 | LOG_DEBUG(Service_Time, "called. time={} out_calendar_time={} out_additional_info={}", time, |
| 194 | *out_calendar_time, *out_additional_info); | 200 | *out_calendar_time, *out_additional_info); |
| 195 | }); | 201 | }; |
| 196 | 202 | ||
| 197 | R_RETURN( | 203 | R_RETURN( |
| 198 | m_wrapped_service->ToCalendarTimeWithMyRule(out_calendar_time, out_additional_info, time)); | 204 | m_wrapped_service->ToCalendarTimeWithMyRule(out_calendar_time, out_additional_info, time)); |
| @@ -202,11 +208,11 @@ Result TimeZoneService::ToPosixTime(Out<u32> out_count, | |||
| 202 | OutArray<s64, BufferAttr_HipcPointer> out_times, | 208 | OutArray<s64, BufferAttr_HipcPointer> out_times, |
| 203 | const Service::PSC::Time::CalendarTime& calendar_time, | 209 | const Service::PSC::Time::CalendarTime& calendar_time, |
| 204 | InRule rule) { | 210 | InRule rule) { |
| 205 | SCOPE_EXIT({ | 211 | SCOPE_EXIT { |
| 206 | LOG_DEBUG(Service_Time, | 212 | LOG_DEBUG(Service_Time, |
| 207 | "called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}", | 213 | "called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}", |
| 208 | calendar_time, *out_count, out_times[0], out_times[1]); | 214 | calendar_time, *out_count, out_times[0], out_times[1]); |
| 209 | }); | 215 | }; |
| 210 | 216 | ||
| 211 | R_RETURN(m_wrapped_service->ToPosixTime(out_count, out_times, calendar_time, rule)); | 217 | R_RETURN(m_wrapped_service->ToPosixTime(out_count, out_times, calendar_time, rule)); |
| 212 | } | 218 | } |
| @@ -214,11 +220,11 @@ Result TimeZoneService::ToPosixTime(Out<u32> out_count, | |||
| 214 | Result TimeZoneService::ToPosixTimeWithMyRule( | 220 | Result TimeZoneService::ToPosixTimeWithMyRule( |
| 215 | Out<u32> out_count, OutArray<s64, BufferAttr_HipcPointer> out_times, | 221 | Out<u32> out_count, OutArray<s64, BufferAttr_HipcPointer> out_times, |
| 216 | const Service::PSC::Time::CalendarTime& calendar_time) { | 222 | const Service::PSC::Time::CalendarTime& calendar_time) { |
| 217 | SCOPE_EXIT({ | 223 | SCOPE_EXIT { |
| 218 | LOG_DEBUG(Service_Time, | 224 | LOG_DEBUG(Service_Time, |
| 219 | "called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}", | 225 | "called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}", |
| 220 | calendar_time, *out_count, out_times[0], out_times[1]); | 226 | calendar_time, *out_count, out_times[0], out_times[1]); |
| 221 | }); | 227 | }; |
| 222 | 228 | ||
| 223 | R_RETURN(m_wrapped_service->ToPosixTimeWithMyRule(out_count, out_times, calendar_time)); | 229 | R_RETURN(m_wrapped_service->ToPosixTimeWithMyRule(out_count, out_times, calendar_time)); |
| 224 | } | 230 | } |