diff options
| author | 2022-09-05 17:29:14 -0700 | |
|---|---|---|
| committer | 2022-10-18 19:13:34 -0700 | |
| commit | cb073f95dc6ef07934a47137b121a1328667df6b (patch) | |
| tree | e0a788db124137d2c84f3be55921a447d2e9c0ef | |
| parent | core: hle: kernel: svc_common: Add WaitInfinite & cleanup. (diff) | |
| download | yuzu-cb073f95dc6ef07934a47137b121a1328667df6b.tar.gz yuzu-cb073f95dc6ef07934a47137b121a1328667df6b.tar.xz yuzu-cb073f95dc6ef07934a47137b121a1328667df6b.zip | |
core: hle: result: Add GetInnerValue and Includes methods.
| -rw-r--r-- | src/core/hle/result.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index d67e68bae..d714dea38 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -135,6 +135,14 @@ union Result { | |||
| 135 | [[nodiscard]] constexpr bool IsFailure() const { | 135 | [[nodiscard]] constexpr bool IsFailure() const { |
| 136 | return !IsSuccess(); | 136 | return !IsSuccess(); |
| 137 | } | 137 | } |
| 138 | |||
| 139 | [[nodiscard]] constexpr u32 GetInnerValue() const { | ||
| 140 | return static_cast<u32>(module.Value()) | (description << module.bits); | ||
| 141 | } | ||
| 142 | |||
| 143 | [[nodiscard]] constexpr bool Includes(Result result) const { | ||
| 144 | return GetInnerValue() == result.GetInnerValue(); | ||
| 145 | } | ||
| 138 | }; | 146 | }; |
| 139 | static_assert(std::is_trivial_v<Result>); | 147 | static_assert(std::is_trivial_v<Result>); |
| 140 | 148 | ||