fix more review comments

This commit is contained in:
B3n30 2020-03-15 19:00:26 +01:00
parent 2465fd423a
commit 1d92343344
3 changed files with 8 additions and 5 deletions

View file

@ -51,7 +51,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
} }
bool executable = false; bool executable = false;
auto res = loader->IsExecutable(executable); const auto res = loader->IsExecutable(executable);
if (!executable && res != Loader::ResultStatus::ErrorEncrypted) { if (!executable && res != Loader::ResultStatus::ErrorEncrypted) {
return true; return true;
} }

View file

@ -134,8 +134,9 @@ Loader::ResultStatus NCCHContainer::OpenFile(const std::string& filepath, u32 nc
} }
Loader::ResultStatus NCCHContainer::LoadHeader() { Loader::ResultStatus NCCHContainer::LoadHeader() {
if (has_header) if (has_header) {
return Loader::ResultStatus::Success; return Loader::ResultStatus::Success;
}
if (!file.IsOpen()) { if (!file.IsOpen()) {
return Loader::ResultStatus::Error; return Loader::ResultStatus::Error;
} }
@ -143,8 +144,9 @@ Loader::ResultStatus NCCHContainer::LoadHeader() {
// Reset read pointer in case this file has been read before. // Reset read pointer in case this file has been read before.
file.Seek(ncch_offset, SEEK_SET); 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; return Loader::ResultStatus::Error;
}
// Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)... // 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) { 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... // 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; return Loader::ResultStatus::ErrorInvalidFormat;
}
has_header = true; has_header = true;
return Loader::ResultStatus::Success; return Loader::ResultStatus::Success;

View file

@ -396,7 +396,7 @@ InstallStatus InstallCIA(const std::string& path,
} }
bool executable = false; bool executable = false;
auto res = loader->IsExecutable(executable); const auto res = loader->IsExecutable(executable);
if (res == Loader::ResultStatus::ErrorEncrypted) { if (res == Loader::ResultStatus::ErrorEncrypted) {
return false; return false;
} }