From 1d92343344d1e5696631863f26fd4c98c9a0c92f Mon Sep 17 00:00:00 2001 From: B3n30 Date: Sun, 15 Mar 2020 19:00:26 +0100 Subject: [PATCH] fix more review comments --- src/citra_qt/game_list_worker.cpp | 2 +- src/core/file_sys/ncch_container.cpp | 9 ++++++--- src/core/hle/service/am/am.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/citra_qt/game_list_worker.cpp b/src/citra_qt/game_list_worker.cpp index c00825b9e7..f032446376 100644 --- a/src/citra_qt/game_list_worker.cpp +++ b/src/citra_qt/game_list_worker.cpp @@ -51,7 +51,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign } bool executable = false; - auto res = loader->IsExecutable(executable); + const auto res = loader->IsExecutable(executable); if (!executable && res != Loader::ResultStatus::ErrorEncrypted) { return true; } diff --git a/src/core/file_sys/ncch_container.cpp b/src/core/file_sys/ncch_container.cpp index bb972c4318..cb8a2d5130 100644 --- a/src/core/file_sys/ncch_container.cpp +++ b/src/core/file_sys/ncch_container.cpp @@ -134,8 +134,9 @@ Loader::ResultStatus NCCHContainer::OpenFile(const std::string& filepath, u32 nc } Loader::ResultStatus NCCHContainer::LoadHeader() { - if (has_header) + if (has_header) { return Loader::ResultStatus::Success; + } if (!file.IsOpen()) { return Loader::ResultStatus::Error; } @@ -143,8 +144,9 @@ Loader::ResultStatus NCCHContainer::LoadHeader() { // Reset read pointer in case this file has been read before. file.Seek(ncch_offset, SEEK_SET); - if (file.ReadBytes(&ncch_header, sizeof(NCCH_Header)) != sizeof(NCCH_Header)) + if (file.ReadBytes(&ncch_header, sizeof(NCCH_Header)) != sizeof(NCCH_Header)) { return Loader::ResultStatus::Error; + } // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)... if (Loader::MakeMagic('N', 'C', 'S', 'D') == ncch_header.magic) { @@ -155,8 +157,9 @@ Loader::ResultStatus NCCHContainer::LoadHeader() { } // Verify we are loading the correct file type... - if (Loader::MakeMagic('N', 'C', 'C', 'H') != ncch_header.magic) + if (Loader::MakeMagic('N', 'C', 'C', 'H') != ncch_header.magic) { return Loader::ResultStatus::ErrorInvalidFormat; + } has_header = true; return Loader::ResultStatus::Success; diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index f3d7ea985a..44bdfc8a20 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -396,7 +396,7 @@ InstallStatus InstallCIA(const std::string& path, } bool executable = false; - auto res = loader->IsExecutable(executable); + const auto res = loader->IsExecutable(executable); if (res == Loader::ResultStatus::ErrorEncrypted) { return false; }