summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-06-28 23:18:45 +0200
committerPetr Mrázek <peterix@gmail.com>2018-06-28 23:18:45 +0200
commit7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e (patch)
tree59d922b5c35a70542355ae26f6a2dc442afa5307 /api
parentb5f636b3d57a63f634c4efe5a4ccd9a91f53df04 (diff)
downloadMultiMC-7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e.tar
MultiMC-7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e.tar.gz
MultiMC-7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e.tar.lz
MultiMC-7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e.tar.xz
MultiMC-7fe94ca7b4aa191b1e79331b16724b7e9cc9f56e.zip
NOISSUE fix all sorts of warnings, enable `Werror` and `pedantic`
Diffstat (limited to 'api')
-rw-r--r--api/gui/DesktopServices.h2
-rw-r--r--api/logic/Version.h3
-rw-r--r--api/logic/meta/JsonFormat.h2
-rw-r--r--api/logic/minecraft/Component.cpp4
-rw-r--r--api/logic/minecraft/Library.cpp8
-rw-r--r--api/logic/minecraft/MinecraftInstance.h2
-rw-r--r--api/logic/minecraft/World.cpp4
-rw-r--r--api/logic/minecraft/launch/ModMinecraftJar.h4
-rw-r--r--api/logic/modplatform/ftb/FtbPackInstallTask.cpp2
-rw-r--r--api/logic/net/FileSink.cpp4
-rw-r--r--api/logic/net/MetaCacheSink.cpp4
-rw-r--r--api/logic/updater/GoUpdate.h2
12 files changed, 21 insertions, 20 deletions
diff --git a/api/gui/DesktopServices.h b/api/gui/DesktopServices.h
index 9daf192a..f64a62c5 100644
--- a/api/gui/DesktopServices.h
+++ b/api/gui/DesktopServices.h
@@ -34,4 +34,4 @@ namespace DesktopServices
* Open the URL, most likely in a browser. Maybe.
*/
MULTIMC_GUI_EXPORT bool openUrl(const QUrl &url);
-};
+}
diff --git a/api/logic/Version.h b/api/logic/Version.h
index 08dfb6e9..7aa2ebe8 100644
--- a/api/logic/Version.h
+++ b/api/logic/Version.h
@@ -7,8 +7,9 @@
class QUrl;
-struct MULTIMC_LOGIC_EXPORT Version
+class MULTIMC_LOGIC_EXPORT Version
{
+public:
Version(const QString &str);
Version() {}
diff --git a/api/logic/meta/JsonFormat.h b/api/logic/meta/JsonFormat.h
index 762a36f6..cc2c8f83 100644
--- a/api/logic/meta/JsonFormat.h
+++ b/api/logic/meta/JsonFormat.h
@@ -80,4 +80,4 @@ void serializeRequires(QJsonObject & objOut, RequireSet* ptr, const char * keyNa
MetadataVersion currentFormatVersion();
}
-Q_DECLARE_METATYPE(std::set<Meta::Require>); \ No newline at end of file
+Q_DECLARE_METATYPE(std::set<Meta::Require>)
diff --git a/api/logic/minecraft/Component.cpp b/api/logic/minecraft/Component.cpp
index c6e41e65..7c52271e 100644
--- a/api/logic/minecraft/Component.cpp
+++ b/api/logic/minecraft/Component.cpp
@@ -145,7 +145,7 @@ QDateTime Component::getReleaseDateTime()
bool Component::isEnabled()
{
return !canBeDisabled() || !m_disabled;
-};
+}
bool Component::canBeDisabled()
{
@@ -171,7 +171,7 @@ bool Component::setEnabled(bool state)
bool Component::isCustom()
{
return m_file != nullptr;
-};
+}
bool Component::isCustomizable()
{
diff --git a/api/logic/minecraft/Library.cpp b/api/logic/minecraft/Library.cpp
index cd1afde4..237edaf1 100644
--- a/api/logic/minecraft/Library.cpp
+++ b/api/logic/minecraft/Library.cpp
@@ -59,7 +59,7 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
bool local = isLocal();
bool isForge = (hint() == "forge-pack-xz");
- auto add_download = [&](QString storage, QString url, QString sha1 = QString())
+ auto add_download = [&](QString storage, QString url, QString sha1)
{
auto entry = cache->resolveEntry("libraries", storage);
if(isAlwaysStale)
@@ -208,14 +208,14 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
{
QString cooked_storage = raw_storage;
QString cooked_dl = raw_dl;
- add_download(cooked_storage.replace("${arch}", "32"), cooked_dl.replace("${arch}", "32"));
+ add_download(cooked_storage.replace("${arch}", "32"), cooked_dl.replace("${arch}", "32"), QString());
cooked_storage = raw_storage;
cooked_dl = raw_dl;
- add_download(cooked_storage.replace("${arch}", "64"), cooked_dl.replace("${arch}", "64"));
+ add_download(cooked_storage.replace("${arch}", "64"), cooked_dl.replace("${arch}", "64"), QString());
}
else
{
- add_download(raw_storage, raw_dl);
+ add_download(raw_storage, raw_dl, QString());
}
}
return out;
diff --git a/api/logic/minecraft/MinecraftInstance.h b/api/logic/minecraft/MinecraftInstance.h
index 446a39d5..3be15b1c 100644
--- a/api/logic/minecraft/MinecraftInstance.h
+++ b/api/logic/minecraft/MinecraftInstance.h
@@ -18,7 +18,7 @@ public:
MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
virtual ~MinecraftInstance() {};
virtual void init() override;
- virtual void saveNow();
+ virtual void saveNow() override;
// FIXME: remove
QString typeName() const override;
diff --git a/api/logic/minecraft/World.cpp b/api/logic/minecraft/World.cpp
index 227a9b75..d7bc4553 100644
--- a/api/logic/minecraft/World.cpp
+++ b/api/logic/minecraft/World.cpp
@@ -275,7 +275,7 @@ static QString read_string (nbt::value& parent, const char * name, const QString
qWarning() << "NBT tag" << name << "could not be converted to string. Defaulting to" << fallback;
return fallback;
}
-};
+}
static int64_t read_long (nbt::value& parent, const char * name, const int64_t & fallback = 0)
{
@@ -301,7 +301,7 @@ static int64_t read_long (nbt::value& parent, const char * name, const int64_t &
qWarning() << "NBT tag" << name << "could not be converted to long. Defaulting to" << fallback;
return fallback;
}
-};
+}
void World::loadFromLevelDat(QByteArray data)
{
diff --git a/api/logic/minecraft/launch/ModMinecraftJar.h b/api/logic/minecraft/launch/ModMinecraftJar.h
index b9a2d35b..dca484f8 100644
--- a/api/logic/minecraft/launch/ModMinecraftJar.h
+++ b/api/logic/minecraft/launch/ModMinecraftJar.h
@@ -25,8 +25,8 @@ public:
explicit ModMinecraftJar(LaunchTask *parent) : LaunchStep(parent) {};
virtual ~ModMinecraftJar(){};
- virtual void executeTask();
- virtual bool canAbort() const
+ virtual void executeTask() override;
+ virtual bool canAbort() const override
{
return false;
}
diff --git a/api/logic/modplatform/ftb/FtbPackInstallTask.cpp b/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
index b57c2092..7815ef46 100644
--- a/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
+++ b/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
@@ -57,7 +57,7 @@ void FtbPackInstallTask::onDownloadProgress(qint64 current, qint64 total)
{
abortable = true;
progress(current, total * 4);
- setStatus(tr("Downloading zip for %1 (%2\%)").arg(m_pack.name).arg(current / 10));
+ setStatus(tr("Downloading zip for %1 (%2%)").arg(m_pack.name).arg(current / 10));
}
void FtbPackInstallTask::unzip()
diff --git a/api/logic/net/FileSink.cpp b/api/logic/net/FileSink.cpp
index f52c5788..e3ff0498 100644
--- a/api/logic/net/FileSink.cpp
+++ b/api/logic/net/FileSink.cpp
@@ -10,12 +10,12 @@ FileSink::FileSink(QString filename)
:m_filename(filename)
{
// nil
-};
+}
FileSink::~FileSink()
{
// nil
-};
+}
JobStatus FileSink::init(QNetworkRequest& request)
{
diff --git a/api/logic/net/MetaCacheSink.cpp b/api/logic/net/MetaCacheSink.cpp
index c9d75310..b4b337d6 100644
--- a/api/logic/net/MetaCacheSink.cpp
+++ b/api/logic/net/MetaCacheSink.cpp
@@ -10,12 +10,12 @@ MetaCacheSink::MetaCacheSink(MetaEntryPtr entry, ChecksumValidator * md5sum)
:Net::FileSink(entry->getFullPath()), m_entry(entry), m_md5Node(md5sum)
{
addValidator(md5sum);
-};
+}
MetaCacheSink::~MetaCacheSink()
{
// nil
-};
+}
JobStatus MetaCacheSink::initCache(QNetworkRequest& request)
{
diff --git a/api/logic/updater/GoUpdate.h b/api/logic/updater/GoUpdate.h
index 95f26b8c..0e183b9f 100644
--- a/api/logic/updater/GoUpdate.h
+++ b/api/logic/updater/GoUpdate.h
@@ -133,4 +133,4 @@ bool MULTIMC_LOGIC_EXPORT processFileLists
bool MULTIMC_LOGIC_EXPORT fixPathForOSX(QString &path);
}
-Q_DECLARE_METATYPE(GoUpdate::Status); \ No newline at end of file
+Q_DECLARE_METATYPE(GoUpdate::Status)