From 300f8130a4abb4cfc94a9bc3b43ddd310dadbdcd Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 5 Dec 2020 20:53:20 +0100 Subject: [PATCH] Replace std::bind by lambda, init variables, minor tweaks and formatting. --- source/ApplicationState.cpp | 2 +- source/ApplicationState.h | 15 +++++++-------- source/WiiUScreen.cpp | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/ApplicationState.cpp b/source/ApplicationState.cpp index 7030cbf..997bd51 100644 --- a/source/ApplicationState.cpp +++ b/source/ApplicationState.cpp @@ -289,7 +289,7 @@ void ApplicationState::update(Input *input) { } ApplicationState::ApplicationState() { - menu.setOptionsCallback(std::bind(&ApplicationState::changeState, this, std::placeholders::_1)); + menu.setOptionsCallback([this](auto &&newState) { changeState(std::forward(newState)); }); menu.setHeader("Aroma Installer"); menu.setFooter("By Maschell"); diff --git a/source/ApplicationState.h b/source/ApplicationState.h index 989edbd..0176ecd 100644 --- a/source/ApplicationState.h +++ b/source/ApplicationState.h @@ -72,7 +72,6 @@ public: std::string ErrorDescription(); - bool installColdboot = false; InstallerService::eResults installerError = InstallerService::eResults::SUCCESS; private: @@ -91,13 +90,13 @@ private: bool systemXMLAlreadyPatched = false; bool systemXMLRestorePossible = false; - eGameState state; + eGameState state = STATE_WELCOME_SCREEN; eErrorState error = ERROR_NONE; - uint64_t coldbootTitleId; - _gList_t *coldbootTitle; + uint64_t coldbootTitleId = 0; + _gList_t *coldbootTitle = nullptr; std::optional systemMenuTitleId; - bool fstAlreadyPatched; - bool rpxAlreadyPatched; - bool cosAlreadyPatched; - bool tmdValid; + bool fstAlreadyPatched = false; + bool rpxAlreadyPatched = false; + bool cosAlreadyPatched = false; + bool tmdValid = false; }; diff --git a/source/WiiUScreen.cpp b/source/WiiUScreen.cpp index ead7b52..90d2c2c 100644 --- a/source/WiiUScreen.cpp +++ b/source/WiiUScreen.cpp @@ -12,7 +12,6 @@ bool WiiUScreen::sConsoleHasForeground = true; uint32_t WiiUScreen::consoleColor = 0x041F60FF; uint32_t WiiUScreen::consoleCursorY = 0; - uint32_t WiiUScreen::ProcCallbackAcquired(void *context) { MEMHeapHandle heap = MEMGetBaseHeapHandle(MEM_BASE_HEAP_MEM1); if (sBufferSizeTV) {