mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-08 21:21:48 +00:00
Make Result produce the same code as Nintendo's
This commit is contained in:
parent
672204c993
commit
be17f1f494
1 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue