summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-21 20:20:37 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-21 20:20:37 +0200
commit8bd8be95f027b22a09724a48a3d8d9f2481e7f95 (patch)
tree1b0af581d904e3fbaaf3cf9493f1f8b038e83cec /api/logic
parent572a6026b57804cd8e9c3a4ccf4dcb1d198b46c7 (diff)
downloadMultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.gz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.lz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.xz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.zip
NOISSUE fix a bunch of compiler warnings
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/Commandline.cpp6
-rw-r--r--api/logic/minecraft/ModList.cpp7
-rw-r--r--api/logic/minecraft/ParseUtils_test.cpp2
-rw-r--r--api/logic/minecraft/forge/ForgeXzDownload.cpp6
-rw-r--r--api/logic/minecraft/onesix/OneSixProfileStrategy.cpp2
-rw-r--r--api/logic/net/Download.cpp1
-rw-r--r--api/logic/net/PasteUpload.h2
7 files changed, 12 insertions, 14 deletions
diff --git a/api/logic/Commandline.cpp b/api/logic/Commandline.cpp
index 32a605d6..751182af 100644
--- a/api/logic/Commandline.cpp
+++ b/api/logic/Commandline.cpp
@@ -44,7 +44,7 @@ QStringList splitArgs(QString args)
}
else if (!inquotes.isNull())
{
- if (cchar == 0x5C)
+ if (cchar == '\\')
escape = true;
else if (cchar == inquotes)
inquotes = 0;
@@ -54,7 +54,7 @@ QStringList splitArgs(QString args)
}
else
{
- if (cchar == 0x20)
+ if (cchar == ' ')
{
if (!current.isEmpty())
{
@@ -62,7 +62,7 @@ QStringList splitArgs(QString args)
current.clear();
}
}
- else if (cchar == 0x22 || cchar == 0x27)
+ else if (cchar == '"' || cchar == '\'')
inquotes = cchar;
else
current += cchar;
diff --git a/api/logic/minecraft/ModList.cpp b/api/logic/minecraft/ModList.cpp
index 3f28f7d4..02b09eef 100644
--- a/api/logic/minecraft/ModList.cpp
+++ b/api/logic/minecraft/ModList.cpp
@@ -341,7 +341,6 @@ bool ModList::dropMimeData(const QMimeData* data, Qt::DropAction action, int, in
if (data->hasUrls())
{
bool was_watching = is_watching;
- bool added = false;
if (was_watching)
{
stopWatching();
@@ -355,10 +354,8 @@ bool ModList::dropMimeData(const QMimeData* data, Qt::DropAction action, int, in
continue;
}
// TODO: implement not only copy, but also move
- if (installMod(url.toLocalFile()))
- {
- added = true;
- }
+ // FIXME: handle errors here
+ installMod(url.toLocalFile());
}
if (was_watching)
{
diff --git a/api/logic/minecraft/ParseUtils_test.cpp b/api/logic/minecraft/ParseUtils_test.cpp
index 79bed1d4..1ce96248 100644
--- a/api/logic/minecraft/ParseUtils_test.cpp
+++ b/api/logic/minecraft/ParseUtils_test.cpp
@@ -22,7 +22,7 @@ slots:
"2016-02-10T15:06:41+00:00",
"2016-02-04T15:28:02-05:33"
};
- for(int i = 0; i < (sizeof(timestamps) / sizeof(const char *)); i++)
+ for(unsigned i = 0; i < (sizeof(timestamps) / sizeof(const char *)); i++)
{
QTest::newRow(timestamps[i]) << QString(timestamps[i]);
}
diff --git a/api/logic/minecraft/forge/ForgeXzDownload.cpp b/api/logic/minecraft/forge/ForgeXzDownload.cpp
index 4d94dd12..593aa24f 100644
--- a/api/logic/minecraft/forge/ForgeXzDownload.cpp
+++ b/api/logic/minecraft/forge/ForgeXzDownload.cpp
@@ -210,7 +210,8 @@ void ForgeXzDownload::decompressAndInstall()
if (b.out_pos == sizeof(out))
{
- if (pack200_file.write((char *)out, b.out_pos) != b.out_pos)
+ auto wresult = pack200_file.write((char *)out, b.out_pos);
+ if (wresult < 0 || size_t(wresult) != b.out_pos)
{
// msg = "Write error\n";
xz_dec_end(s);
@@ -230,7 +231,8 @@ void ForgeXzDownload::decompressAndInstall()
continue;
}
- if (pack200_file.write((char *)out, b.out_pos) != b.out_pos)
+ auto wresult = pack200_file.write((char *)out, b.out_pos);
+ if (wresult < 0 || size_t(wresult) != b.out_pos)
{
// write error
pack200_file.close();
diff --git a/api/logic/minecraft/onesix/OneSixProfileStrategy.cpp b/api/logic/minecraft/onesix/OneSixProfileStrategy.cpp
index 0b83c2e1..ef2a7294 100644
--- a/api/logic/minecraft/onesix/OneSixProfileStrategy.cpp
+++ b/api/logic/minecraft/onesix/OneSixProfileStrategy.cpp
@@ -158,7 +158,6 @@ void OneSixProfileStrategy::loadUserPatches()
// now add all the patches by user sort order
ProfileUtils::PatchOrder userOrder;
ProfileUtils::readOverrideOrders(FS::PathCombine(m_instance->instanceRoot(), "order.json"), userOrder);
- bool orderIsDirty = false;
for (auto uid : userOrder)
{
// ignore builtins
@@ -169,7 +168,6 @@ void OneSixProfileStrategy::loadUserPatches()
// ordering has a patch that is gone?
if(!loadedPatches.contains(uid))
{
- orderIsDirty = true;
continue;
}
profile->appendPatch(loadedPatches.take(uid));
diff --git a/api/logic/net/Download.cpp b/api/logic/net/Download.cpp
index ee872e33..12c1b201 100644
--- a/api/logic/net/Download.cpp
+++ b/api/logic/net/Download.cpp
@@ -85,6 +85,7 @@ void Download::start()
case Job_InProgress:
qDebug() << "Downloading " << m_url.toString();
break;
+ case Job_Failed_Proceed: // this is meaningless in this context. We do need a sink.
case Job_NotStarted:
case Job_Failed:
emit failed(m_index_within_job);
diff --git a/api/logic/net/PasteUpload.h b/api/logic/net/PasteUpload.h
index 06e3f955..78d1da8e 100644
--- a/api/logic/net/PasteUpload.h
+++ b/api/logic/net/PasteUpload.h
@@ -20,7 +20,7 @@ public:
{
return m_pasteID;
}
- uint32_t maxSize()
+ int maxSize()
{
// 2MB for paste.ee - public
if(m_key == "public")