diff options
Diffstat (limited to '')
| -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); | |||
| 104 | } \ | 104 | } \ |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | /// Evaluates a boolean expression, and returns a result unless that expression is true. | ||
| 108 | #define R_UNLESS_NOLOG(expr, res) \ | ||
| 109 | { \ | ||
| 110 | if (!(expr)) { \ | ||
| 111 | return res; \ | ||
| 112 | } \ | ||
| 113 | } | ||
| 114 | |||
| 115 | #define R_SUCCEEDED(res) (res.IsSuccess()) | 107 | #define R_SUCCEEDED(res) (res.IsSuccess()) |
| 116 | 108 | ||
| 117 | /// Evaluates an expression that returns a result, and returns the result if it would fail. | 109 | /// 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 | |||
| 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, std::addressof(user_value), addr, value, value + 1), |
| 122 | Svc::ResultInvalidCurrentMemory); | 122 | Svc::ResultInvalidCurrentMemory); |
| 123 | R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState); | 123 | |
| 124 | if (user_value != value) { | ||
| 125 | return Svc::ResultInvalidState; | ||
| 126 | } | ||
| 124 | 127 | ||
| 125 | auto it = thread_tree.nfind_light({addr, -1}); | 128 | auto it = thread_tree.nfind_light({addr, -1}); |
| 126 | while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && | 129 | while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && |
| @@ -211,7 +214,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 | |||
| 211 | } | 214 | } |
| 212 | 215 | ||
| 213 | R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory); | 216 | R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory); |
| 214 | R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState); | 217 | |
| 218 | if (user_value != value) { | ||
| 219 | return Svc::ResultInvalidState; | ||
| 220 | } | ||
| 215 | 221 | ||
| 216 | while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && | 222 | while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && |
| 217 | (it->GetAddressArbiterKey() == addr)) { | 223 | (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() { | |||
| 46 | ResultCode KReadableEvent::Reset() { | 46 | ResultCode KReadableEvent::Reset() { |
| 47 | KScopedSchedulerLock lk{kernel}; | 47 | KScopedSchedulerLock lk{kernel}; |
| 48 | 48 | ||
| 49 | R_UNLESS_NOLOG(is_signaled, Svc::ResultInvalidState); | 49 | if (!is_signaled) { |
| 50 | return Svc::ResultInvalidState; | ||
| 51 | } | ||
| 50 | 52 | ||
| 51 | is_signaled = false; | 53 | is_signaled = false; |
| 52 | return RESULT_SUCCESS; | 54 | return RESULT_SUCCESS; |