From 7a6a4ab48370b94cfb8a6430f6b18db7cafe1481 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 16 Oct 2021 14:11:28 +0200 Subject: [PATCH] Improve return, fix warnings --- source/GMPartitionsDumperState.cpp | 5 ++--- source/WUDDumperState.cpp | 9 ++------- source/WUDDumperState.h | 1 - 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/source/GMPartitionsDumperState.cpp b/source/GMPartitionsDumperState.cpp index 6162651..4316057 100644 --- a/source/GMPartitionsDumperState.cpp +++ b/source/GMPartitionsDumperState.cpp @@ -392,11 +392,10 @@ void GMPartitionsDumperState::setError(GMPartitionsDumperState::eErrorState err) } std::string GMPartitionsDumperState::getPathForDevice(eDumpTarget target) const { - if(target == TARGET_SD){ - return "fs:/vol/external01/"; - } else if (target == TARGET_NTFS){ + if (target == TARGET_NTFS){ return "ntfs0:/"; } + return "fs:/vol/external01/"; } std::string GMPartitionsDumperState::ErrorMessage() const { diff --git a/source/WUDDumperState.cpp b/source/WUDDumperState.cpp index 789b95b..2edb2aa 100644 --- a/source/WUDDumperState.cpp +++ b/source/WUDDumperState.cpp @@ -39,9 +39,6 @@ WUDDumperState::~WUDDumperState() { } ApplicationState::eSubState WUDDumperState::update(Input *input) { - if (this->state == STATE_RETURN) { - return ApplicationState::SUBSTATE_RETURN; - } if (this->state == STATE_ERROR) { if (entrySelected(input)) { return ApplicationState::SUBSTATE_RETURN; @@ -79,7 +76,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) { } } else if (this->state == STATE_PLEASE_INSERT_DISC) { if (entrySelected(input)) { - this->state = STATE_RETURN; + return SUBSTATE_RETURN; } } else if (this->state == STATE_READ_DISC_INFO) { if (IOSUHAX_FSA_RawRead(gFSAfd, this->sectorBuf, READ_SECTOR_SIZE, 1, 0, this->oddFd) >= 0) { @@ -218,7 +215,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) { } else if (this->state == STATE_DUMP_DISC_DONE) { WiiUScreen::drawLinef("Dumping done! Press A to continue"); if (entrySelected(input)) { - this->state = STATE_RETURN; + return SUBSTATE_RETURN; } return ApplicationState::SUBSTATE_RUNNING; @@ -284,8 +281,6 @@ void WUDDumperState::render() { } } else if (this->state == STATE_DUMP_DISC_DONE) { WiiUScreen::drawLinef("Dumping done! Press A to continue"); - } else if (this->state == STATE_RETURN) { - WiiUScreen::drawLinef("Returning"); } ApplicationState::printFooter(); diff --git a/source/WUDDumperState.h b/source/WUDDumperState.h index 124a631..3d1346d 100644 --- a/source/WUDDumperState.h +++ b/source/WUDDumperState.h @@ -40,7 +40,6 @@ public: enum eDumpState { STATE_ERROR, - STATE_RETURN, STATE_OPEN_ODD1, STATE_PLEASE_INSERT_DISC, STATE_READ_DISC_INFO,