summaryrefslogtreecommitdiffstats
path: root/src/core/hle/result.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-08-15 08:14:11 +0200
committerGitHub <noreply@github.com>2020-08-15 08:14:11 +0200
commit2b601e86360ea47df5b3cb1a280177f428763837 (patch)
tree650bd7ad43701989bb87f06dc00e5c62fb50e0c3 /src/core/hle/result.h
parentMerge pull request #4527 from lioncash/pessimizing2 (diff)
parentcore: Resolve several -Wextra-semi warnings (diff)
downloadyuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar.gz
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar.bz2
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar.lz
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar.xz
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.tar.zst
yuzu-2b601e86360ea47df5b3cb1a280177f428763837.zip
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r--src/core/hle/result.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 450f61fea..b6bdbd988 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -342,8 +342,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
*/
#define CASCADE_RESULT(target, source) \
auto CONCAT2(check_result_L, __LINE__) = source; \
- if (CONCAT2(check_result_L, __LINE__).Failed()) \
+ if (CONCAT2(check_result_L, __LINE__).Failed()) { \
return CONCAT2(check_result_L, __LINE__).Code(); \
+ } \
target = std::move(*CONCAT2(check_result_L, __LINE__))
/**
@@ -351,6 +352,9 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
* non-success, or discarded otherwise.
*/
#define CASCADE_CODE(source) \
- auto CONCAT2(check_result_L, __LINE__) = source; \
- if (CONCAT2(check_result_L, __LINE__).IsError()) \
- return CONCAT2(check_result_L, __LINE__);
+ do { \
+ auto CONCAT2(check_result_L, __LINE__) = source; \
+ if (CONCAT2(check_result_L, __LINE__).IsError()) { \
+ return CONCAT2(check_result_L, __LINE__); \
+ } \
+ } while (false)