fatal: Standardize result definitions

This commit is contained in:
Michael Scire 2019-03-28 15:37:50 -07:00
parent b940f61d42
commit 285feba42b
6 changed files with 6 additions and 14 deletions

View file

@ -38,7 +38,7 @@ Result FatalEventManager::GetEvent(Handle *out) {
/* Only allow GetEvent to succeed NumFatalEvents times. */ /* Only allow GetEvent to succeed NumFatalEvents times. */
if (this->events_gotten >= FatalEventManager::NumFatalEvents) { if (this->events_gotten >= FatalEventManager::NumFatalEvents) {
return FatalResult_TooManyEvents; return ResultFatalTooManyEvents;
} }
*out = this->events[this->events_gotten++].revent; *out = this->events[this->events_gotten++].revent;

View file

@ -97,10 +97,10 @@ static bool InRepairWithoutTimeReviserCartridge() {
void CheckRepairStatus() { void CheckRepairStatus() {
if (InRepairWithoutVolHeld()) { if (InRepairWithoutVolHeld()) {
ThrowFatalForSelf(FatalResult_InRepairWithoutVolHeld); ThrowFatalForSelf(ResultFatalInRepairWithoutVolHeld);
} }
if (InRepairWithoutTimeReviserCartridge()) { if (InRepairWithoutTimeReviserCartridge()) {
ThrowFatalForSelf(FatalResult_InRepairWithoutTimeReviserCartridge); ThrowFatalForSelf(ResultFatalInRepairWithoutTimeReviserCartridge);
} }
} }

View file

@ -186,7 +186,7 @@ Result ShowFatalTask::ShowFatal() {
/* Dequeue a buffer. */ /* Dequeue a buffer. */
u16 *tiled_buf = reinterpret_cast<u16 *>(framebufferBegin(&this->fb, NULL)); u16 *tiled_buf = reinterpret_cast<u16 *>(framebufferBegin(&this->fb, NULL));
if (tiled_buf == nullptr) { if (tiled_buf == nullptr) {
return FatalResult_NullGfxBuffer; return ResultFatalNullGraphicsBuffer;
} }
/* Let the font manager know about our framebuffer. */ /* Let the font manager know about our framebuffer. */

View file

@ -26,7 +26,7 @@ static bool g_thrown = false;
static Result SetThrown() { static Result SetThrown() {
/* This should be fine, since fatal only has a single IPC thread. */ /* This should be fine, since fatal only has a single IPC thread. */
if (g_thrown) { if (g_thrown) {
return FatalResult_AlreadyThrown; return ResultFatalAlreadyThrown;
} }
g_thrown = true; g_thrown = true;

View file

@ -18,14 +18,6 @@
#include <switch.h> #include <switch.h>
#include <stratosphere.hpp> #include <stratosphere.hpp>
enum FatalResult : Result {
FatalResult_NullGfxBuffer = 0x4A3,
FatalResult_AlreadyThrown = 0x6A3,
FatalResult_TooManyEvents = 0x8A3,
FatalResult_InRepairWithoutVolHeld = 0xAA3,
FatalResult_InRepairWithoutTimeReviserCartridge = 0xCA3,
};
static constexpr size_t NumAarch64Gprs = 32; static constexpr size_t NumAarch64Gprs = 32;
static constexpr size_t NumAarch32Gprs = 16; static constexpr size_t NumAarch32Gprs = 16;

@ -1 +1 @@
Subproject commit aab4aedb34e5029101ee15c238ead6167aaa4afa Subproject commit d448c03c5d65a413b68e504d93929ef161858dcb