From 2bdfe648f09957124dad256c59bf39876835de61 Mon Sep 17 00:00:00 2001 From: anders_k Date: Mon, 11 Feb 2019 20:32:42 +0000 Subject: [PATCH] Cast away MAKEINTRESOURCE wchar_t* vs WORD* issue we don't care about git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7082 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/Platform.h | 6 +++--- Source/ResourceEditor.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Platform.h b/Source/Platform.h index 9fb3529e..17e5a67b 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -226,13 +226,13 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; # define FIELD_OFFSET(t,f) ((UINT_PTR)&(((t*)0)->f)) # endif # ifndef MAKEINTRESOURCEA -# define MAKEINTRESOURCEA(i) ((LPSTR)((ULONG_PTR)((WORD)(i)))) +# define MAKEINTRESOURCEA(i) ((LPSTR)((ULONG_PTR)((WORD)(ULONG_PTR)(i)))) # endif # ifndef MAKEINTRESOURCEW -# define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i)))) +# define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(ULONG_PTR)(i)))) # endif # ifndef MAKEINTRESOURCE -# ifdef UNICODE +# ifdef _UNICODE # define MAKEINTRESOURCE MAKEINTRESOURCEW # else # define MAKEINTRESOURCE MAKEINTRESOURCEA diff --git a/Source/ResourceEditor.cpp b/Source/ResourceEditor.cpp index 4fa0b95a..ff5771d6 100644 --- a/Source/ResourceEditor.cpp +++ b/Source/ResourceEditor.cpp @@ -412,7 +412,7 @@ bool CResourceEditor::DeleteResourceT(const TCHAR* szType, WORD szName, LANGID w return UpdateResourceT(szType, szName, wLanguage, 0, 0, Manip); assert(!EditorSupportsStringNames() && sizeof(szName)); - const TCHAR*name = MAKEINTRESOURCE(szName); + const TCHAR *name = (const TCHAR*) MAKEINTRESOURCE(szName); unsigned int deleted = 0; for (;; ++deleted) { CResourceDirectoryEntry*pDir = FindResourceLanguageDirEntryT(szType, name, ANYLANGID); @@ -461,8 +461,9 @@ int CResourceEditor::GetResourceSizeT(const TCHAR* szType, WORD szName, LANGID w bool CResourceEditor::ResourceExistsT(const TCHAR* szType, WORD szName, LANGID wLanguage, LANGID*pFoundLanguage) { assert(!EditorSupportsStringNames() && sizeof(szName)); + const TCHAR *name = (const TCHAR*) MAKEINTRESOURCE(szName); if (wLanguage == ALLLANGID) wLanguage = ANYLANGID; - CResourceDirectoryEntry *pRDE = FindResourceLanguageDirEntryT(szType, MAKEINTRESOURCE(szName), wLanguage); + CResourceDirectoryEntry *pRDE = FindResourceLanguageDirEntryT(szType, name, wLanguage); if (pFoundLanguage) *pFoundLanguage = pRDE ? pRDE->GetId() : INVALIDLANGID; return pRDE != 0; }