From f14a53abd0ef1f3b4f16a3336a5f2a4ad1f81fc4 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 17:31:12 +0100 Subject: [PATCH 1/5] core: fix archive_extsavedata.cpp warning on OSX --- src/core/file_sys/archive_extsavedata.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 51ce78435..dd2fb167f 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -107,6 +107,8 @@ public: case PathParser::NotFound: LOG_ERROR(Service_FS, "%s not found", full_path.c_str()); return ERROR_FILE_NOT_FOUND; + case PathParser::FileFound: + break; // Expected 'success' case } FileUtil::IOFile file(full_path, "r+b"); From c4f9cd35597a612c392c4a4394e48c0030f7abf7 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 17:35:50 +0100 Subject: [PATCH 2/5] core: fix archive_sdmc.cpp warnings about unhandled enumeration value on OSX --- src/core/file_sys/archive_sdmc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 333dfb92e..72ff05c65 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -72,6 +72,8 @@ ResultVal> SDMCArchive::OpenFileBase(const Path& pa FileUtil::CreateEmptyFile(full_path); } break; + case PathParser::FileFound: + break; // Expected 'success' case } FileUtil::IOFile file(full_path, mode.write_flag ? "r+b" : "rb"); @@ -106,6 +108,8 @@ ResultCode SDMCArchive::DeleteFile(const Path& path) const { case PathParser::DirectoryFound: LOG_ERROR(Service_FS, "%s is not a file", full_path.c_str()); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; + case PathParser::FileFound: + break; // Expected 'success' case } if (FileUtil::Delete(full_path)) { @@ -154,6 +158,8 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou case PathParser::FileFound: LOG_ERROR(Service_FS, "Unexpected file in path %s", full_path.c_str()); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; + case PathParser::DirectoryFound: + break; // Expected 'success' case } if (deleter(full_path)) { @@ -197,6 +203,8 @@ ResultCode SDMCArchive::CreateFile(const FileSys::Path& path, u64 size) const { case PathParser::FileFound: LOG_ERROR(Service_FS, "%s already exists", full_path.c_str()); return ERROR_ALREADY_EXISTS; + case PathParser::NotFound: + break; // Expected 'success' case } if (size == 0) { @@ -238,6 +246,8 @@ ResultCode SDMCArchive::CreateDirectory(const Path& path) const { case PathParser::FileFound: LOG_ERROR(Service_FS, "%s already exists", full_path.c_str()); return ERROR_ALREADY_EXISTS; + case PathParser::NotFound: + break; // Expected 'success' case } if (FileUtil::CreateDir(mount_point + path.AsString())) { @@ -281,6 +291,8 @@ ResultVal> SDMCArchive::OpenDirectory(const Pa case PathParser::FileInPath: LOG_ERROR(Service_FS, "Unexpected file in path %s", full_path.c_str()); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; + case PathParser::DirectoryFound: + break; // Expected 'success' case } auto directory = std::make_unique(full_path); From f352a741d3b404f244d878f38d1f1d43250447d3 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 17:41:19 +0100 Subject: [PATCH 3/5] core: fix savedata_archive.cpp warnings about unhandled enumeration values on OSX --- src/core/file_sys/savedata_archive.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/file_sys/savedata_archive.cpp b/src/core/file_sys/savedata_archive.cpp index f2e6a06bc..f540c4a93 100644 --- a/src/core/file_sys/savedata_archive.cpp +++ b/src/core/file_sys/savedata_archive.cpp @@ -57,6 +57,8 @@ ResultVal> SaveDataArchive::OpenFile(const Path& pa FileUtil::CreateEmptyFile(full_path); } break; + case PathParser::FileFound: + break; // Expected 'success' case } FileUtil::IOFile file(full_path, mode.write_flag ? "r+b" : "rb"); @@ -91,6 +93,8 @@ ResultCode SaveDataArchive::DeleteFile(const Path& path) const { case PathParser::NotFound: LOG_ERROR(Service_FS, "File not found %s", full_path.c_str()); return ERROR_FILE_NOT_FOUND; + case PathParser::FileFound: + break; // Expected 'success' case } if (FileUtil::Delete(full_path)) { @@ -139,6 +143,8 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou case PathParser::FileFound: LOG_ERROR(Service_FS, "Unexpected file or directory %s", full_path.c_str()); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; + case PathParser::DirectoryFound: + break; // Expected 'success' case } if (deleter(full_path)) { @@ -182,6 +188,8 @@ ResultCode SaveDataArchive::CreateFile(const FileSys::Path& path, u64 size) cons case PathParser::FileFound: LOG_ERROR(Service_FS, "%s already exists", full_path.c_str()); return ERROR_FILE_ALREADY_EXISTS; + case PathParser::NotFound: + break; // Expected 'success' case } if (size == 0) { @@ -225,6 +233,8 @@ ResultCode SaveDataArchive::CreateDirectory(const Path& path) const { case PathParser::FileFound: LOG_ERROR(Service_FS, "%s already exists", full_path.c_str()); return ERROR_DIRECTORY_ALREADY_EXISTS; + case PathParser::NotFound: + break; // Expected 'success' case } if (FileUtil::CreateDir(mount_point + path.AsString())) { @@ -269,6 +279,8 @@ ResultVal> SaveDataArchive::OpenDirectory( case PathParser::FileFound: LOG_ERROR(Service_FS, "Unexpected file in path %s", full_path.c_str()); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; + case PathParser::DirectoryFound: + break; // Expected 'success' case } auto directory = std::make_unique(full_path); From 2ca3beb9d3ebd3237c996e1f15b7726b3231a0d4 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 17:46:23 +0100 Subject: [PATCH 4/5] core: fix err_f.cpp warning about unhandled enumeration value on OSX --- src/core/hle/service/err_f.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index cd0a1a598..9da55f328 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -227,6 +227,8 @@ static void ThrowFatalError(Interface* self) { LOG_CRITICAL(Service_ERR, "FINST2: 0x%08X", errtype.exception_data.exception_info.fpinst2); break; + case ExceptionType::Undefined: + break; // Not logging exception_info for this case } LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str()); break; From 28da285031e0c86b2d2cd44971664ab6691767a0 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 18:09:33 +0100 Subject: [PATCH 5/5] citra: add missing control paths for ResultStatus on rom load. Fix warning about unhandled enumeration values on OSX --- src/citra/citra.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 99c096ac7..76f5caeb1 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -141,6 +141,26 @@ int main(int argc, char** argv) { case Core::System::ResultStatus::ErrorLoader: LOG_CRITICAL(Frontend, "Failed to load ROM!"); return -1; + case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: + LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " + "being used with Citra. \n\n For more information on dumping and " + "decrypting games, please refer to: " + "https://citra-emu.org/wiki/Dumping-Game-Cartridges"); + return -1; + case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: + LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); + return -1; + case Core::System::ResultStatus::ErrorNotInitialized: + LOG_CRITICAL(Frontend, "CPUCore not initialized"); + return -1; + case Core::System::ResultStatus::ErrorSystemMode: + LOG_CRITICAL(Frontend, "Failed to determine system mode!"); + return -1; + case Core::System::ResultStatus::ErrorVideoCore: + LOG_CRITICAL(Frontend, "VideoCore not initialized"); + return -1; + case Core::System::ResultStatus::Success: + break; // Expected case } while (emu_window->IsOpen()) {