On Mon, Nov 13, 2006 at 06:31:34PM +0100, Robert Millan wrote: > > Andreas, please take into account that when pasting patches into mail they're > likely to end screwed for this and other causes. It's better to send them as > a file attachment.
Grm. But, of course, that won't help if you forget to run dos2unix after applying, like I just did... =) Here's the good one. -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list.
diff -ur nsis-2.19.old/Source/DialogTemplate.cpp nsis-2.19/Source/DialogTemplate.cpp --- nsis-2.19.old/Source/DialogTemplate.cpp 2006-03-24 19:36:24.000000000 +0100 +++ nsis-2.19/Source/DialogTemplate.cpp 2006-11-13 18:39:07.000000000 +0100 @@ -93,7 +93,7 @@ if (IS_INTRESOURCE(x)) { \ *(WORD*)seeker = 0xFFFF; \ seeker += sizeof(WORD); \ - *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ + *(WORD*)seeker = ConvertEndianness(WORD(long(x))); \ seeker += sizeof(WORD); \ } \ else { \ @@ -629,7 +629,7 @@ } } - assert((DWORD) seeker - (DWORD) pbDlg == dwSize); + assert((long) seeker - (long) pbDlg == dwSize); // DONE! return pbDlg; diff -ur nsis-2.19.old/Source/Platform.h nsis-2.19/Source/Platform.h --- nsis-2.19.old/Source/Platform.h 2006-07-30 13:48:47.000000000 +0200 +++ nsis-2.19/Source/Platform.h 2006-11-13 18:39:07.000000000 +0100 @@ -135,7 +135,7 @@ # define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i))) # endif # ifndef IMAGE_FIRST_SECTION -# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ +# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (long) h + \ FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) # endif @@ -147,7 +147,7 @@ # endif #endif #ifndef IS_INTRESOURCE -# define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0) +# define IS_INTRESOURCE(_r) (((unsigned long)(_r) >> 16) == 0) #endif // functions diff -ur nsis-2.19.old/Source/ResourceEditor.cpp nsis-2.19/Source/ResourceEditor.cpp --- nsis-2.19.old/Source/ResourceEditor.cpp 2006-04-05 20:40:09.000000000 +0200 +++ nsis-2.19/Source/ResourceEditor.cpp 2006-11-13 18:39:07.000000000 +0100 @@ -545,7 +545,7 @@ rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); - crd->m_dwWrittenAt = DWORD(seeker); + crd->m_dwWrittenAt = long(seeker); seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); for (int i = 0; i < crd->CountEntries(); i++) { @@ -566,7 +566,7 @@ rDirE.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); - crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); + crd->GetEntry(i)->m_dwWrittenAt = long(seeker); seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); } qDirs.pop(); @@ -582,7 +582,7 @@ rDataE.Size = ConvertEndianness(cRDataE->GetSize()); CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); - cRDataE->m_dwWrittenAt = DWORD(seeker); + cRDataE->m_dwWrittenAt = long(seeker); seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); qDataEntries.pop(); @@ -594,7 +594,7 @@ while (!qStrings.empty()) { CResourceDirectoryEntry* cRDirE = qStrings.front(); - PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); + PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(long(seeker) - long(pbRsrcSec)); char* szName = cRDirE->GetName(); WORD iLen = strlen(szName) + 1; @@ -636,7 +636,7 @@ /* * Set all of the directory entries offsets. */ - SetOffsets(m_cResDir, DWORD(pbRsrcSec)); + SetOffsets(m_cResDir, long(pbRsrcSec)); } // Sets the offsets in directory entries @@ -758,7 +758,7 @@ // Returns -1 if can not be found int CResourceDirectory::Find(char* szName) { if (IS_INTRESOURCE(szName)) - return Find((WORD) (DWORD) szName); + return Find((WORD) (long) szName); else if (szName[0] == '#') return Find(WORD(atoi(szName + 1))); @@ -836,7 +836,7 @@ if (IS_INTRESOURCE(szName)) { m_bHasName = false; m_szName = 0; - m_wId = (WORD) (DWORD) szName; + m_wId = (WORD) (long) szName; } else { m_bHasName = true; @@ -851,7 +851,7 @@ if (IS_INTRESOURCE(szName)) { m_bHasName = false; m_szName = 0; - m_wId = (WORD) (DWORD) szName; + m_wId = (WORD) (long) szName; } else { m_bHasName = true; diff -ur nsis-2.19.old/Source/util.cpp nsis-2.19/Source/util.cpp --- nsis-2.19.old/Source/util.cpp 2006-07-30 12:29:23.000000000 +0200 +++ nsis-2.19/Source/util.cpp 2006-11-13 18:39:07.000000000 +0100 @@ -312,7 +312,7 @@ FIX_ENDIAN_INT32_INPLACE(rdEntry.OffsetToData); MY_ASSERT(!rdEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); - PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); + PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + long(rdRoot)); MY_ASSERT((size_t)rdIcons - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); @@ -325,7 +325,7 @@ FIX_ENDIAN_INT32_INPLACE(icoEntry.OffsetToData); MY_ASSERT(!icoEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); - PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); + PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + long(rdRoot)); MY_ASSERT((size_t)rd - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); @@ -334,7 +334,7 @@ MY_ASSERT(datEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); - PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + DWORD(rdRoot)); + PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + long(rdRoot)); MY_ASSERT((size_t)rde - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); @@ -355,10 +355,10 @@ } // Set offset - DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + DWORD(rdRoot) - dwResourceSectionVA - DWORD(exeHeader); + DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + long(rdRoot) - dwResourceSectionVA - long(exeHeader); *(LPDWORD) seeker = FIX_ENDIAN_INT32(dwOffset); - MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (DWORD)rdRoot - (DWORD)exeHeader, "invalid data offset - icon resource probably compressed"); + MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (long)rdRoot - (long)exeHeader, "invalid data offset - icon resource probably compressed"); } LPBYTE seeker = uninstIconData;