diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-03 00:29:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 00:29:09 +0200 |
commit | 4ea171fa5e50723d50b57b26aaaca2fac30eea57 (patch) | |
tree | ef2f0869252f59b0b8aeb62a48e2a233c0f94664 /src/core/hle/result.h | |
parent | Merge pull request #6403 from Kewlan/game-list-for-loop-optimization (diff) | |
parent | general: Replace RESULT_UNKNOWN with ResultUnknown (diff) | |
download | yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.gz yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.bz2 yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.lz yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.xz yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.zst yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.zip |
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r-- | src/core/hle/result.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index df3283fe3..605236552 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -144,7 +144,7 @@ constexpr bool operator!=(const ResultCode& a, const ResultCode& b) { // Convenience functions for creating some common kinds of errors: /// The default success `ResultCode`. -constexpr ResultCode RESULT_SUCCESS(0); +constexpr ResultCode ResultSuccess(0); /** * Placeholder result code used for unknown error codes. @@ -152,7 +152,7 @@ constexpr ResultCode RESULT_SUCCESS(0); * @note This should only be used when a particular error code * is not known yet. */ -constexpr ResultCode RESULT_UNKNOWN(UINT32_MAX); +constexpr ResultCode ResultUnknown(UINT32_MAX); /** * This is an optional value type. It holds a `ResultCode` and, if that code is a success code, @@ -191,7 +191,7 @@ class ResultVal { public: /// Constructs an empty `ResultVal` with the given error code. The code must not be a success /// code. - ResultVal(ResultCode error_code = RESULT_UNKNOWN) : result_code(error_code) { + ResultVal(ResultCode error_code = ResultUnknown) : result_code(error_code) { ASSERT(error_code.IsError()); } @@ -321,7 +321,7 @@ private: */ template <typename T, typename... Args> ResultVal<T> MakeResult(Args&&... args) { - return ResultVal<T>::WithCode(RESULT_SUCCESS, std::forward<Args>(args)...); + return ResultVal<T>::WithCode(ResultSuccess, std::forward<Args>(args)...); } /** @@ -330,8 +330,7 @@ ResultVal<T> MakeResult(Args&&... args) { */ template <typename Arg> ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { - return ResultVal<std::remove_reference_t<Arg>>::WithCode(RESULT_SUCCESS, - std::forward<Arg>(arg)); + return ResultVal<std::remove_reference_t<Arg>>::WithCode(ResultSuccess, std::forward<Arg>(arg)); } /** @@ -362,7 +361,7 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { #define R_SUCCEEDED(res) (res.IsSuccess()) /// Evaluates a boolean expression, and succeeds if that expression is true. -#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), RESULT_SUCCESS) +#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess) /// Evaluates a boolean expression, and returns a result unless that expression is true. #define R_UNLESS(expr, res) \ |