From cb073f95dc6ef07934a47137b121a1328667df6b Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 5 Sep 2022 17:29:14 -0700 Subject: core: hle: result: Add GetInnerValue and Includes methods. --- src/core/hle/result.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core') 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 { [[nodiscard]] constexpr bool IsFailure() const { return !IsSuccess(); } + + [[nodiscard]] constexpr u32 GetInnerValue() const { + return static_cast(module.Value()) | (description << module.bits); + } + + [[nodiscard]] constexpr bool Includes(Result result) const { + return GetInnerValue() == result.GetInnerValue(); + } }; static_assert(std::is_trivial_v); -- cgit v1.2.3