Make GCC happy

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7311 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-09-01 18:58:53 +00:00
parent 3a3d2202a7
commit 488ecccde5
7 changed files with 24 additions and 14 deletions

View file

@ -423,8 +423,9 @@ typedef struct tagMINI_IMAGE_VXD_HEADER {
static bool GetDLLVersionFromVXD(const TCHAR *filepath, DWORD &high, DWORD &low, bool Product)
{
bool found = false;
UINT fieldofs = Product ? 2 : 0;
FILEVIEW map;
char *filedata = create_file_view_readonly(filepath, map), fieldofs = Product ? 2 : 0;
char *filedata = create_file_view_readonly(filepath, map);
if (filedata)
{
PIMAGE_DOS_HEADER pDosHdr = (PIMAGE_DOS_HEADER) filedata;

View file

@ -194,7 +194,7 @@ static TCHAR* ParseResProtocolAlloc(const TCHAR*Url, const TCHAR*&Type, const TC
for (pD = buf, pS = pD;; ++pS, ++pD) {
if ((ch = *pS) == '%') { // Deal with percent-encoding
if (*++pS != '%') {
TCHAR hex[3] = { pS[0], pS[0] ? pS[1] : '\0', '\0' };
TCHAR hex[3] = { pS[0], pS[0] ? pS[1] : _T('\0'), _T('\0') };
ch = ChIsHex(pS[0]) && ChIsHex(pS[1]) ? (TCHAR) _tcstol(hex, 0, 16) : 0;
if (ch) ++pS; else ++bad;
}
@ -920,7 +920,7 @@ BYTE* CResourceEditor::ExtractIcoCurW(const WINWCHAR* szType, WINWCHAR* szName,
return 0;
CResourceDataEntry*pRDE = pLangDir->GetDataEntry();
BYTE*pSH = pRDE->GetData(), cbRGE = 14, cbFGE = 16, *pResData;
DWORD succ = false, i, cbRes, failed = false;
DWORD i, cbRes, failed = false;
if (pRDE->GetSize() < 6) // Must at least have a ICO file header
return 0;
WORD imgResType, count, *pFirstRGE = (WORD*) GetFirstICOCURGroupEntry(pSH, &imgResType, &count), *pRGE;

View file

@ -68,7 +68,7 @@ static char* CreateMappedFileView(LPCTSTR Path, DWORD FAccess, DWORD FShare, DWO
HANDLE hFile = CreateFile(Path, FAccess, FShare, NULL, FMode, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE) return pView;
ULARGE_INTEGER fs;
validSize = GetFileSize64(hFile, fs) && sizeof(size_t) >= 8 || !fs.HighPart;
validSize = GetFileSize64(hFile, fs) && (sizeof(size_t) >= 8 || !fs.HighPart);
FSize = sizeof(size_t) >= 8 ? (size_t) fs.QuadPart : fs.LowPart;
HANDLE hMap = validSize ? CreateFileMapping(hFile, NULL, PProtect, 0, 0, NULL) : INVALID_HANDLE_VALUE;
if (hMap != INVALID_HANDLE_VALUE)