From ea43d0f687391db08459ea43794ee97b93e654fa Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 10 Aug 2023 20:41:52 +0200 Subject: [PATCH] fix: fix more warnings Signed-off-by: Sefa Eyeoglu --- launcher/BaseVersion.h | 4 ++-- launcher/FileSystem.h | 12 ++++++------ launcher/Version.h | 2 +- launcher/minecraft/mod/ResourceFolderModel.h | 2 +- launcher/net/HeaderProxy.h | 4 ++-- launcher/net/NetRequest.h | 4 ++-- launcher/ui/themes/CatPack.h | 4 ++-- tests/Task_test.cpp | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/launcher/BaseVersion.h b/launcher/BaseVersion.h index c4c9a1c5b..2837ff3a9 100644 --- a/launcher/BaseVersion.h +++ b/launcher/BaseVersion.h @@ -43,8 +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/FileSystem.h b/launcher/FileSystem.h index f8a82baef..2a4b26209 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; } signals: @@ -130,7 +130,7 @@ class copy : public QObject { bool m_whitelist = false; QDir m_src; QDir m_dst; - int m_copied; + qsizetype m_copied; QStringList m_failedPaths; }; @@ -475,8 +475,8 @@ class clone : public QObject { bool operator()(bool dryRun = false) { return operator()(QString(), dryRun); } - int totalCloned() { return m_cloned; } - int totalFailed() { return m_failedClones.length(); } + qsizetype totalCloned() { return m_cloned; } + qsizetype totalFailed() { return m_failedClones.length(); } QList> failed() { return m_failedClones; } @@ -492,7 +492,7 @@ class clone : public QObject { bool m_whitelist = false; QDir m_src; QDir m_dst; - int m_cloned; + qsizetype m_cloned; QList> m_failedClones; }; diff --git a/launcher/Version.h b/launcher/Version.h index 659f8e54e..df379082c 100644 --- a/launcher/Version.h +++ b/launcher/Version.h @@ -63,7 +63,7 @@ class Version { struct Section { explicit Section(QString fullString) : m_fullString(std::move(fullString)) { - int cutoff = m_fullString.size(); + qsizetype cutoff = m_fullString.size(); for (int i = 0; i < m_fullString.size(); i++) { if (!m_fullString[i].isDigit()) { cutoff = i; diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h index 45a5cc3a3..e78848944 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.h +++ b/launcher/minecraft/mod/ResourceFolderModel.h @@ -78,7 +78,7 @@ class ResourceFolderModel : public QAbstractListModel { /** Creates a new parse task, if needed, for 'res' and start it.*/ virtual void resolveResource(Resource* res); - [[nodiscard]] int size() const { return m_resources.size(); } + [[nodiscard]] qsizetype size() const { return m_resources.size(); } [[nodiscard]] bool empty() const { return size() == 0; } [[nodiscard]] Resource& at(int index) { return *m_resources.at(index); } [[nodiscard]] Resource const& at(int index) const { return *m_resources.at(index); } diff --git a/launcher/net/HeaderProxy.h b/launcher/net/HeaderProxy.h index f41c5875a..213c04c58 100644 --- a/launcher/net/HeaderProxy.h +++ b/launcher/net/HeaderProxy.h @@ -31,8 +31,8 @@ struct HeaderPair { class HeaderProxy { public: - HeaderProxy(){}; - virtual ~HeaderProxy(){}; + HeaderProxy(){} + virtual ~HeaderProxy(){} public: virtual QList headers(const QNetworkRequest& request) const = 0; diff --git a/launcher/net/NetRequest.h b/launcher/net/NetRequest.h index 9a6021620..f91207ef3 100644 --- a/launcher/net/NetRequest.h +++ b/launcher/net/NetRequest.h @@ -52,7 +52,7 @@ namespace Net { class NetRequest : public NetAction { Q_OBJECT protected: - explicit NetRequest() : NetAction(){}; + explicit NetRequest() : NetAction(){} public: using Ptr = shared_qobject_ptr; @@ -62,7 +62,7 @@ class NetRequest : public NetAction { public: ~NetRequest() override = default; - void init() override{}; + void init() override{} public: void addValidator(Validator* v); diff --git a/launcher/ui/themes/CatPack.h b/launcher/ui/themes/CatPack.h index b03a19f03..fdd117a7f 100644 --- a/launcher/ui/themes/CatPack.h +++ b/launcher/ui/themes/CatPack.h @@ -52,8 +52,8 @@ class BasicCatPack : public CatPack { public: BasicCatPack(QString id, QString name) : m_id(id), m_name(name) {} BasicCatPack(QString id) : BasicCatPack(id, id) {} - virtual QString id() { return m_id; }; - virtual QString name() { return m_name; }; + virtual QString id() { return m_id; } + virtual QString name() { return m_name; } virtual QString path(); protected: diff --git a/tests/Task_test.cpp b/tests/Task_test.cpp index eae3527d8..5bc737655 100644 --- a/tests/Task_test.cpp +++ b/tests/Task_test.cpp @@ -19,7 +19,7 @@ class BasicTask : public Task { BasicTask(bool show_debug_log = true) : Task(nullptr, show_debug_log) {} private: - void executeTask() override { emitSucceeded(); }; + void executeTask() override { emitSucceeded(); } }; /* Does nothing. Only used for testing. */