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;
bool bResult = false;
// Keep compiler happy
dwStreamFlags = dwStreamFlags;
// Keep compilers happy
STORMLIB_UNUSED(dwStreamFlags);
// 1) Try to treat "szFileName" as a section name
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;
DWORD dwTemp = 0;
// Keep compiler happy
dwStreamFlags = dwStreamFlags;
// Keep compilers happy
STORMLIB_UNUSED(dwStreamFlags);
// Don't connect to the internet
if(!InternetGetConnectedState(&dwTemp, 0))
@ -2245,9 +2245,9 @@ static bool Block4Stream_BlockRead(
assert(StartOffset < EndOffset);
assert(bAvailable == true);
// Keep compiler happy
bAvailable = bAvailable;
EndOffset = EndOffset;
// Keep compilers happy
STORMLIB_UNUSED(bAvailable);
STORMLIB_UNUSED(EndOffset);
while(BytesNeeded != 0)
{

View File

@ -107,8 +107,8 @@ void TMPQBits::GetBits(
unsigned int nBitOffset = (nBitPosition & 0x07);
unsigned char BitBuffer;
// Keep compiler happy for platforms where nResultByteSize is not used
nResultByteSize = nResultByteSize;
// Keep compilers happy for platforms where nResultByteSize is not used
STORMLIB_UNUSED(nResultByteSize);
#ifdef _DEBUG
// Check if the target is properly zeroed
@ -172,8 +172,8 @@ void TMPQBits::SetBits(
unsigned short AndMask = 0;
unsigned short OneByte = 0;
// Keep compiler happy for platforms where nResultByteSize is not used
nResultByteSize = nResultByteSize;
// Keep compilers happy for platforms where nResultByteSize is not used
STORMLIB_UNUSED(nResultByteSize);
#ifndef STORMLIB_LITTLE_ENDIAN
// 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;
DWORD dwErrCode = ERROR_SUCCESS;
// Keep compiler happy
dwSearchScope = dwSearchScope;
// Keep compilers happy
STORMLIB_UNUSED(dwSearchScope);
// Check the parameters
if(ha == NULL)

View File

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

View File

@ -1081,7 +1081,6 @@ void Patch_Finalize(TMPQPatcher * pPatcher)
}
}
//-----------------------------------------------------------------------------
// Public functions
@ -1096,9 +1095,6 @@ bool WINAPI SFileOpenPatchArchive(
HANDLE hPatchMpq = NULL;
DWORD dwErrCode = ERROR_SUCCESS;
// Keep compiler happy
dwFlags = dwFlags;
// Verify input parameters
if(!IsValidMpqHandle(hMpq))
dwErrCode = ERROR_INVALID_HANDLE;
@ -1114,7 +1110,7 @@ bool WINAPI SFileOpenPatchArchive(
// 2) Modify or replace a file
// 3) Add patch archive to the opened MPQ
// 4) Read patched file
// 5) Now what ?
// 5) Now what?
//
if(dwErrCode == ERROR_SUCCESS)
@ -1126,7 +1122,11 @@ bool WINAPI SFileOpenPatchArchive(
// Open the archive like it is normal archive
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
haPatch = (TMPQArchive *)hPatchMpq;