diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-10-19 22:27:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 22:27:43 +0200 |
commit | 560bca57a203c45acb1c589699b472223e8b68fd (patch) | |
tree | 98ef4a0d62a368614075463d13c4220b11af9760 /src/core/hle/result.h | |
parent | Merge pull request #9084 from vonchenplus/dma_copy (diff) | |
parent | core: hle: kernel: Migrate ProcessState to enum class. (diff) | |
download | yuzu-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.h | 11 |
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); \ } \ } |