diff options
author | bunnei <bunneidev@gmail.com> | 2021-02-05 01:56:57 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-02-05 23:03:36 +0100 |
commit | ea4f62615e71cd2b680517b7609928ed0abf216d (patch) | |
tree | e324ee348627fccb5706ad11fcb316877f4aaa3f /src | |
parent | hle: kernel: KAddressArbiter: Remove noisy error log. (diff) | |
download | yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar.gz yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar.bz2 yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar.lz yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar.xz yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.tar.zst yuzu-ea4f62615e71cd2b680517b7609928ed0abf216d.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/common/common_funcs.h | 8 | ||||
-rw-r--r-- | src/core/hle/kernel/k_address_arbiter.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/kernel/k_readable_event.cpp | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index cd3207a03..71b64e32a 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -104,14 +104,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void); } \ } -/// Evaluates a boolean expression, and returns a result unless that expression is true. -#define R_UNLESS_NOLOG(expr, res) \ - { \ - if (!(expr)) { \ - return res; \ - } \ - } - #define R_SUCCEEDED(res) (res.IsSuccess()) /// Evaluates an expression that returns a result, and returns the result if it would fail. diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp index affc04852..f2f497dc4 100644 --- a/src/core/hle/kernel/k_address_arbiter.cpp +++ b/src/core/hle/kernel/k_address_arbiter.cpp @@ -120,7 +120,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32 s32 user_value{}; R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1), Svc::ResultInvalidCurrentMemory); - R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState); + + if (user_value != value) { + return Svc::ResultInvalidState; + } auto it = thread_tree.nfind_light({addr, -1}); while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && @@ -211,7 +214,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 } R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory); - R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState); + + if (user_value != value) { + return Svc::ResultInvalidState; + } while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && (it->GetAddressArbiterKey() == addr)) { diff --git a/src/core/hle/kernel/k_readable_event.cpp b/src/core/hle/kernel/k_readable_event.cpp index cd15aa529..d8a42dbaf 100644 --- a/src/core/hle/kernel/k_readable_event.cpp +++ b/src/core/hle/kernel/k_readable_event.cpp @@ -46,7 +46,9 @@ ResultCode KReadableEvent::Clear() { ResultCode KReadableEvent::Reset() { KScopedSchedulerLock lk{kernel}; - R_UNLESS_NOLOG(is_signaled, Svc::ResultInvalidState); + if (!is_signaled) { + return Svc::ResultInvalidState; + } is_signaled = false; return RESULT_SUCCESS; |