diff --git a/sphaira/CMakeLists.txt b/sphaira/CMakeLists.txt index 3f815ca..b2ba642 100644 --- a/sphaira/CMakeLists.txt +++ b/sphaira/CMakeLists.txt @@ -81,12 +81,54 @@ target_compile_definitions(sphaira PRIVATE -DAPP_VERSION_HASH="${sphaira_VERSION_HASH}" ) +target_compile_options(sphaira PRIVATE + -Wall + -Wextra + + # unsure if it's a good idea to enable these by default as + # it may cause breakage upon compiler updates. + # -Werror + # -Wfatal-errors + + # disabled as nx uses s64 for size and offset, however stl uses size_t instead, thus + # there being a lot of warnings. + -Wno-sign-compare + # disabled as many overriden methods don't use the params. + -Wno-unused-parameter + # pedantic warning, missing fields are set to 0. + -Wno-missing-field-initializers + # disabled as it warns for strcat 2 paths together, but it will never + # overflow due to fs enforcing a max path len anyway. + -Wno-format-truncation + + # the below are taken from my gba emulator, they've served me well ;) + -Wformat-overflow=2 + -Wundef + -Wmissing-include-dirs + -fstrict-aliasing + -Wstrict-overflow=2 + -Walloca + -Wduplicated-cond + -Wwrite-strings + -Wdate-time + -Wlogical-op + -Wpacked + -Wcast-qual + -Wcast-align + -Wimplicit-fallthrough=5 + -Wsuggest-final-types + -Wuninitialized + -fimplicit-constexpr + -Wmissing-requires +) + include(FetchContent) set(FETCHCONTENT_QUIET FALSE) FetchContent_Declare(ftpsrv GIT_REPOSITORY https://github.com/ITotalJustice/ftpsrv.git GIT_TAG 1.2.1 + SOURCE_SUBDIR NONE ) FetchContent_Declare(libhaze @@ -101,7 +143,7 @@ FetchContent_Declare(libpulsar FetchContent_Declare(nanovg GIT_REPOSITORY https://github.com/ITotalJustice/nanovg-deko3d.git - GIT_TAG 1902b38 + GIT_TAG 845c9fc ) FetchContent_Declare(stb @@ -136,8 +178,6 @@ set(NANOVG_NO_GIF ON) set(NANOVG_NO_HDR ON) set(NANOVG_NO_PIC ON) set(NANOVG_NO_PNM ON) -set(NANOVG_STBI_STATIC OFF) -set(NANOVG_STBTT_STATIC ON) set(YYJSON_DISABLE_READER OFF) set(YYJSON_DISABLE_WRITER OFF) @@ -148,7 +188,7 @@ set(YYJSON_DISABLE_UTF8_VALIDATION ON) set(YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS OFF) FetchContent_MakeAvailable( - # ftpsrv + ftpsrv libhaze libpulsar nanovg @@ -157,11 +197,6 @@ FetchContent_MakeAvailable( yyjson ) -FetchContent_GetProperties(ftpsrv) -if (NOT ftpsrv_POPULATED) - FetchContent_Populate(ftpsrv) -endif() - set(FTPSRV_LIB_BUILD TRUE) set(FTPSRV_LIB_SOCK_UNISTD TRUE) set(FTPSRV_LIB_VFS_CUSTOM ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs_nx.h) @@ -178,6 +213,7 @@ set(FTPSRV_LIB_CUSTOM_DEFINES USE_VFS_SAVE=$ USE_VFS_STORAGE=$ USE_VFS_GC=$ + USE_VFS_USBHSFS=$ VFS_NX_BUFFER_IO=$ ) diff --git a/sphaira/include/app.hpp b/sphaira/include/app.hpp index 12c0924..8a9ce3e 100644 --- a/sphaira/include/app.hpp +++ b/sphaira/include/app.hpp @@ -166,7 +166,6 @@ public: // todo: move this into it's own menu option::OptionLong m_text_scroll_speed{"accessibility", "text_scroll_speed", 1}; // normal - PLSR_BFSAR m_qlaunch_bfsar{}; PLSR_PlayerSoundId m_sound_ids[SoundEffect_MAX]{}; private: // from nanovg decko3d example by adubbz diff --git a/sphaira/include/ui/error_box.hpp b/sphaira/include/ui/error_box.hpp index a2327e5..213bbdc 100644 --- a/sphaira/include/ui/error_box.hpp +++ b/sphaira/include/ui/error_box.hpp @@ -13,10 +13,10 @@ public: auto Draw(NVGcontext* vg, Theme* theme) -> void override; private: - Result m_code; - std::string m_message; - std::string m_module_str; - std::string m_description_str; + Result m_code{}; + std::string m_message{}; + std::string m_module_str{}; + std::string m_description_str{}; }; } // namespace sphaira::ui diff --git a/sphaira/include/ui/list.hpp b/sphaira/include/ui/list.hpp index a30514d..7d5a97d 100644 --- a/sphaira/include/ui/list.hpp +++ b/sphaira/include/ui/list.hpp @@ -43,8 +43,8 @@ private: const s64 m_row; const s64 m_page; - Vec4 m_v; - Vec2 m_pad; + Vec4 m_v{}; + Vec2 m_pad{}; Vec4 m_scrollbar{}; diff --git a/sphaira/include/ui/menus/appstore.hpp b/sphaira/include/ui/menus/appstore.hpp index a5dcb6d..0ca4924 100644 --- a/sphaira/include/ui/menus/appstore.hpp +++ b/sphaira/include/ui/menus/appstore.hpp @@ -42,26 +42,26 @@ enum class EntryStatus { }; struct Entry { - std::string category; // todo: lable - std::string binary; // optional, only valid for .nro - std::string updated; // date of update - std::string name; - std::string license; // optional - std::string title; // same as name but with spaces - std::string url; // url of repo (optional?) - std::string description; - std::string author; - std::string changelog; // optional - u64 screens; // number of screenshots - u64 extracted; // extracted size in KiB - std::string version; - u64 filesize; // compressed size in KiB - std::string details; - u64 app_dls; - std::string md5; // md5 of the zip + std::string category{}; // todo: lable + std::string binary{}; // optional, only valid for .nro + std::string updated{}; // date of update + std::string name{}; + std::string license{}; // optional + std::string title{}; // same as name but with spaces + std::string url{}; // url of repo (optional?) + std::string description{}; + std::string author{}; + std::string changelog{}; // optional + u64 screens{}; // number of screenshots + u64 extracted{}; // extracted size in KiB + std::string version{}; + u64 filesize{}; // compressed size in KiB + std::string details{}; + u64 app_dls{}; + std::string md5{}; // md5 of the zip - LazyImage image; - u32 updated_num; + LazyImage image{}; + u32 updated_num{}; EntryStatus status{EntryStatus::Get}; }; @@ -99,13 +99,13 @@ private: Menu& m_menu; s64 m_index{}; // where i am in the array - std::vector