summaryrefslogtreecommitdiffstats
path: root/src/core/hle/result.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-10-19 22:27:43 +0200
committerGitHub <noreply@github.com>2022-10-19 22:27:43 +0200
commit560bca57a203c45acb1c589699b472223e8b68fd (patch)
tree98ef4a0d62a368614075463d13c4220b11af9760 /src/core/hle/result.h
parentMerge pull request #9084 from vonchenplus/dma_copy (diff)
parentcore: hle: kernel: Migrate ProcessState to enum class. (diff)
downloadyuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar.gz
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar.bz2
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar.lz
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar.xz
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.tar.zst
yuzu-560bca57a203c45acb1c589699b472223e8b68fd.zip
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r--src/core/hle/result.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index d67e68bae..ef4b2d417 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<u32>(module.Value()) | (description << module.bits);
+ }
+
+ [[nodiscard]] constexpr bool Includes(Result result) const {
+ return GetInnerValue() == result.GetInnerValue();
+ }
};
static_assert(std::is_trivial_v<Result>);
@@ -462,9 +470,6 @@ constexpr inline Result __TmpCurrentResultReference = ResultSuccess;
#define R_UNLESS(expr, res) \
{ \
if (!(expr)) { \
- if (res.IsError()) { \
- LOG_ERROR(Kernel, "Failed with result: {}", res.raw); \
- } \
R_THROW(res); \
} \
}