diff --git a/src/FileInfos.h b/src/FileInfos.h index 54062e9..3612bf4 100644 --- a/src/FileInfos.h +++ b/src/FileInfos.h @@ -1,10 +1,10 @@ #pragma once #include "utils/logger.h" +#include "utils/utils.h" #include #include #include #include -#include "utils/utils.h" class FileInfos { public: diff --git a/src/fs/FileReader.h b/src/fs/FileReader.h index ace6a89..3107e46 100644 --- a/src/fs/FileReader.h +++ b/src/fs/FileReader.h @@ -19,7 +19,7 @@ public: virtual bool isReady(); - virtual uint32_t getHandle(){ + virtual uint32_t getHandle() { return reinterpret_cast(this); } diff --git a/src/fs/FileReaderWUHB.cpp b/src/fs/FileReaderWUHB.cpp index 07c4e71..4e135b6 100644 --- a/src/fs/FileReaderWUHB.cpp +++ b/src/fs/FileReaderWUHB.cpp @@ -4,7 +4,7 @@ #include #include -FileReaderWUHB::FileReaderWUHB(const std::shared_ptr& info, const std::string &relativeFilepath, bool autoUnmount) { +FileReaderWUHB::FileReaderWUHB(const std::shared_ptr &info, const std::string &relativeFilepath, bool autoUnmount) { if (!info) { DEBUG_FUNCTION_LINE_ERR("Info was NULL"); return; diff --git a/src/fs/FileReaderWUHB.h b/src/fs/FileReaderWUHB.h index 45fcf30..6ba2f67 100644 --- a/src/fs/FileReaderWUHB.h +++ b/src/fs/FileReaderWUHB.h @@ -11,7 +11,7 @@ class FileReaderWUHB : public FileReader { bool autoUnmount = false; public: - explicit FileReaderWUHB(const std::shared_ptr& info, const std::string &relativeFilepath, bool autoUnmount); + explicit FileReaderWUHB(const std::shared_ptr &info, const std::string &relativeFilepath, bool autoUnmount); ~FileReaderWUHB() override; int64_t read(uint8_t *buffer, uint32_t size) override; bool isReady() override; diff --git a/src/main.cpp b/src/main.cpp index 5168a71..e039d0c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,7 +47,6 @@ ACPMetaXml gLaunchXML __attribute__((section(".data"))); MCPTitleListType current_launched_title_info __attribute__((section(".data"))); BOOL gHomebrewLaunched __attribute__((section(".data"))); - std::mutex fileInfosMutex; std::forward_list> fileInfos; @@ -238,12 +237,9 @@ void readCustomTitlesFromSD() { } - - - auto repl = "fs:/vol/external01/"; auto input = dirList.GetFilepath(i); - const char * relativeFilepath; + const char *relativeFilepath; if (std::string_view(input).starts_with(repl)) { relativeFilepath = &input[strlen(repl)]; diff --git a/src/utils/logger.h b/src/utils/logger.h index 7e2f011..c617b5f 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -8,11 +8,11 @@ extern "C" { #endif -#define LOG_APP_TYPE "P" -#define LOG_APP_NAME "homebrew_on_menu" +#define LOG_APP_TYPE "P" +#define LOG_APP_NAME "homebrew_on_menu" -#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) -#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) +#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) #define LOG(LOG_FUNC, FMT, ARGS...) LOG_EX(LOG_FUNC, "", "", FMT, ##ARGS) diff --git a/src/utils/utils.h b/src/utils/utils.h index d45d939..8840ce7 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -3,6 +3,8 @@ #include #include #include +#include +#include uint32_t hash_string(const char *); @@ -29,4 +31,3 @@ bool remove_locked_first_if(std::mutex &mutex, std::forward_list & } return false; } -