chore(build): update StormLib

This commit is contained in:
VDm 2024-02-11 14:40:24 +04:00
parent 65e7b80159
commit 6c18e4a2ce
5 changed files with 21 additions and 21 deletions

View File

@ -508,8 +508,8 @@ static bool BaseMap_Open(TFileStream * pStream, LPCTSTR szFileName, DWORD dwStre
HANDLE hMap = NULL; HANDLE hMap = NULL;
bool bResult = false; bool bResult = false;
// Keep compiler happy // Keep compilers happy
dwStreamFlags = dwStreamFlags; STORMLIB_UNUSED(dwStreamFlags);
// 1) Try to treat "szFileName" as a section name // 1) Try to treat "szFileName" as a section name
hMap = OpenFileMapping(SECTION_QUERY | FILE_MAP_READ, FALSE, szFileName); hMap = OpenFileMapping(SECTION_QUERY | FILE_MAP_READ, FALSE, szFileName);
@ -699,8 +699,8 @@ static bool BaseHttp_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
HINTERNET hRequest; HINTERNET hRequest;
DWORD dwTemp = 0; DWORD dwTemp = 0;
// Keep compiler happy // Keep compilers happy
dwStreamFlags = dwStreamFlags; STORMLIB_UNUSED(dwStreamFlags);
// Don't connect to the internet // Don't connect to the internet
if(!InternetGetConnectedState(&dwTemp, 0)) if(!InternetGetConnectedState(&dwTemp, 0))
@ -2245,9 +2245,9 @@ static bool Block4Stream_BlockRead(
assert(StartOffset < EndOffset); assert(StartOffset < EndOffset);
assert(bAvailable == true); assert(bAvailable == true);
// Keep compiler happy // Keep compilers happy
bAvailable = bAvailable; STORMLIB_UNUSED(bAvailable);
EndOffset = EndOffset; STORMLIB_UNUSED(EndOffset);
while(BytesNeeded != 0) while(BytesNeeded != 0)
{ {

View File

@ -107,8 +107,8 @@ void TMPQBits::GetBits(
unsigned int nBitOffset = (nBitPosition & 0x07); unsigned int nBitOffset = (nBitPosition & 0x07);
unsigned char BitBuffer; unsigned char BitBuffer;
// Keep compiler happy for platforms where nResultByteSize is not used // Keep compilers happy for platforms where nResultByteSize is not used
nResultByteSize = nResultByteSize; STORMLIB_UNUSED(nResultByteSize);
#ifdef _DEBUG #ifdef _DEBUG
// Check if the target is properly zeroed // Check if the target is properly zeroed
@ -172,8 +172,8 @@ void TMPQBits::SetBits(
unsigned short AndMask = 0; unsigned short AndMask = 0;
unsigned short OneByte = 0; unsigned short OneByte = 0;
// Keep compiler happy for platforms where nResultByteSize is not used // Keep compilers happy for platforms where nResultByteSize is not used
nResultByteSize = nResultByteSize; STORMLIB_UNUSED(nResultByteSize);
#ifndef STORMLIB_LITTLE_ENDIAN #ifndef STORMLIB_LITTLE_ENDIAN
// Adjust the buffer pointer for big endian platforms // Adjust the buffer pointer for big endian platforms

View File

@ -1107,8 +1107,8 @@ bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearch
TMPQFile * hf = NULL; TMPQFile * hf = NULL;
DWORD dwErrCode = ERROR_SUCCESS; DWORD dwErrCode = ERROR_SUCCESS;
// Keep compiler happy // Keep compilers happy
dwSearchScope = dwSearchScope; STORMLIB_UNUSED(dwSearchScope);
// Check the parameters // Check the parameters
if(ha == NULL) if(ha == NULL)

View File

@ -204,9 +204,9 @@ DWORD WINAPI SFileEnumLocales(
if(IsPseudoFileName(szFileName, &dwFileIndex)) if(IsPseudoFileName(szFileName, &dwFileIndex))
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
// Keep compiler happy // Keep compilers happy
dwMaxLocales = PtrMaxLocales[0]; dwMaxLocales = PtrMaxLocales[0];
dwSearchScope = dwSearchScope; STORMLIB_UNUSED(dwSearchScope);
// Parse all files with that name // Parse all files with that name
pFirstHash = pHash = GetFirstHashEntry(ha, szFileName); pFirstHash = pHash = GetFirstHashEntry(ha, szFileName);

View File

@ -1081,7 +1081,6 @@ void Patch_Finalize(TMPQPatcher * pPatcher)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Public functions // Public functions
@ -1096,9 +1095,6 @@ bool WINAPI SFileOpenPatchArchive(
HANDLE hPatchMpq = NULL; HANDLE hPatchMpq = NULL;
DWORD dwErrCode = ERROR_SUCCESS; DWORD dwErrCode = ERROR_SUCCESS;
// Keep compiler happy
dwFlags = dwFlags;
// Verify input parameters // Verify input parameters
if(!IsValidMpqHandle(hMpq)) if(!IsValidMpqHandle(hMpq))
dwErrCode = ERROR_INVALID_HANDLE; dwErrCode = ERROR_INVALID_HANDLE;
@ -1114,7 +1110,7 @@ bool WINAPI SFileOpenPatchArchive(
// 2) Modify or replace a file // 2) Modify or replace a file
// 3) Add patch archive to the opened MPQ // 3) Add patch archive to the opened MPQ
// 4) Read patched file // 4) Read patched file
// 5) Now what ? // 5) Now what?
// //
if(dwErrCode == ERROR_SUCCESS) if(dwErrCode == ERROR_SUCCESS)
@ -1126,7 +1122,11 @@ bool WINAPI SFileOpenPatchArchive(
// Open the archive like it is normal archive // Open the archive like it is normal archive
if(dwErrCode == ERROR_SUCCESS) if(dwErrCode == ERROR_SUCCESS)
{ {
if(SFileOpenArchive(szPatchMpqName, 0, MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH | dwFlags, &hPatchMpq)) // These flags will be propagated to SFileOpenArchive
dwFlags = (dwFlags & MPQ_OPEN_NO_LISTFILE) | MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH;
// Open the patch as MPQ
if(SFileOpenArchive(szPatchMpqName, 0, dwFlags, &hPatchMpq))
{ {
// Cast the archive handle to structure pointer // Cast the archive handle to structure pointer
haPatch = (TMPQArchive *)hPatchMpq; haPatch = (TMPQArchive *)hPatchMpq;