From efa01533b41ff70cd76837bb268df290236ac837 Mon Sep 17 00:00:00 2001 From: wiidev Date: Sun, 1 Jan 2023 17:00:23 +0000 Subject: [PATCH] Update for devkitPPC r41 --- .devcontainer/on-create.sh | 2 +- .github/workflows/main.yml | 8 ++++---- Dockerfile | 4 ++-- source/Channels/channels.cpp | 6 ++---- source/FileOperations/DirList.cpp | 2 +- source/GameCube/GCGames.cpp | 7 ++++--- source/ZipFile.cpp | 2 +- source/banner/OpeningBNR.cpp | 2 +- source/libs/libwbfs/rijndael.c | 5 +++++ source/prompts/TitleBrowser.cpp | 4 ++-- source/settings/menus/UninstallSM.cpp | 2 +- source/usbloader/AlternateDOLOffsets.h | 2 +- source/wad/nandtitle.cpp | 2 +- 13 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.devcontainer/on-create.sh b/.devcontainer/on-create.sh index d91b42be..68375186 100644 --- a/.devcontainer/on-create.sh +++ b/.devcontainer/on-create.sh @@ -5,7 +5,7 @@ apt-get update && apt-get install make xz-utils -y # Download and extract cd /opt -wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r39-2-linux_x86_64.pkg.tar.xz" +wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r41-2-linux_x86_64.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/devkitppc-rules-1.1.1-1-any.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-2.3.1-1-any.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/general-tools-1.2.0-2-linux_x86_64.pkg.tar.xz" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b044990..8ae7563f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,12 +36,12 @@ jobs: path: cache key: ${{ runner.os }}-cache-1 - - name: Download devkitPPC r39, libogc 2.3.1 and required tools + - name: Download devkitPPC r41, libogc 2.3.1 and required tools if: steps.cache-1.outputs.cache-hit != 'true' # general-tools is needed for bin2s and gamecube-tools is needed for elf2dol & gcdsptool run: | mkdir cache && cd cache - wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r39-2-linux_x86_64.pkg.tar.xz" + wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r41-2-linux_x86_64.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/devkitppc-rules-1.1.1-1-any.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-2.3.1-1-any.pkg.tar.xz" wget "https://wii.leseratte10.de/devkitPro/file.php/general-tools-1.2.0-2-linux_x86_64.pkg.tar.xz" @@ -51,7 +51,7 @@ jobs: - name: Verify checksums run: | sha256sum -c <d_name) + if (strlen(dirent->d_name) == 0) continue; // These can't be booted anyways - if (*dirent->d_name == '.' || strcmp(dirent->d_name, "48414141") == 0 || strcmp(dirent->d_name, "48414641") == 0) - { + if (dirent->d_name[0] == '.' || strcmp(dirent->d_name, "48414141") == 0 || strcmp(dirent->d_name, "48414641") == 0) continue; - } snprintf(pathEndPtr, 1024 - (pathEndPtr - path), "/%s/content/title.tmd", dirent->d_name); diff --git a/source/FileOperations/DirList.cpp b/source/FileOperations/DirList.cpp index 8e411b2b..1f811a82 100644 --- a/source/FileOperations/DirList.cpp +++ b/source/FileOperations/DirList.cpp @@ -88,7 +88,7 @@ bool DirList::LoadPath(std::string &folderpath, const char *filter, u32 flags, s while ((dirent = readdir(dir)) != 0) { - if(!dirent->d_name) + if(strlen(dirent->d_name) == 0) continue; snprintf(filename, MAXPATHLEN, "%s/%s", folderpath.c_str(), dirent->d_name); diff --git a/source/GameCube/GCGames.cpp b/source/GameCube/GCGames.cpp index a8e772b2..7b81beef 100644 --- a/source/GameCube/GCGames.cpp +++ b/source/GameCube/GCGames.cpp @@ -88,13 +88,14 @@ void GCGames::LoadGameList(const std::string &path, std::vector while ((dirent = readdir(dir_iter)) != 0) { - const char *dirname = dirent->d_name; - if (!dirname) + if (strlen(dirent->d_name) == 0) continue; - if (dirname[0] == '.') + if (dirent->d_name[0] == '.') continue; + const char *dirname = dirent->d_name; + // reset id and title memset(id, 0, sizeof(id)); *fname_title = 0; diff --git a/source/ZipFile.cpp b/source/ZipFile.cpp index 83fe4c86..fb95ac9b 100644 --- a/source/ZipFile.cpp +++ b/source/ZipFile.cpp @@ -97,7 +97,7 @@ bool ZipFile::FindFilePart(const char *partfilename, std::string &realname) if(strcasestr(filename, partfilename) != 0) { - realname = filename; + realname.assign(filename); return true; } } diff --git a/source/banner/OpeningBNR.cpp b/source/banner/OpeningBNR.cpp index d3dc2649..e069d241 100644 --- a/source/banner/OpeningBNR.cpp +++ b/source/banner/OpeningBNR.cpp @@ -329,7 +329,7 @@ u8 *OpeningBNR::LoadGCBNR(const discHdr *header, u32 *len) } else if (header->type == TYPE_GAME_GC_EXTRACTED) { - std::string gamePath = path; + std::string gamePath(path); gamePath += "root/"; //! open default file first file = fopen((gamePath + "opening.bnr").c_str(), "rb"); diff --git a/source/libs/libwbfs/rijndael.c b/source/libs/libwbfs/rijndael.c index 41f3bcc2..79031a98 100644 --- a/source/libs/libwbfs/rijndael.c +++ b/source/libs/libwbfs/rijndael.c @@ -12,6 +12,11 @@ #include #include +/* GCC 11 false positives */ +#if __GNUC__ > 11 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + #define u8 unsigned char /* 8 bits */ #define u32 unsigned long /* 32 bits */ #define u64 unsigned long long diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index 475fc2a9..94040dce 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -69,7 +69,7 @@ bool TitleSelector(char output[]) OptionList options4; //write the titles on the option browser - std::string Filepath = Settings.titlestxt_path; + std::string Filepath(Settings.titlestxt_path); Filepath += "wiitdb.xml"; GameTDB *XML_DB = new GameTDB(Filepath.c_str()); @@ -251,7 +251,7 @@ int TitleBrowser() OptionList options3; //write the titles on the option browser - std::string Filepath = Settings.titlestxt_path; + std::string Filepath(Settings.titlestxt_path); Filepath += "wiitdb.xml"; GameTDB *XML_DB = new GameTDB(Filepath.c_str()); diff --git a/source/settings/menus/UninstallSM.cpp b/source/settings/menus/UninstallSM.cpp index c9027106..4a732412 100644 --- a/source/settings/menus/UninstallSM.cpp +++ b/source/settings/menus/UninstallSM.cpp @@ -114,7 +114,7 @@ int UninstallSM::GetMenuInternal() char GameID[7]; snprintf(GameID, sizeof(GameID), "%s", (char *) DiscHeader->id); - std::string Title = GameTitles.GetTitle(DiscHeader); + std::string Title(GameTitles.GetTitle(DiscHeader)); GameSettings.Remove(DiscHeader->id); GameSettings.Save(); GameStatistics.Remove(DiscHeader->id); diff --git a/source/usbloader/AlternateDOLOffsets.h b/source/usbloader/AlternateDOLOffsets.h index a56f5140..b9f6ac6f 100644 --- a/source/usbloader/AlternateDOLOffsets.h +++ b/source/usbloader/AlternateDOLOffsets.h @@ -2,7 +2,7 @@ #define ALTERNATEDOLOFFSETS_H_ int defaultAltDol(const char *id); -int defaultDolPrompt(const char *id); +void defaultDolPrompt(const char *id); int autoSelectDolPrompt(const char *id); #endif diff --git a/source/wad/nandtitle.cpp b/source/wad/nandtitle.cpp index 1e2c1b4a..348e13da 100644 --- a/source/wad/nandtitle.cpp +++ b/source/wad/nandtitle.cpp @@ -686,7 +686,7 @@ int NandTitle::ExtractDir(const char *nandPath, const char *filepath) if(!filepath || !nandPath) return -1; - std::string internFilePath = filepath; + std::string internFilePath(filepath); char *internNandPath = (char *) memalign(32, ISFS_MAXPATH); if(!internNandPath) return -666;