summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2021-02-03 21:56:20 -0500
committerGravatar Lioncash2021-02-06 04:08:27 -0500
commit40ab2b934805e80b0a54d390b7b58291c37af36f (patch)
treeb1257724da679a47e482bd2931b36260b846abef /src
parentk_address_arbiter: Remove unnecessary usages of std::addressof (diff)
downloadyuzu-40ab2b934805e80b0a54d390b7b58291c37af36f.tar.gz
yuzu-40ab2b934805e80b0a54d390b7b58291c37af36f.tar.xz
yuzu-40ab2b934805e80b0a54d390b7b58291c37af36f.zip
k_address_arbiter: Unfold R_UNLESS macros
Allows for more descriptive error messages and also doesn't hide control-path exit returns from the reader.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index 3c3e51dbe..d0e90fd60 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -118,9 +118,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
118 118
119 // Check the userspace value. 119 // Check the userspace value.
120 s32 user_value{}; 120 s32 user_value{};
121 R_UNLESS(UpdateIfEqual(system, &user_value, addr, value, value + 1), 121 if (!UpdateIfEqual(system, &user_value, addr, value, value + 1)) {
122 Svc::ResultInvalidCurrentMemory); 122 LOG_ERROR(Kernel, "Invalid current memory!");
123 123 return Svc::ResultInvalidCurrentMemory;
124 }
124 if (user_value != value) { 125 if (user_value != value) {
125 return Svc::ResultInvalidState; 126 return Svc::ResultInvalidState;
126 } 127 }
@@ -186,8 +187,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
186 succeeded = ReadFromUser(system, &user_value, addr); 187 succeeded = ReadFromUser(system, &user_value, addr);
187 } 188 }
188 189
189 R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory); 190 if (!succeeded) {
190 191 LOG_ERROR(Kernel, "Invalid current memory!");
192 return Svc::ResultInvalidCurrentMemory;
193 }
191 if (user_value != value) { 194 if (user_value != value) {
192 return Svc::ResultInvalidState; 195 return Svc::ResultInvalidState;
193 } 196 }