From be17f1f4945750583e3a36670f766092b40300ec Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 3 Nov 2018 11:36:19 +0100 Subject: [PATCH] Make Result produce the same code as Nintendo's --- mesosphere/include/mesosphere/core/Result.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mesosphere/include/mesosphere/core/Result.hpp b/mesosphere/include/mesosphere/core/Result.hpp index 3dd7cf1f9..f28366bab 100644 --- a/mesosphere/include/mesosphere/core/Result.hpp +++ b/mesosphere/include/mesosphere/core/Result.hpp @@ -59,11 +59,18 @@ class Result final { NotDebugged = 520, }; - constexpr Result() : module{(uint)Module::None}, description{(uint)Description::None} {} - constexpr Result(Description description, Module module = Module::Kernel) : module{(uint)module}, description{(uint)description} {} + constexpr Result() : module{(uint)Module::None}, description{(uint)Description::None}, padding{0} {} + constexpr Result(Description description, Module module = Module::Kernel) : + module{(uint)module}, description{(uint)description}, padding{0} {} - constexpr bool IsSuccess() const { return module == (uint)Module::None && description == (uint)Description::None; } - constexpr bool operator==(const Result &other) const { return module == other.module && description == other.description; } + constexpr bool IsSuccess() const + { + return module == (uint)Module::None && description == (uint)Description::None && padding == 0; + } + constexpr bool operator==(const Result &other) const + { + return module == other.module && description == other.description && padding == other.padding; + } constexpr bool operator!=(const Result &other) const { return !(*this == other); } constexpr Module GetModule() const { return (Module)module; } @@ -74,6 +81,7 @@ class Result final { private: uint module : 9; uint description : 13; + uint padding : 10; }; }