diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-15 18:08:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15 18:08:50 +0100 |
commit | 3e0e4f146b3f2ad7f1935a61141c38cdce87e04f (patch) | |
tree | 75f29ce4bb9d84f9d9722b7aa86d71e805cac8cc /src/core/hle/result.h | |
parent | Merge pull request #3113 from lioncash/semi (diff) | |
parent | externals: Update httplib (diff) | |
download | yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar.gz yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar.bz2 yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar.lz yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar.xz yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.tar.zst yuzu-3e0e4f146b3f2ad7f1935a61141c38cdce87e04f.zip |
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r-- | src/core/hle/result.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 8a3701151..450f61fea 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -147,6 +147,14 @@ constexpr bool operator!=(const ResultCode& a, const ResultCode& b) { constexpr ResultCode RESULT_SUCCESS(0); /** + * Placeholder result code used for unknown error codes. + * + * @note This should only be used when a particular error code + * is not known yet. + */ +constexpr ResultCode RESULT_UNKNOWN(UINT32_MAX); + +/** * This is an optional value type. It holds a `ResultCode` and, if that code is a success code, * also holds a result of type `T`. If the code is an error code then trying to access the inner * value fails, thus ensuring that the ResultCode of functions is always checked properly before @@ -183,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 = ResultCode(-1)) : result_code(error_code) { + ResultVal(ResultCode error_code = RESULT_UNKNOWN) : result_code(error_code) { ASSERT(error_code.IsError()); } |