summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2021-02-03 21:49:41 -0500
committerGravatar Lioncash2021-02-06 04:06:33 -0500
commitb8fc74d74d766caaf4f66a1d1064585b2d40ce8e (patch)
tree331010d9faf1723496d558b2c366c19d5bc8d4a3 /src
parentk_address_arbiter: Remove dead code (diff)
downloadyuzu-b8fc74d74d766caaf4f66a1d1064585b2d40ce8e.tar.gz
yuzu-b8fc74d74d766caaf4f66a1d1064585b2d40ce8e.tar.xz
yuzu-b8fc74d74d766caaf4f66a1d1064585b2d40ce8e.zip
k_address_arbiter: Remove unnecessary usages of std::addressof
This is a useful function in a generic context or with types that overload unary operator&. However, primitives and pointers will never do this, so we can opt for a more straightforward syntax.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index 02c629a3d..3c3e51dbe 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -118,7 +118,7 @@ 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, std::addressof(user_value), addr, value, value + 1), 121 R_UNLESS(UpdateIfEqual(system, &user_value, addr, value, value + 1),
122 Svc::ResultInvalidCurrentMemory); 122 Svc::ResultInvalidCurrentMemory);
123 123
124 if (user_value != value) { 124 if (user_value != value) {
@@ -181,9 +181,9 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
181 s32 user_value{}; 181 s32 user_value{};
182 bool succeeded{}; 182 bool succeeded{};
183 if (value != new_value) { 183 if (value != new_value) {
184 succeeded = UpdateIfEqual(system, std::addressof(user_value), addr, value, new_value); 184 succeeded = UpdateIfEqual(system, &user_value, addr, value, new_value);
185 } else { 185 } else {
186 succeeded = ReadFromUser(system, std::addressof(user_value), addr); 186 succeeded = ReadFromUser(system, &user_value, addr);
187 } 187 }
188 188
189 R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory); 189 R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory);
@@ -228,9 +228,9 @@ ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement
228 s32 user_value{}; 228 s32 user_value{};
229 bool succeeded{}; 229 bool succeeded{};
230 if (decrement) { 230 if (decrement) {
231 succeeded = DecrementIfLessThan(system, std::addressof(user_value), addr, value); 231 succeeded = DecrementIfLessThan(system, &user_value, addr, value);
232 } else { 232 } else {
233 succeeded = ReadFromUser(system, std::addressof(user_value), addr); 233 succeeded = ReadFromUser(system, &user_value, addr);
234 } 234 }
235 235
236 if (!succeeded) { 236 if (!succeeded) {
@@ -251,7 +251,7 @@ ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement
251 } 251 }
252 252
253 // Set the arbiter. 253 // Set the arbiter.
254 cur_thread->SetAddressArbiter(std::addressof(thread_tree), addr); 254 cur_thread->SetAddressArbiter(&thread_tree, addr);
255 thread_tree.insert(*cur_thread); 255 thread_tree.insert(*cur_thread);
256 cur_thread->SetState(ThreadState::Waiting); 256 cur_thread->SetState(ThreadState::Waiting);
257 cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration); 257 cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration);
@@ -272,7 +272,7 @@ ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement
272 272
273 // Get the result. 273 // Get the result.
274 KSynchronizationObject* dummy{}; 274 KSynchronizationObject* dummy{};
275 return cur_thread->GetWaitResult(std::addressof(dummy)); 275 return cur_thread->GetWaitResult(&dummy);
276} 276}
277 277
278ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) { 278ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) {
@@ -293,7 +293,7 @@ ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) {
293 293
294 // Read the value from userspace. 294 // Read the value from userspace.
295 s32 user_value{}; 295 s32 user_value{};
296 if (!ReadFromUser(system, std::addressof(user_value), addr)) { 296 if (!ReadFromUser(system, &user_value, addr)) {
297 slp.CancelSleep(); 297 slp.CancelSleep();
298 return Svc::ResultInvalidCurrentMemory; 298 return Svc::ResultInvalidCurrentMemory;
299 } 299 }
@@ -311,7 +311,7 @@ ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) {
311 } 311 }
312 312
313 // Set the arbiter. 313 // Set the arbiter.
314 cur_thread->SetAddressArbiter(std::addressof(thread_tree), addr); 314 cur_thread->SetAddressArbiter(&thread_tree, addr);
315 thread_tree.insert(*cur_thread); 315 thread_tree.insert(*cur_thread);
316 cur_thread->SetState(ThreadState::Waiting); 316 cur_thread->SetState(ThreadState::Waiting);
317 cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration); 317 cur_thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Arbitration);
@@ -332,7 +332,7 @@ ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) {
332 332
333 // Get the result. 333 // Get the result.
334 KSynchronizationObject* dummy{}; 334 KSynchronizationObject* dummy{};
335 return cur_thread->GetWaitResult(std::addressof(dummy)); 335 return cur_thread->GetWaitResult(&dummy);
336} 336}
337 337
338} // namespace Kernel 338} // namespace Kernel