summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--installerfw.pri13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/7z/7zCompressionMode.h7
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/7z/7zIn.cpp6
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/7z/7zOut.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/7z/7zUpdate.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/HandlerOut.cpp4
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/ParseProperties.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/XzHandler.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/FileStreams.h1
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp4
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp6
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h4
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp6
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/CopyCoder.h2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h2
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveCommandLine.cpp6
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/Bench.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/EnumDirItems.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/ExtractingFilePath.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/OpenArchive.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/Update.h6
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Console/List.cpp2
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Console/UpdateCallbackConsole.h12
-rw-r--r--src/libs/7zip/win/CPP/Common/DynamicBuffer.h2
-rw-r--r--src/libs/7zip/win/CPP/Common/MyCom.h1
-rw-r--r--src/libs/7zip/win/CPP/Common/Wildcard.cpp3
-rw-r--r--src/libs/7zip/win/CPP/Common/Wildcard.h4
-rw-r--r--src/libs/7zip/win/CPP/Windows/FileIO.cpp4
-rw-r--r--src/libs/7zip/win/CPP/Windows/Registry.cpp28
-rw-r--r--src/libs/installer/environmentvariablesoperation.cpp6
-rw-r--r--src/libs/installer/fsengineserver.cpp3
-rw-r--r--src/libs/installer/installer.pro5
-rw-r--r--src/libs/installer/link.cpp4
-rw-r--r--src/libs/kdtools/kdsavefile.cpp11
-rw-r--r--src/libs/kdtools/kdtools.pri2
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperations.cpp25
-rw-r--r--src/sdk/sdk.pro2
47 files changed, 125 insertions, 98 deletions
diff --git a/installerfw.pri b/installerfw.pri
index 86618d6d3..ba5fe9aa2 100644
--- a/installerfw.pri
+++ b/installerfw.pri
@@ -45,12 +45,6 @@ INCLUDEPATH += \
win32:INCLUDEPATH += $$IFW_SOURCE_TREE/src/libs/7zip/win/CPP
unix:INCLUDEPATH += $$IFW_SOURCE_TREE/src/libs/7zip/unix/CPP
-LIBS += -L$$IFW_LIB_PATH
-# The order is important. The linker needs to parse archives in reversed dependency order.
-equals(TEMPLATE, app):LIBS += -linstaller
-unix:!macx:LIBS += -lutil
-macx:LIBS += -framework Carbon -framework Security
-
CONFIG += help uitools
CONFIG(static, static|shared) {
QTPLUGIN += qsqlite
@@ -68,3 +62,10 @@ static {
win32:exists($$IFW_LIB_PATH/installer.lib):POST_TARGETDEPS += $$IFW_LIB_PATH/installer.lib
unix:exists($$IFW_LIB_PATH/libinstaller.a):POST_TARGETDEPS += $$IFW_LIB_PATH/libinstaller.a
}
+
+LIBS += -L$$IFW_LIB_PATH
+# The order is important for a static compilation. The linker needs to parse libs/objects in dependency order.
+equals(TEMPLATE, app):LIBS += -linstaller
+unix:!macx:LIBS += -lutil
+macx:LIBS += -framework Carbon -framework Security
+win32:LIBS *= -lmpr # PQR for MinGW-w64: Added -lmpr for WNetGetUniversalName.
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zCompressionMode.h b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zCompressionMode.h
index 55bbc68ee..b3536dd0c 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zCompressionMode.h
+++ b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zCompressionMode.h
@@ -38,11 +38,12 @@ struct CCompressionMethodMode
UString Password;
bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); }
- CCompressionMethodMode(): PasswordIsDefined(false)
+ CCompressionMethodMode():
#ifndef _7ZIP_ST
- , NumThreads(1)
+ NumThreads(1),
#endif
- {}
+ PasswordIsDefined(false)
+ {} // PQR for MinGW-w64: Initialization order.
};
}}
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zIn.cpp b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zIn.cpp
index 0feb81d2c..245cad7fa 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zIn.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zIn.cpp
@@ -297,7 +297,7 @@ static inline bool TestSignature2(const Byte *p)
return false;
if (CrcCalc(p + 12, 20) == GetUi32(p + 8))
return true;
- for (i = 8; i < kHeaderSize; i++)
+ for (i = 8; i < (int)kHeaderSize; i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
if (p[i] != 0)
return false;
return (p[6] != 0 || p[7] != 0);
@@ -1165,7 +1165,7 @@ HRESULT CInArchive::ReadDatabase2(
Byte buf[kCheckSize];
RINOK(_stream->Seek(0, STREAM_SEEK_END, &cur2));
int checkSize = kCheckSize;
- if (cur2 - cur < kCheckSize)
+ if (cur2 - cur < (unsigned int)kCheckSize) // PQR for MinGW-w64: Initialization order.
checkSize = (int)(cur2 - cur);
RINOK(_stream->Seek(-checkSize, STREAM_SEEK_END, &cur2));
@@ -1173,7 +1173,7 @@ HRESULT CInArchive::ReadDatabase2(
int i;
for (i = (int)checkSize - 2; i >= 0; i--)
- if (buf[i] == 0x17 && buf[i + 1] == 0x6 || buf[i] == 0x01 && buf[i + 1] == 0x04)
+ if ((buf[i] == 0x17 && buf[i + 1] == 0x6) || (buf[i] == 0x01 && buf[i + 1] == 0x04)) // PQR for MinGW-w64: Priority parentheses.
break;
if (i < 0)
return S_FALSE;
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zOut.cpp b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zOut.cpp
index 0c8aa7e8c..82a14e0cd 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zOut.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zOut.cpp
@@ -279,7 +279,7 @@ void COutArchive::WriteFolder(const CFolder &folder)
size_t propsSize = coder.Props.GetCapacity();
UInt64 id = coder.MethodID;
- int idSize;
+ unsigned int idSize; // PQR for MinGW-w64: Signed < Unsigned comparison.
for (idSize = 1; idSize < sizeof(id); idSize++)
if ((id >> (8 * idSize)) == 0)
break;
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zUpdate.cpp b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zUpdate.cpp
index ee7f55c04..3745d0bf4 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/7z/7zUpdate.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/7z/7zUpdate.cpp
@@ -333,7 +333,7 @@ static wchar_t *g_ExeExts[] =
static bool IsExeExt(const UString &ext)
{
- for (int i = 0; i < sizeof(g_ExeExts) / sizeof(g_ExeExts[0]); i++)
+ for (unsigned int i = 0; i < sizeof(g_ExeExts) / sizeof(g_ExeExts[0]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
if (ext.CompareNoCase(g_ExeExts[i]) == 0)
return true;
return false;
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h b/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h
index 1db3835b4..e621c736a 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h
@@ -24,7 +24,7 @@ public:
bool DataError;
bool MsZip;
- CCabBlockInStream(): _buffer(0), ReservedSize(0), MsZip(false), DataError(false), TotalPackSize(0) {}
+ CCabBlockInStream(): _buffer(0), TotalPackSize(0), ReservedSize(0), DataError(false), MsZip(false) {} // PQR for MinGW-w64: Initialization order.
~CCabBlockInStream();
bool Create();
void SetStream(ISequentialInStream *stream) { _stream = stream; }
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp
index 20f670d35..1635780c1 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp
@@ -619,7 +619,7 @@ HRESULT CFolderOutStream::FlushCorrupted()
{
const UInt32 kBufferSize = (1 << 10);
Byte buffer[kBufferSize];
- for (int i = 0; i < kBufferSize; i++)
+ for (unsigned int i = 0; i < kBufferSize; i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
buffer[i] = 0;
for (;;)
{
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Common/HandlerOut.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Common/HandlerOut.cpp
index 70ad47aad..ed5aea150 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Common/HandlerOut.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Common/HandlerOut.cpp
@@ -161,7 +161,7 @@ static bool ConvertProperty(PROPVARIANT srcProp, VARTYPE varType, NCOM::CPropVar
static int FindPropIdExact(const UString &name)
{
- for (int i = 0; i < sizeof(g_NameToPropID) / sizeof(g_NameToPropID[0]); i++)
+ for (unsigned int i = 0; i < sizeof(g_NameToPropID) / sizeof(g_NameToPropID[0]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
if (name.CompareNoCase(g_NameToPropID[i].Name) == 0)
return i;
return -1;
@@ -169,7 +169,7 @@ static int FindPropIdExact(const UString &name)
static int FindPropIdStart(const UString &name)
{
- for (int i = 0; i < sizeof(g_NameToPropID) / sizeof(g_NameToPropID[0]); i++)
+ for (unsigned int i = 0; i < sizeof(g_NameToPropID) / sizeof(g_NameToPropID[0]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
UString t = g_NameToPropID[i].Name;
if (t.CompareNoCase(name.Left(t.Length())) == 0)
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Common/ParseProperties.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Common/ParseProperties.cpp
index 5cd849e29..5ce58d5ed 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Common/ParseProperties.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Common/ParseProperties.cpp
@@ -50,7 +50,7 @@ HRESULT ParsePropDictionaryValue(const UString &srcStringSpec, UInt32 &dicSize)
return E_INVALIDARG;
if (srcString.Length() == numDigits)
{
- if (number >= kLogarithmicSizeLimit)
+ if (number >= (unsigned int)kLogarithmicSizeLimit) // PQR for MinGW-w64: Signed < Unsigned comparison.
return E_INVALIDARG;
dicSize = (UInt32)1 << (int)number;
return S_OK;
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp
index 5ceaa509d..58e733e17 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp
@@ -82,7 +82,7 @@ static HRESULT GetNextItemReal(ISequentialInStream *stream, bool &filled, CItemE
error = "There are no trailing zero-filled records";
return S_OK;
}
- if (processedSize != NFileHeader::kRecordSize)
+ if (processedSize != (unsigned int)NFileHeader::kRecordSize) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
error = "There is no correct record at the end of archive";
return S_OK;
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/XzHandler.cpp b/src/libs/7zip/win/CPP/7zip/Archive/XzHandler.cpp
index 64b7a5863..438d8b480 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/XzHandler.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/XzHandler.cpp
@@ -177,7 +177,7 @@ static AString GetMethodString(const CXzFilter &f)
{
AString s;
- for (int i = 0; i < sizeof(g_NamePairs) / sizeof(g_NamePairs[i]); i++)
+ for (unsigned int i = 0; i < sizeof(g_NamePairs) / sizeof(g_NamePairs[i]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
if (g_NamePairs[i].Id == f.id)
s = g_NamePairs[i].Name;
if (s.IsEmpty())
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp
index bd1563226..06ae08644 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp
@@ -265,7 +265,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
bool finded = false;
if (item.CentralExtra.GetStrongCryptoField(f))
{
- for (int i = 0; i < sizeof(g_StrongCryptoPairs) / sizeof(g_StrongCryptoPairs[0]); i++)
+ for (unsigned int i = 0; i < sizeof(g_StrongCryptoPairs) / sizeof(g_StrongCryptoPairs[0]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
const CStrongCryptoPair &pair = g_StrongCryptoPairs[i];
if (f.AlgId == pair.Id)
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
index a5e0f59d7..a8ce40962 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
@@ -263,7 +263,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
return E_INVALIDARG;
if (options.IsAesMode)
{
- if (options.Password.Length() > NCrypto::NWzAes::kPasswordSizeMax)
+ if (options.Password.Length() > (int)NCrypto::NWzAes::kPasswordSizeMax) // PQR for MinGW-w64: Signed < Unsigned comparison.
return E_INVALIDARG;
}
options.Password = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP);
diff --git a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp
index b36b61be7..792a244be 100644
--- a/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp
@@ -521,7 +521,7 @@ HRESULT CInArchive::FindCd(CCdInfo &cdInfo)
{
if (Get32(buf + i) == NSignature::kEndOfCentralDir)
{
- if (i >= kZip64EcdLocatorSize)
+ if (i >= (int)kZip64EcdLocatorSize) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
const Byte *locator = buf + i - kZip64EcdLocatorSize;
if (Get32(locator) == NSignature::kZip64EndOfCentralDirLocator)
diff --git a/src/libs/7zip/win/CPP/7zip/Common/FileStreams.h b/src/libs/7zip/win/CPP/7zip/Common/FileStreams.h
index 895745d36..573d3130c 100644
--- a/src/libs/7zip/win/CPP/7zip/Common/FileStreams.h
+++ b/src/libs/7zip/win/CPP/7zip/Common/FileStreams.h
@@ -14,7 +14,6 @@
#endif
#include "../../Common/MyCom.h"
-
#include "../IStream.h"
class CInFileStream:
diff --git a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
index 3c86c3aeb..bb2df1797 100644
--- a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
@@ -78,7 +78,7 @@ Byte *CDynBufSeqOutStream::GetBufPtrForWriting(size_t addSize)
void CDynBufSeqOutStream::CopyToBuffer(CByteBuffer &dest) const
{
dest.SetCapacity(_size);
- memcpy(dest, _buffer, _size);
+ memcpy(dest, &_buffer, _size); // PQR for MinGW-w64: requires _buffer address here.
}
STDMETHODIMP CDynBufSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
@@ -205,7 +205,7 @@ STDMETHODIMP CCachedInStream::Read(void *data, UInt32 size, UInt32 *processedSiz
return S_OK;
}
-
+
STDMETHODIMP CCachedInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
{
switch(seekOrigin)
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp
index cb1f981a7..7c641d7f7 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp
@@ -291,7 +291,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
unsigned b = (unsigned)(tPos & 0xFF);
tPos = tt[tPos >> 8];
- if (numReps == kRleModeRepSize)
+ if (numReps == (unsigned int)kRleModeRepSize) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
for (; b > 0; b--)
{
@@ -395,7 +395,7 @@ static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UIn
randToGo--;
}
- if (numReps == kRleModeRepSize)
+ if (numReps == (unsigned int)kRleModeRepSize) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
for (; b > 0; b--)
{
@@ -904,7 +904,7 @@ STDMETHODIMP CNsisDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
tPos = tt[tPos >> 8];
blockSize--;
- if (numReps == kRleModeRepSize)
+ if (numReps == (unsigned int)kRleModeRepSize) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
numReps = 0;
while (b)
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h
index e6dec1eaa..decf41dc3 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h
+++ b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h
@@ -91,8 +91,8 @@ private:
bool ReleaseInStream;
CDecoderFlusher(CDecoder *decoder, bool releaseInStream):
_decoder(decoder),
- ReleaseInStream(releaseInStream),
- NeedFlush(true) {}
+ NeedFlush(true),
+ ReleaseInStream(releaseInStream) {} // PQR for MinGW-w64: Initialization order.
~CDecoderFlusher()
{
if (NeedFlush)
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp
index eaa108558..37e719977 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp
@@ -846,7 +846,7 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *p
UInt32 numPasses = prop.ulVal;
if (numPasses == 0)
numPasses = 1;
- if (numPasses > kNumPassesMax)
+ if (numPasses > (unsigned int)kNumPassesMax) // PQR for MinGW-w64: Signed < Unsigned comparison.
numPasses = kNumPassesMax;
NumPasses = numPasses;
m_OptimizeNumTables = (NumPasses > 1);
@@ -857,9 +857,9 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *p
if (prop.vt != VT_UI4)
return E_INVALIDARG;
UInt32 dictionary = prop.ulVal / kBlockSizeStep;
- if (dictionary < kBlockSizeMultMin)
+ if (dictionary < (unsigned int)kBlockSizeMultMin) // PQR for MinGW-w64: Signed < Unsigned comparison.
dictionary = kBlockSizeMultMin;
- else if (dictionary > kBlockSizeMultMax)
+ else if (dictionary > (unsigned int)kBlockSizeMultMax) // PQR for MinGW-w64: Signed < Unsigned comparison.
dictionary = kBlockSizeMultMax;
m_BlockSizeMult = dictionary;
break;
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h
index a863172fe..e864fb398 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h
+++ b/src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h
@@ -137,7 +137,7 @@ public:
DWORD ThreadFunc();
#endif
- CThreadInfo(): m_BlockSorterIndex(0), m_Block(0) {}
+ CThreadInfo(): m_Block(0), m_BlockSorterIndex(0) {} // PQR for MinGW-w64: Initialization order.
~CThreadInfo() { Free(); }
bool Alloc();
void Free();
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/CopyCoder.h b/src/libs/7zip/win/CPP/7zip/Compress/CopyCoder.h
index c5445ccf8..daef658d9 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/CopyCoder.h
+++ b/src/libs/7zip/win/CPP/7zip/Compress/CopyCoder.h
@@ -17,7 +17,7 @@ class CCopyCoder:
Byte *_buffer;
public:
UInt64 TotalSize;
- CCopyCoder(): TotalSize(0), _buffer(0) {};
+ CCopyCoder(): _buffer(0), TotalSize(0) {} // PQR for MinGW-w64: Initialization order.
~CCopyCoder();
MY_UNKNOWN_IMP1(ICompressGetInStreamProcessedSize)
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h b/src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h
index 00e5ab8bf..1e0817fa7 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h
+++ b/src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h
@@ -114,7 +114,7 @@ struct CLevels
void SetFixedLevels()
{
- int i;
+ unsigned int i; // PQR for MinGW-w64: Signed < Unsigned comparison.
for (i = 0; i < 144; i++)
litLenLevels[i] = 8;
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp b/src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp
index 2848cd812..28ae304b0 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp
@@ -12,11 +12,11 @@ static const int kLenIdFinished = -1;
static const int kLenIdNeedInit = -2;
CCoder::CCoder(bool deflate64Mode, bool deflateNSIS):
- _deflate64Mode(deflate64Mode),
_deflateNSIS(deflateNSIS),
+ _deflate64Mode(deflate64Mode),
_keepHistory(false),
_needInitInStream(true),
- ZlibMode(false) {}
+ ZlibMode(false) {} // PQR for MinGW-w64: Initialization order.
UInt32 CCoder::ReadBits(int numBits)
{
@@ -90,14 +90,14 @@ bool CCoder::ReadTables(void)
{
int numLitLenLevels = ReadBits(kNumLenCodesFieldSize) + kNumLitLenCodesMin;
_numDistLevels = ReadBits(kNumDistCodesFieldSize) + kNumDistCodesMin;
- int numLevelCodes = ReadBits(kNumLevelCodesFieldSize) + kNumLevelCodesMin;
+ unsigned int numLevelCodes = ReadBits(kNumLevelCodesFieldSize) + kNumLevelCodesMin;
if (!_deflate64Mode)
if (_numDistLevels > kDistTableSize32)
return false;
Byte levelLevels[kLevelTableSize];
- for (int i = 0; i < kLevelTableSize; i++)
+ for (unsigned int i = 0; i < kLevelTableSize; i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
int position = kCodeLengthAlphabetOrder[i];
if(i < numLevelCodes)
diff --git a/src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp b/src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp
index 35a81cae4..4ce104f91 100644
--- a/src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp
@@ -49,7 +49,7 @@ class CFastPosInit
public:
CFastPosInit()
{
- int i;
+ unsigned int i; // PQR for MinGW-w64: Signed < Unsigned comparison.
for(i = 0; i < kNumLenSlots; i++)
{
int c = kLenStart32[i];
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveCommandLine.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
index 8ae2e15e8..3750f5b24 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
@@ -275,6 +275,8 @@ static void AddNameToCensor(NWildcard::CCensor &wildcardCensor,
case NRecursedType::kRecursed:
recursed = true;
break;
+ default: // PQR for MinGW-w64: To avoid compiler warnings on unhandled cases.
+ break;
}
wildcardCensor.AddItem(include, name, recursed);
}
@@ -742,8 +744,8 @@ static int FindCharset(const NCommandLineParser::CParser &parser, int keyIndex,
UString name = parser[keyIndex].PostStrings.Back();
name.MakeUpper();
- int i;
- for (i = 0; i < sizeof(g_CodePagePairs) / sizeof(g_CodePagePairs[0]); i++)
+ unsigned int i;
+ for (i = 0; i < sizeof(g_CodePagePairs) / sizeof(g_CodePagePairs[0]); i++) // PQR for MinGW-w64: Signed < Unsigned.
{
const CCodePagePair &pair = g_CodePagePairs[i];
if (name.Compare(pair.Name) == 0)
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
index 4c0cc90b5..54ad11945 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
@@ -316,6 +316,8 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre
return E_FAIL;
}
}
+ default: // PQR for MinGW-w64: To avoid compiler warnings about unhandled cases.
+ break;
}
if (_overwriteMode == NExtract::NOverwriteMode::kAutoRename)
{
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/Bench.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/Bench.cpp
index 282f405f1..163851c3a 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/Bench.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/Bench.cpp
@@ -907,7 +907,7 @@ struct CCrcThreads
{
UInt32 NumThreads;
CCrcInfo *Items;
- CCrcThreads(): Items(0), NumThreads(0) {}
+ CCrcThreads(): NumThreads(0), Items(0) {} // PQR for MinGW-w64: Initialization order.
void WaitAll()
{
for (UInt32 i = 0; i < NumThreads; i++)
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/EnumDirItems.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/EnumDirItems.cpp
index ba03ea35c..71073f2b7 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/EnumDirItems.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/EnumDirItems.cpp
@@ -219,7 +219,7 @@ static HRESULT EnumerateDirItems(const NWildcard::CCensorNode &curNode,
continue;
}
bool isDir = fi.IsDir();
- if (isDir && !item.ForDir || !isDir && !item.ForFile)
+ if ((isDir && !item.ForDir) || (!isDir && !item.ForFile)) // PQR for MinGW-w64: Priority parentheses.
{
errorCodes.Add((DWORD)E_FAIL);
errorPaths.Add(fullPath);
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/ExtractingFilePath.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/ExtractingFilePath.cpp
index 8f31708b6..91749497f 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/ExtractingFilePath.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/ExtractingFilePath.cpp
@@ -59,7 +59,7 @@ static bool CheckNameNum(const UString &name, const wchar_t *reservedName)
static bool IsSupportedName(const UString &name)
{
- for (int i = 0; i < sizeof(g_ReservedNames) / sizeof(g_ReservedNames[0]); i++)
+ for (unsigned int i = 0; i < sizeof(g_ReservedNames) / sizeof(g_ReservedNames[0]); i++) // PQR for MinGW-w64: Signed < Unsigned comparison.
{
const wchar_t *reservedName = g_ReservedNames[i];
int len = MyStringLen(reservedName);
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/OpenArchive.cpp b/src/libs/7zip/win/CPP/7zip/UI/Common/OpenArchive.cpp
index 56a630467..ab45bd027 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/OpenArchive.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/OpenArchive.cpp
@@ -167,7 +167,7 @@ HRESULT CArc::OpenStream(
{
const CArcInfoEx &ai = codecs->Formats[orderIndices[i]];
const CByteBuffer &sig = ai.StartSignature;
- if (sig.GetCapacity() < kNumHashBytes)
+ if (sig.GetCapacity() < (unsigned int)kNumHashBytes) // PQR for MinGW-w64: Signed < Unsigned comparison.
continue;
UInt32 v = HASH_VAL(sig, 0);
prevs[i] = hash[v];
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Common/Update.h b/src/libs/7zip/win/CPP/7zip/UI/Common/Update.h
index 49af0092a..15cc5010c 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Common/Update.h
+++ b/src/libs/7zip/win/CPP/7zip/UI/Common/Update.h
@@ -116,12 +116,12 @@ struct CUpdateOptions
CUpdateOptions():
UpdateArchiveItself(true),
SfxMode(false),
+ OpenShareForWrite(false),
StdInMode(false),
StdOutMode(false),
EMailMode(false),
- EMailRemoveAfter(false),
- OpenShareForWrite(false)
- {};
+ EMailRemoveAfter(false)
+ {} // PQR for MinGW-w64: Initialization order.
void SetAddActionCommand()
{
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Console/List.cpp b/src/libs/7zip/win/CPP/7zip/UI/Console/List.cpp
index f747cfda8..8e7d3f295 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Console/List.cpp
+++ b/src/libs/7zip/win/CPP/7zip/UI/Console/List.cpp
@@ -202,7 +202,7 @@ void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems)
static UString GetPropName(PROPID propID, BSTR name)
{
- for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++)
+ for (unsigned int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++) // PQR for MinGW-w64: Signed < Unsigned.
{
const CPropIdToName &propIdToName = kPropIdToName[i];
if (propIdToName.PropID == propID)
diff --git a/src/libs/7zip/win/CPP/7zip/UI/Console/UpdateCallbackConsole.h b/src/libs/7zip/win/CPP/7zip/UI/Console/UpdateCallbackConsole.h
index 5ffe3eb7a..b4cbf793e 100644
--- a/src/libs/7zip/win/CPP/7zip/UI/Console/UpdateCallbackConsole.h
+++ b/src/libs/7zip/win/CPP/7zip/UI/Console/UpdateCallbackConsole.h
@@ -30,14 +30,14 @@ public:
CUpdateCallbackConsole():
m_PercentPrinter(1 << 16),
+ m_WarningsMode(false),
+ EnablePercents(true),
+ StdOutMode(false)
#ifndef _NO_CRYPTO
- PasswordIsDefined(false),
- AskPassword(false),
+ ,PasswordIsDefined(false),
+ AskPassword(false)
#endif
- StdOutMode(false),
- EnablePercents(true),
- m_WarningsMode(false)
- {}
+ {} // PQR for MinGW-w64: Initialization order.
~CUpdateCallbackConsole() { Finilize(); }
void Init(CStdOutStream *outStream)
diff --git a/src/libs/7zip/win/CPP/Common/DynamicBuffer.h b/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
index bf52a7425..8bf54e726 100644
--- a/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
+++ b/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
@@ -20,7 +20,7 @@ template <class T> class CDynamicBuffer: public CBuffer<T>
size_t newCap = this->_capacity + delta;
if (newCap < delta)
newCap = this->_capacity + size;
- SetCapacity(newCap);
+ CBuffer<T>::SetCapacity(newCap); // PQR for MinGW-w64: template specification required.
}
public:
CDynamicBuffer(): CBuffer<T>() {};
diff --git a/src/libs/7zip/win/CPP/Common/MyCom.h b/src/libs/7zip/win/CPP/Common/MyCom.h
index 2f00c258f..308a35d18 100644
--- a/src/libs/7zip/win/CPP/Common/MyCom.h
+++ b/src/libs/7zip/win/CPP/Common/MyCom.h
@@ -4,6 +4,7 @@
#define __MYCOM_H
#include "MyWindows.h"
+#include "unknwn.h" // PQR for MinGW-w64: To allow IID_IUnknown to be defined.
#ifndef RINOK
#define RINOK(x) { HRESULT __result_ = (x); if (__result_ != S_OK) return __result_; }
diff --git a/src/libs/7zip/win/CPP/Common/Wildcard.cpp b/src/libs/7zip/win/CPP/Common/Wildcard.cpp
index 476ddebde..bc4f97bd7 100644
--- a/src/libs/7zip/win/CPP/Common/Wildcard.cpp
+++ b/src/libs/7zip/win/CPP/Common/Wildcard.cpp
@@ -402,11 +402,12 @@ void CCensor::AddItem(bool include, const UString &path, bool recursive)
}
}
int numAbsParts = 0;
- if (isAbs)
+ if (isAbs) { // PQR for MinGW-w64: Explicit braces needed.
if (pathParts.Size() > 1)
numAbsParts = pathParts.Size() - 1;
else
numAbsParts = 1;
+ }
UString prefix;
for (int i = 0; i < numAbsParts; i++)
{
diff --git a/src/libs/7zip/win/CPP/Common/Wildcard.h b/src/libs/7zip/win/CPP/Common/Wildcard.h
index 6d4cbcece..859f567ea 100644
--- a/src/libs/7zip/win/CPP/Common/Wildcard.h
+++ b/src/libs/7zip/win/CPP/Common/Wildcard.h
@@ -32,8 +32,8 @@ class CCensorNode
void AddItemSimple(bool include, CItem &item);
bool CheckPath(UStringVector &pathParts, bool isFile, bool &include) const;
public:
- CCensorNode(): Parent(0) { };
- CCensorNode(const UString &name, CCensorNode *parent): Name(name), Parent(parent) { };
+ CCensorNode(): Parent(0) { }
+ CCensorNode(const UString &name, CCensorNode *parent): Parent(parent), Name(name) { } // PQR for MinGW-w64: Initialization order.
UString Name;
CObjectVector<CCensorNode> SubNodes;
CObjectVector<CItem> IncludeItems;
diff --git a/src/libs/7zip/win/CPP/Windows/FileIO.cpp b/src/libs/7zip/win/CPP/Windows/FileIO.cpp
index 938e6c701..c848a710c 100644
--- a/src/libs/7zip/win/CPP/Windows/FileIO.cpp
+++ b/src/libs/7zip/win/CPP/Windows/FileIO.cpp
@@ -71,12 +71,12 @@ bool GetLongPathBase(LPCWSTR s, UString &res)
res.Empty();
int len = MyStringLen(s);
wchar_t c = s[0];
- if (len < 1 || c == L'\\' || c == L'.' && (len == 1 || len == 2 && s[1] == L'.'))
+ if (len < 1 || c == L'\\' || (c == L'.' && (len == 1 || (len == 2 && s[1] == L'.')))) // PQR for MinGW-w64: Priority parentheses.
return true;
UString curDir;
bool isAbs = false;
if (len > 3)
- isAbs = (s[1] == L':' && s[2] == L'\\' && (c >= L'a' && c <= L'z' || c >= L'A' && c <= L'Z'));
+ isAbs = (s[1] == L':' && s[2] == L'\\' && ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'))); // PQR for MinGW-w64: Priority parentheses.
if (!isAbs)
{
diff --git a/src/libs/7zip/win/CPP/Windows/Registry.cpp b/src/libs/7zip/win/CPP/Windows/Registry.cpp
index 8b25375d9..c6db9266f 100644
--- a/src/libs/7zip/win/CPP/Windows/Registry.cpp
+++ b/src/libs/7zip/win/CPP/Windows/Registry.cpp
@@ -116,7 +116,8 @@ LONG CKey::DeleteValue(LPCWSTR name)
LONG CKey::SetValue(LPCTSTR name, UInt32 value)
{
MYASSERT(_object != NULL);
- return RegSetValueEx(_object, name, NULL, REG_DWORD,
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
+ return RegSetValueEx(_object, name, 0, REG_DWORD,
(BYTE * const)&value, sizeof(UInt32));
}
@@ -129,7 +130,8 @@ LONG CKey::SetValue(LPCTSTR name, LPCTSTR value)
{
MYASSERT(value != NULL);
MYASSERT(_object != NULL);
- return RegSetValueEx(_object, name, NULL, REG_SZ,
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
+ return RegSetValueEx(_object, name, 0, REG_SZ,
(const BYTE * )value, (lstrlen(value) + 1) * sizeof(TCHAR));
}
@@ -163,7 +165,8 @@ LONG CKey::SetValue(LPCTSTR name, const void *value, UInt32 size)
{
MYASSERT(value != NULL);
MYASSERT(_object != NULL);
- return RegSetValueEx(_object, name, NULL, REG_BINARY,
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
+ return RegSetValueEx(_object, name, 0, REG_BINARY,
(const BYTE *)value, size);
}
@@ -189,9 +192,10 @@ LONG CKey::SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value)
LONG CKey::QueryValue(LPCTSTR name, UInt32 &value)
{
- DWORD type = NULL;
+ DWORD type = 0; // PQR for MinGW-w64: Changed NULL to 0 to avoid warning.
DWORD count = sizeof(DWORD);
- LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type,
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, 0, &type,
(LPBYTE)&value, &count);
MYASSERT((res!=ERROR_SUCCESS) || (type == REG_DWORD));
MYASSERT((res!=ERROR_SUCCESS) || (count == sizeof(UInt32)));
@@ -227,8 +231,9 @@ LONG CKey::GetValue_IfOk(LPCTSTR name, bool &value)
LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count)
{
MYASSERT(count != NULL);
- DWORD type = NULL;
- LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count);
+ DWORD type = 0; // PQR for MinGW-w64: Changed NULL to 0 to avoid warning.
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, 0, &type, (LPBYTE)value, (DWORD *)&count);
MYASSERT((res!=ERROR_SUCCESS) || (type == REG_SZ) || (type == REG_MULTI_SZ) || (type == REG_EXPAND_SZ));
return res;
}
@@ -236,8 +241,9 @@ LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count)
LONG CKey::QueryValue(LPCTSTR name, CSysString &value)
{
value.Empty();
- DWORD type = NULL;
+ DWORD type = 0; // PQR for MinGW-w64: Changed NULL to 0 to avoid warning.
UInt32 currentSize = 0;
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)&currentSize);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
return res;
@@ -282,7 +288,8 @@ LONG CKey::QueryValue(LPCWSTR name, UString &value)
LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count)
{
- DWORD type = NULL;
+ DWORD type = 0; // PQR for MinGW-w64: Changed NULL to 0 to avoid warning.
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count);
MYASSERT((res!=ERROR_SUCCESS) || (type == REG_BINARY));
return res;
@@ -291,8 +298,9 @@ LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count)
LONG CKey::QueryValue(LPCTSTR name, CByteBuffer &value, UInt32 &dataSize)
{
- DWORD type = NULL;
+ DWORD type = 0; // PQR for MinGW-w64: Changed NULL to 0 to avoid warning.
dataSize = 0;
+ // PQR for MinGW-w64: Parameter #3 was NULL instead of 0.
LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)&dataSize);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
return res;
diff --git a/src/libs/installer/environmentvariablesoperation.cpp b/src/libs/installer/environmentvariablesoperation.cpp
index 68693d455..98915b5c6 100644
--- a/src/libs/installer/environmentvariablesoperation.cpp
+++ b/src/libs/installer/environmentvariablesoperation.cpp
@@ -62,9 +62,15 @@ static bool broadcastChange() {
// Use SendMessageTimeout to Broadcast a message to the whole system to update settings of all
// running applications. This is needed to activate the changes done above without logout+login.
// Note that cmd.exe does not respond to any WM_SETTINGCHANGE messages...
+#ifdef __MINGW64__
+ PDWORD_PTR aResult = 0;
+ LRESULT sendresult = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE,
+ 0, (LPARAM) "Environment", SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, aResult);
+#else
DWORD aResult = 0;
LRESULT sendresult = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE,
0, (LPARAM) "Environment", SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &aResult);
+#endif
if (sendresult == 0 || aResult != 0) {
qWarning("Failed to broadcast a WM_SETTINGCHANGE message\n");
return false;
diff --git a/src/libs/installer/fsengineserver.cpp b/src/libs/installer/fsengineserver.cpp
index 2b2556c3d..9bcc4a920 100644
--- a/src/libs/installer/fsengineserver.cpp
+++ b/src/libs/installer/fsengineserver.cpp
@@ -60,7 +60,8 @@ bool startDetached(const QString &program, const QStringList &args, const QStrin
};
const QString arguments = QInstaller::createCommandline(program, args);
- const bool success = CreateProcess(0, const_cast<wchar_t *>(static_cast<const wchar_t *>(arguments.utf16())),
+ // PQR for MinGW-w64: Parameter #2 was const_cast<wchar_t *>(static_cast<const wchar_t *>(arguments.utf16())).
+ const bool success = CreateProcess(0, (LPWSTR)arguments.utf16(),
0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE,
0, (wchar_t*)workingDirectory.utf16(),
&startupInfo, &pinfo);
diff --git a/src/libs/installer/installer.pro b/src/libs/installer/installer.pro
index f21394ae2..5a74e5772 100644
--- a/src/libs/installer/installer.pro
+++ b/src/libs/installer/installer.pro
@@ -178,8 +178,9 @@ unix:!macx:SOURCES += adminauthorization_x11.cpp
win32 {
SOURCES += adminauthorization_win.cpp
- LIBS += -loleaut32 -lUser32 # 7zip
- LIBS += advapi32.lib psapi.lib # kdtools
+ LIBS += -loleaut32 -lUser32 # 7zip
+ LIBS += -ladvapi32 -lpsapi # kdtools - PQR for MinGW-w64: Changed to standard link flags.
+ LIBS += -lmpr -luuid # PQR for MinGW-w64: libMPR is for WNetGetUniversalName, libUUID is for IID_IUnknown and friends.
LIBS += -lole32 # createshortcutoperation
CONFIG(shared, static|shared):LIBS += -lshell32
}
diff --git a/src/libs/installer/link.cpp b/src/libs/installer/link.cpp
index 31f6270f4..08214232f 100644
--- a/src/libs/installer/link.cpp
+++ b/src/libs/installer/link.cpp
@@ -81,7 +81,7 @@ public:
: m_dirHandle(INVALID_HANDLE_VALUE)
{
QString normalizedPath = QString(path).replace(QLatin1Char('/'), QLatin1Char('\\'));
- m_dirHandle = CreateFile(normalizedPath.utf16(), GENERIC_READ | GENERIC_WRITE, 0, 0,
+ m_dirHandle = CreateFile(normalizedPath.toStdWString().c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0,
OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0);
if (m_dirHandle == INVALID_HANDLE_VALUE) {
@@ -149,7 +149,7 @@ Link createJunction(const QString &linkPath, const QString &targetPath)
QString normalizedTargetPath = QString(targetPath).replace(QLatin1Char('/'), QLatin1Char('\\'));
//now we add the real absolute path
- StringCchCat(szDestDir, 1024, normalizedTargetPath.utf16());
+ StringCchCat(szDestDir, 1024, normalizedTargetPath.toStdWString().c_str());
// Allocates a block of memory for an array of num elements(1) and initializes all its bits to zero.
_REPARSE_DATA_BUFFER* reparseStructData = (_REPARSE_DATA_BUFFER*)calloc(1,
diff --git a/src/libs/kdtools/kdsavefile.cpp b/src/libs/kdtools/kdsavefile.cpp
index 94ed1aa36..5a81ad424 100644
--- a/src/libs/kdtools/kdsavefile.cpp
+++ b/src/libs/kdtools/kdsavefile.cpp
@@ -28,7 +28,8 @@
#include <QtCore/QTemporaryFile>
#ifdef Q_OS_WIN
-# include <io.h>
+ #include <io.h>
+ #include <share.h> // PQR for MinGW-w64: Required for _SH_DENYRW
#endif
#include <memory>
#include <sys/stat.h>
@@ -92,9 +93,11 @@ static QString makeAbsolute(const QString &path)
static int myOpen(const QString &path, int flags, int mode)
{
#ifdef Q_OS_WIN
- int fd;
- _wsopen_s(&fd, reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
- return fd;
+ // PQR for MinGW-w64: _wsopen_s doesn't exist in MSVCRT.dll, let's use _wsopen.
+ return _wsopen(reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
+ //int fd;
+ //_wsopen_s(&fd, reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
+ //return fd;
#else
return open(QFile::encodeName(path).constData(), flags, mode);
#endif
diff --git a/src/libs/kdtools/kdtools.pri b/src/libs/kdtools/kdtools.pri
index a83243502..6023fdee8 100644
--- a/src/libs/kdtools/kdtools.pri
+++ b/src/libs/kdtools/kdtools.pri
@@ -17,7 +17,7 @@ HEADERS += $$PWD/kdtoolsglobal.h \
$$PWD/kdsysinfo.h
SOURCES += $$PWD/kdjob.cpp \
- $$PWD/kdgenericfactory.cpp \
+# $$PWD/kdgenericfactory.cpp \ # this has no content
$$PWD/kdselfrestarter.cpp \
$$PWD/kdsavefile.cpp \
$$PWD/kdrunoncechecker.cpp \
diff --git a/src/libs/kdtools/kdupdaterupdateoperations.cpp b/src/libs/kdtools/kdupdaterupdateoperations.cpp
index 6f934abe8..fa8f3ce0d 100644
--- a/src/libs/kdtools/kdupdaterupdateoperations.cpp
+++ b/src/libs/kdtools/kdupdaterupdateoperations.cpp
@@ -104,8 +104,8 @@ void CopyOperation::backup()
setValue(QLatin1String("backupOfExistingDestination"), backupFileName(dest));
- // race condition: The backup file could get created
- // by another process right now. But this is the same
+ // race condition: The backup file could get created
+ // by another process right now. But this is the same
// in QFile::copy...
const bool success = QFile::rename(dest, value(QLatin1String("backupOfExistingDestination")).toString());
if (!success)
@@ -179,9 +179,9 @@ QDomDocument CopyOperation::toXml() const
// we don't want to save the backupOfExistingDestination
if (!hasValue(QLatin1String("backupOfExistingDestination")))
return UpdateOperation::toXml();
-
+
CopyOperation *const me = const_cast<CopyOperation *>(this);
-
+
const QVariant v = value(QLatin1String("backupOfExistingDestination"));
me->clearValue(QLatin1String("backupOfExistingDestination"));
const QDomDocument xml = UpdateOperation::toXml();
@@ -225,8 +225,8 @@ void MoveOperation::backup()
setValue(QLatin1String("backupOfExistingDestination"), backupFileName(dest));
- // race condition: The backup file could get created
- // by another process right now. But this is the same
+ // race condition: The backup file could get created
+ // by another process right now. But this is the same
// in QFile::copy...
const bool success = QFile::rename(dest, value(QLatin1String("backupOfExistingDestination")).toString());
if (!success)
@@ -389,9 +389,9 @@ QDomDocument DeleteOperation::toXml() const
// we don't want to save the backupOfExistingFile
if (!hasValue(QLatin1String("backupOfExistingFile")))
return UpdateOperation::toXml();
-
+
DeleteOperation *const me = const_cast<DeleteOperation *>(this);
-
+
const QVariant v = value(QLatin1String("backupOfExistingFile"));
me->clearValue(QLatin1String("backupOfExistingFile"));
const QDomDocument xml = UpdateOperation::toXml();
@@ -847,7 +847,7 @@ bool ExecuteOperation::performOperation()
}
QList<int> allowedExitCodes;
-
+
QRegExp re(QLatin1String("^\\{((-?\\d+,)*-?\\d+)\\}$"));
if (re.exactMatch(args.first())) {
const QStringList numbers = re.cap(1).split(QLatin1Char(','));
@@ -865,7 +865,7 @@ bool ExecuteOperation::performOperation()
args.pop_back();
#ifdef Q_OS_WIN
QString arguments = qt_create_commandline(args.front(), args.mid(1));
-
+
PROCESS_INFORMATION pinfo;
STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), 0, 0, 0,
@@ -873,7 +873,8 @@ bool ExecuteOperation::performOperation()
static_cast< ulong >(CW_USEDEFAULT), static_cast< ulong >(CW_USEDEFAULT),
0, 0, 0, STARTF_USESHOWWINDOW, SW_HIDE, 0, 0, 0, 0, 0
};
- success = CreateProcess(0, const_cast< wchar_t* >(static_cast< const wchar_t* >(arguments.utf16())),
+ // PQR for MinGW-w64: Parameter #2 was const_cast< wchar_t* >(static_cast< const wchar_t* >(arguments.utf16())).
+ success = CreateProcess(0, (LPWSTR)arguments.utf16(),
0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0,
0,
&startupInfo, &pinfo);
@@ -887,7 +888,7 @@ bool ExecuteOperation::performOperation()
{
Environment::instance().applyTo(&process); //apply non-persistent variables
process.start(args.front(), args.mid(1));
-
+
QEventLoop loop;
QObject::connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit()));
QObject::connect(&process, SIGNAL(readyRead()), this, SLOT(readProcessOutput()));
diff --git a/src/sdk/sdk.pro b/src/sdk/sdk.pro
index 3cf5b6c64..72a0dc1ec 100644
--- a/src/sdk/sdk.pro
+++ b/src/sdk/sdk.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
DEPENDPATH += . ..
-INCLUDEPATH += . ..
+INCLUDEPATH += . ..
TARGET = installerbase
include(../../installerfw.pri)