diff options
| author | 2023-02-11 13:28:03 -0500 | |
|---|---|---|
| committer | 2023-02-14 12:33:11 -0500 | |
| commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
| tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/core/hle/kernel/svc | |
| parent | Merge pull request #9795 from Kelebek1/biquad_fix (diff) | |
| download | yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip | |
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/core/hle/kernel/svc')
| -rw-r--r-- | src/core/hle/kernel/svc/svc_activity.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_info.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_memory.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc/svc_activity.cpp b/src/core/hle/kernel/svc/svc_activity.cpp index 1dcdb7a15..0fd1b3d4c 100644 --- a/src/core/hle/kernel/svc/svc_activity.cpp +++ b/src/core/hle/kernel/svc/svc_activity.cpp | |||
| @@ -16,7 +16,7 @@ Result SetThreadActivity(Core::System& system, Handle thread_handle, | |||
| 16 | thread_activity); | 16 | thread_activity); |
| 17 | 17 | ||
| 18 | // Validate the activity. | 18 | // Validate the activity. |
| 19 | constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { | 19 | constexpr static auto IsValidThreadActivity = [](ThreadActivity activity) { |
| 20 | return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; | 20 | return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; |
| 21 | }; | 21 | }; |
| 22 | R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); | 22 | R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); |
diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp index ad56e2fe6..c30ba0295 100644 --- a/src/core/hle/kernel/svc/svc_info.cpp +++ b/src/core/hle/kernel/svc/svc_info.cpp | |||
| @@ -193,7 +193,7 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle | |||
| 193 | return ResultSuccess; | 193 | return ResultSuccess; |
| 194 | 194 | ||
| 195 | case InfoType::ThreadTickCount: { | 195 | case InfoType::ThreadTickCount: { |
| 196 | constexpr u64 num_cpus = 4; | 196 | constexpr static u64 num_cpus = 4; |
| 197 | if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) { | 197 | if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) { |
| 198 | LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus, | 198 | LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus, |
| 199 | info_sub_id); | 199 | info_sub_id); |
diff --git a/src/core/hle/kernel/svc/svc_memory.cpp b/src/core/hle/kernel/svc/svc_memory.cpp index 21f818da6..7045c5e69 100644 --- a/src/core/hle/kernel/svc/svc_memory.cpp +++ b/src/core/hle/kernel/svc/svc_memory.cpp | |||
| @@ -132,7 +132,7 @@ Result SetMemoryAttribute(Core::System& system, VAddr address, u64 size, u32 mas | |||
| 132 | R_UNLESS((address < address + size), ResultInvalidCurrentMemory); | 132 | R_UNLESS((address < address + size), ResultInvalidCurrentMemory); |
| 133 | 133 | ||
| 134 | // Validate the attribute and mask. | 134 | // Validate the attribute and mask. |
| 135 | constexpr u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached); | 135 | constexpr static u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached); |
| 136 | R_UNLESS((mask | attr) == mask, ResultInvalidCombination); | 136 | R_UNLESS((mask | attr) == mask, ResultInvalidCombination); |
| 137 | R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); | 137 | R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); |
| 138 | 138 | ||