diff options
| author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-13 13:10:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-13 13:10:58 +0100 |
| commit | a44cb6430eac81e6e89283c50b57142ca7f05747 (patch) | |
| tree | f51678d129432b0a68d22de0178ccb8fd4f9a927 /launcher | |
| parent | 44153a28e369943ea16545146fec81f7a62e44dd (diff) | |
| parent | 35358f8180468af1572c35425b1f60c899d6b07d (diff) | |
| download | PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.gz PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.bz2 PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.zip | |
Merge pull request #1107 from Ryex/chore/add-compiler-warnings
Introduce more strict compiler warnings and fix them
Diffstat (limited to 'launcher')
113 files changed, 506 insertions, 483 deletions
diff --git a/launcher/BaseInstance.h b/launcher/BaseInstance.h index 83a8064f..f6b5a7a5 100644 --- a/launcher/BaseInstance.h +++ b/launcher/BaseInstance.h @@ -88,7 +88,7 @@ public: /* types */ public: /// virtual destructor to make sure the destruction is COMPLETE - virtual ~BaseInstance() {}; + virtual ~BaseInstance() {} virtual void saveNow() = 0; @@ -154,7 +154,7 @@ public: virtual MessageLevel::Enum guessLevel([[maybe_unused]] const QString &line, MessageLevel::Enum level) { return level; - }; + } virtual QStringList extraArguments(); @@ -291,7 +291,7 @@ public: protected: void changeStatus(Status newStatus); - SettingsObjectPtr globalSettings() const { return m_global_settings.lock(); }; + SettingsObjectPtr globalSettings() const { return m_global_settings.lock(); } bool isSpecificSettingsLoaded() const { return m_specific_settings_loaded; } void setSpecificSettingsLoaded(bool loaded) { m_specific_settings_loaded = loaded; } diff --git a/launcher/BaseVersion.h b/launcher/BaseVersion.h index c7cedbe1..2837ff3a 100644 --- a/launcher/BaseVersion.h +++ b/launcher/BaseVersion.h @@ -43,9 +43,8 @@ class BaseVersion { * the kind of version this is (Stable, Beta, Snapshot, whatever) */ virtual QString typeString() const = 0; - - virtual bool operator<(BaseVersion& a) { return name() < a.name(); }; - virtual bool operator>(BaseVersion& a) { return name() > a.name(); }; + virtual bool operator<(BaseVersion& a) { return name() < a.name(); } + virtual bool operator>(BaseVersion& a) { return name() > a.name(); } }; Q_DECLARE_METATYPE(BaseVersion::Ptr) diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 5255f9d3..84edab59 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1131,8 +1131,14 @@ if(WIN32) set(LAUNCHER_RCS ${CMAKE_CURRENT_BINARY_DIR}/../${Launcher_Branding_WindowsRC}) endif() +include(CompilerWarnings) + # Add executable add_library(Launcher_logic STATIC ${LOGIC_SOURCES} ${LAUNCHER_SOURCES} ${LAUNCHER_UI} ${LAUNCHER_RESOURCES}) +set_project_warnings(Launcher_logic + "${Launcher_MSVC_WARNINGS}" + "${Launcher_CLANG_WARNINGS}" + "${Launcher_GCC_WARNINGS}") target_compile_definitions(Launcher_logic PUBLIC LAUNCHER_APPLICATION) target_include_directories(Launcher_logic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(Launcher_logic @@ -1218,6 +1224,11 @@ install(TARGETS ${Launcher_Name} if(WIN32) add_library(filelink_logic STATIC ${LINKEXE_SOURCES}) + set_project_warnings(filelink_logic + "${Launcher_MSVC_WARNINGS}" + "${Launcher_CLANG_WARNINGS}" + "${Launcher_GCC_WARNINGS}") + target_include_directories(filelink_logic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(filelink_logic systeminfo diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp index 81362f09..0a0934fb 100644 --- a/launcher/DesktopServices.cpp +++ b/launcher/DesktopServices.cpp @@ -104,7 +104,7 @@ bool IndirectOpen(T callable, qint64 *pid_forked = nullptr) #endif namespace DesktopServices { -bool openDirectory(const QString &path, bool ensureExists) +bool openDirectory(const QString &path, [[maybe_unused]] bool ensureExists) { qDebug() << "Opening directory" << path; QDir parentPath; diff --git a/launcher/FileSystem.h b/launcher/FileSystem.h index f8a82bae..2a4b2620 100644 --- a/launcher/FileSystem.h +++ b/launcher/FileSystem.h @@ -112,8 +112,8 @@ class copy : public QObject { bool operator()(bool dryRun = false) { return operator()(QString(), dryRun); } - int totalCopied() { return m_copied; } - int totalFailed() { return m_failedPaths.length(); } + qsizetype totalCopied() { return m_copied; } + qsizetype totalFailed() { return m_failedPaths.length(); } QStringList failed() { return m_failedPaths; } |
