From a464606507d0d85a1d9db3c974825f73a1e25140 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Mon, 3 Jun 2019 13:23:04 -0700 Subject: [PATCH] Fixed compiler warnings. --- common/lc_library.cpp | 8 ++++---- common/lc_library.h | 4 ++-- qt/lc_qpropertiesdialog.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 700dc983..08668dda 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -975,9 +975,9 @@ bool lcPiecesLibrary::WriteArchiveCacheFile(const QString& FileName, lcMemFile& CacheFile.Seek(0, SEEK_SET); - Stream.zalloc = (alloc_func)0; - Stream.zfree = (free_func)0; - Stream.opaque = (voidpf)0; + Stream.zalloc = nullptr; + Stream.zfree = nullptr; + Stream.opaque = nullptr; if (deflateInit2(&Stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) return false; @@ -1822,7 +1822,7 @@ void lcPiecesLibrary::UnloadUnusedParts() bool lcPiecesLibrary::LoadTexture(lcTexture* Texture) { - char FileName[LC_MAXPATH]; + char FileName[2*LC_MAXPATH]; if (mZipFiles[LC_ZIPFILE_OFFICIAL]) { diff --git a/common/lc_library.h b/common/lc_library.h index 4e390286..4d51f635 100644 --- a/common/lc_library.h +++ b/common/lc_library.h @@ -165,7 +165,7 @@ class lcLibraryPrimitive { public: explicit lcLibraryPrimitive(QString&& FileName, const char* Name, lcZipFileType ZipFileType,quint32 ZipFileIndex, bool Stud, bool SubFile) - : mFileName(FileName) + : mFileName(std::move(FileName)) { strncpy(mName, Name, sizeof(mName)); mName[sizeof(mName) - 1] = 0; @@ -177,7 +177,7 @@ public: mSubFile = SubFile; } - void SetZipFile(lcZipFileType ZipFileType,quint32 ZipFileIndex) + void SetZipFile(lcZipFileType ZipFileType, quint32 ZipFileIndex) { mZipFileType = ZipFileType; mZipFileIndex = ZipFileIndex; diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp index 0b0dd54d..a045091f 100644 --- a/qt/lc_qpropertiesdialog.cpp +++ b/qt/lc_qpropertiesdialog.cpp @@ -107,7 +107,7 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) : table->setItem((int)InfoTotals.size(), 0, new QTableWidgetItem(tr("Total"))); - for (Row = 0; Row < InfoTotals.size(); Row++) + for (Row = 0; Row < (int)InfoTotals.size(); Row++) { QTableWidgetItem *item = new QTableWidgetItem(QString::number(InfoTotals[Row])); item->setTextAlignment(Qt::AlignCenter);