Patch-Source: https://github.com/upx/upx-lzma-sdk/commit/c6c2fc49e2ac6f3fc82762c6d3703969274d48de From c6c2fc49e2ac6f3fc82762c6d3703969274d48de Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sat, 15 May 2021 06:00:50 +0200 Subject: [PATCH] Silence yet some more compilation warnings. --- C/7zip/Common/InBuffer.cpp | 14 +++++++------- C/7zip/Compress/LZMA/LZMADecoder.h | 8 ++++---- C/Common/MyCom.h | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/C/7zip/Common/InBuffer.cpp b/C/7zip/Common/InBuffer.cpp index ae54a53..e26eba2 100644 --- a/src/lzma-sdk/C/7zip/Common/InBuffer.cpp +++ b/src/lzma-sdk/C/7zip/Common/InBuffer.cpp @@ -7,10 +7,10 @@ #include "../../Common/Alloc.h" CInBuffer::CInBuffer(): - _buffer(0), - _bufferLimit(0), - _bufferBase(0), - _stream(0), + _buffer(NULL), + _bufferLimit(NULL), + _bufferBase(NULL), + _stream(NULL), _bufferSize(0) {} @@ -19,18 +19,18 @@ bool CInBuffer::Create(UInt32 bufferSize) const UInt32 kMinBlockSize = 1; if (bufferSize < kMinBlockSize) bufferSize = kMinBlockSize; - if (_bufferBase != 0 && _bufferSize == bufferSize) + if (_bufferBase != NULL && _bufferSize == bufferSize) return true; Free(); _bufferSize = bufferSize; _bufferBase = (Byte *)::MidAlloc(bufferSize); - return (_bufferBase != 0); + return (_bufferBase != NULL); } void CInBuffer::Free() { ::MidFree(_bufferBase); - _bufferBase = 0; + _bufferBase = NULL; } void CInBuffer::SetStream(ISequentialInStream *stream) diff --git a/C/7zip/Compress/LZMA/LZMADecoder.h b/C/7zip/Compress/LZMA/LZMADecoder.h index 5b9c95f..a7c4ce3 100644 --- a/src/lzma-sdk/C/7zip/Compress/LZMA/LZMADecoder.h +++ b/src/lzma-sdk/C/7zip/Compress/LZMA/LZMADecoder.h @@ -74,16 +74,16 @@ class CLiteralDecoder int _numPosBits; UInt32 _posMask; public: - CLiteralDecoder(): _coders(0) {} + CLiteralDecoder(): _coders(NULL) {} ~CLiteralDecoder() { Free(); } void Free() { MyFree(_coders); - _coders = 0; + _coders = NULL; } bool Create(int numPosBits, int numPrevBits) { - if (_coders == 0 || (numPosBits + numPrevBits) != + if (_coders == NULL || (numPosBits + numPrevBits) != (_numPrevBits + _numPosBits) ) { Free(); @@ -93,7 +93,7 @@ class CLiteralDecoder _numPosBits = numPosBits; _posMask = (1 << numPosBits) - 1; _numPrevBits = numPrevBits; - return (_coders != 0); + return (_coders != NULL); } void Init() { diff --git a/C/Common/MyCom.h b/C/Common/MyCom.h index 54a67ae..3227272 100644 --- a/src/lzma-sdk/C/Common/MyCom.h +++ b/src/lzma-sdk/C/Common/MyCom.h @@ -156,8 +156,9 @@ class CMyUnknownImp #define MY_ADDREF_RELEASE \ STDMETHOD_(ULONG, AddRef)() { return ++__m_RefCount; } \ -STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \ - return __m_RefCount; delete this; return 0; } +STDMETHOD_(ULONG, Release)() { \ + if (--__m_RefCount != 0) return __m_RefCount; \ + delete this; return 0; } #define MY_UNKNOWN_IMP_SPEC(i) \ MY_QUERYINTERFACE_BEGIN \