altos: Switch ao_rssi.c __xdata to __pdata
[fw/altos] / contrib / arch-linux / nsis-2.43-64bit-fixes.patch
1 diff -ur nsis-2.43-src/SCons/Config/gnu nsis-2.43-src-64bit-fixes/SCons/Config/gnu
2 --- nsis-2.43-src/SCons/Config/gnu      2009-02-05 01:52:28.000000000 +0100
3 +++ nsis-2.43-src-64bit-fixes/SCons/Config/gnu  2009-02-25 07:59:44.000000000 +0100
4 @@ -95,8 +95,6 @@
5  makensis_env.Append(CXXFLAGS = ['-Wall'])                 # all warnings
6  
7  conf = FlagsConfigure(makensis_env)
8 -conf.CheckCompileFlag('-m32')                     #
9 -conf.CheckLinkFlag('-m32')                        #
10  conf.CheckLinkFlag('$MAP_FLAG')                   # generate map file
11  if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
12         TestStrip(conf)                                 # strip
13 @@ -149,8 +147,6 @@
14  ### cross-platform util environment adjustments
15  
16  conf = FlagsConfigure(cp_util_env)
17 -conf.CheckCompileFlag('-m32')
18 -conf.CheckLinkFlag('-m32')
19  if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
20         TestStrip(conf)                                 # strip
21  conf.Finish()
22 @@ -160,8 +156,6 @@
23  test_env = defenv.Clone()
24  test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
25  conf = FlagsConfigure(test_env)
26 -conf.CheckCompileFlag('-m32')
27 -conf.CheckLinkFlag('-m32')
28  conf.Finish()
29  
30  ### weird GCC requirements
31 diff -ur nsis-2.43-src/Source/DialogTemplate.cpp nsis-2.43-src-64bit-fixes/Source/DialogTemplate.cpp
32 --- nsis-2.43-src/Source/DialogTemplate.cpp     2007-11-30 10:54:13.000000000 +0100
33 +++ nsis-2.43-src-64bit-fixes/Source/DialogTemplate.cpp 2009-02-25 07:59:44.000000000 +0100
34 @@ -74,7 +74,7 @@
35      if (IS_INTRESOURCE(x)) { \
36        *(WORD*)seeker = 0xFFFF; \
37        seeker += sizeof(WORD); \
38 -      *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \
39 +      *(WORD*)seeker = ConvertEndianness(WORD(long(x))); \
40        seeker += sizeof(WORD); \
41      } \
42      else { \
43 @@ -622,7 +622,7 @@
44      }
45    }
46  
47 -  assert((DWORD) seeker - (DWORD) pbDlg == dwSize);
48 +  assert((long) seeker - (long) pbDlg == dwSize);
49  
50    // DONE!
51    return pbDlg;
52 diff -ur nsis-2.43-src/Source/mmap.cpp nsis-2.43-src-64bit-fixes/Source/mmap.cpp
53 --- nsis-2.43-src/Source/mmap.cpp       2009-02-01 15:44:30.000000000 +0100
54 +++ nsis-2.43-src-64bit-fixes/Source/mmap.cpp   2009-02-25 07:59:44.000000000 +0100
55 @@ -322,7 +322,7 @@
56    if (!pView)
57      return;
58  
59 -  unsigned int alignment = ((unsigned int)pView) % m_iAllocationGranularity;
60 +  unsigned int alignment = ((unsigned long)pView) % m_iAllocationGranularity;
61    pView = (char *)pView - alignment;
62    size += alignment;
63  #ifdef _WIN32
64 diff -ur nsis-2.43-src/Source/Platform.h nsis-2.43-src-64bit-fixes/Source/Platform.h
65 --- nsis-2.43-src/Source/Platform.h     2009-02-01 15:44:30.000000000 +0100
66 +++ nsis-2.43-src-64bit-fixes/Source/Platform.h 2009-02-25 07:59:44.000000000 +0100
67 @@ -166,7 +166,7 @@
68  #    define MAKEINTRESOURCE MAKEINTRESOURCEA
69  #  endif
70  #  ifndef IMAGE_FIRST_SECTION
71 -#    define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \
72 +#    define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (long) h + \
73                                       FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \
74                                       FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) )
75  #  endif
76 @@ -198,7 +198,7 @@
77  #endif
78  
79  #ifndef ULONG_PTR
80 -#  define ULONG_PTR DWORD
81 +#  define ULONG_PTR ULONG
82  #endif
83  
84  #ifndef IDC_HAND
85 @@ -703,7 +703,7 @@
86    WORD e_oemid;
87    WORD e_oeminfo;
88    WORD e_res2[10];
89 -  LONG e_lfanew;
90 +  DWORD e_lfanew;
91  } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
92  #  pragma pack()
93  #  pragma pack(4)
94 diff -ur nsis-2.43-src/Source/Plugins.cpp nsis-2.43-src-64bit-fixes/Source/Plugins.cpp
95 --- nsis-2.43-src/Source/Plugins.cpp    2009-02-01 15:44:30.000000000 +0100
96 +++ nsis-2.43-src-64bit-fixes/Source/Plugins.cpp        2009-02-25 07:59:44.000000000 +0100
97 @@ -136,7 +136,7 @@
98          DWORD prd = FIX_ENDIAN_INT32(sections[i].PointerToRawData);
99          PIMAGE_EXPORT_DIRECTORY exports = PIMAGE_EXPORT_DIRECTORY(&dlldata[0] + prd + ExportDirVA - va);
100          DWORD na = FIX_ENDIAN_INT32(exports->AddressOfNames);
101 -        unsigned long *names = (unsigned long*)((unsigned long) exports + (char *) na - ExportDirVA);
102 +        unsigned int *names = (unsigned int*)((unsigned long) exports + (char *) na - ExportDirVA);
103          for (unsigned long j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++)
104          {
105            const string name = string((char*)exports + FIX_ENDIAN_INT32(names[j]) - ExportDirVA);
106 diff -ur nsis-2.43-src/Source/ResourceEditor.cpp nsis-2.43-src-64bit-fixes/Source/ResourceEditor.cpp
107 --- nsis-2.43-src/Source/ResourceEditor.cpp     2009-02-05 01:50:12.000000000 +0100
108 +++ nsis-2.43-src-64bit-fixes/Source/ResourceEditor.cpp 2009-02-25 07:59:44.000000000 +0100
109 @@ -684,7 +684,7 @@
110      rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries);
111  
112      CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY));
113 -    crd->m_dwWrittenAt = DWORD(seeker);
114 +    crd->m_dwWrittenAt = long(seeker);
115      seeker += sizeof(IMAGE_RESOURCE_DIRECTORY);
116  
117      for (int i = 0; i < crd->CountEntries(); i++) {
118 @@ -705,7 +705,7 @@
119        rDirE.UName.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0;
120  
121        CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY));
122 -      crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker);
123 +      crd->GetEntry(i)->m_dwWrittenAt = long(seeker);
124        seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY);
125      }
126      qDirs.pop();
127 @@ -721,7 +721,7 @@
128      rDataE.Size = ConvertEndianness(cRDataE->GetSize());
129  
130      CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY));
131 -    cRDataE->m_dwWrittenAt = DWORD(seeker);
132 +    cRDataE->m_dwWrittenAt = long(seeker);
133      seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY);
134  
135      qDataEntries.pop();
136 @@ -733,7 +733,7 @@
137    while (!qStrings.empty()) {
138      CResourceDirectoryEntry* cRDirE = qStrings.front();
139  
140 -    PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->UName.NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec));
141 +    PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->UName.NameString.NameOffset = ConvertEndianness(long(seeker) - long(pbRsrcSec));
142  
143      WCHAR* szName = cRDirE->GetName();
144      WORD iLen = winchar_strlen(szName) + 1;
145 @@ -764,7 +764,7 @@
146    /*
147     * Set all of the directory entries offsets.
148     */
149 -  SetOffsets(m_cResDir, DWORD(pbRsrcSec));
150 +  SetOffsets(m_cResDir, long(pbRsrcSec));
151  }
152  
153  // Sets the offsets in directory entries
154 @@ -887,7 +887,7 @@
155  // Returns -1 if can not be found
156  int CResourceDirectory::Find(WCHAR* szName) {
157    if (IS_INTRESOURCE(szName))
158 -    return Find((WORD) (DWORD) szName);
159 +    return Find((WORD) (long) szName);
160    else
161      if (szName[0] == '#')
162        return Find(WORD(winchar_stoi(szName + 1)));
163 @@ -965,7 +965,7 @@
164    if (IS_INTRESOURCE(szName)) {
165      m_bHasName = false;
166      m_szName = 0;
167 -    m_wId = (WORD) (DWORD) szName;
168 +    m_wId = (WORD) (long) szName;
169    }
170    else {
171      m_bHasName = true;
172 @@ -979,7 +979,7 @@
173    if (IS_INTRESOURCE(szName)) {
174      m_bHasName = false;
175      m_szName = 0;
176 -    m_wId = (WORD) (DWORD) szName;
177 +    m_wId = (WORD) (long) szName;
178    }
179    else {
180      m_bHasName = true;
181 diff -ur nsis-2.43-src/Source/util.cpp nsis-2.43-src-64bit-fixes/Source/util.cpp
182 --- nsis-2.43-src/Source/util.cpp       2009-02-01 15:44:30.000000000 +0100
183 +++ nsis-2.43-src-64bit-fixes/Source/util.cpp   2009-02-25 07:59:44.000000000 +0100
184 @@ -77,9 +77,9 @@
185    }
186  
187    if (width != 0) {
188 -    LONG biWidth;
189 +    DWORD biWidth;
190      fseek(f, 18, SEEK_SET); // Seek to the width member of the header
191 -    fread(&biWidth, sizeof(LONG), 1, f);
192 +    fread(&biWidth, sizeof(DWORD), 1, f);
193      FIX_ENDIAN_INT32_INPLACE(biWidth);
194      if (width != biWidth) {
195        fclose(f);
196 @@ -88,12 +88,12 @@
197    }
198  
199    if (height != 0) {
200 -    LONG biHeight;
201 +    DWORD biHeight;
202      fseek(f, 22, SEEK_SET); // Seek to the height member of the header
203 -    fread(&biHeight, sizeof(LONG), 1, f);
204 +    fread(&biHeight, sizeof(DWORD), 1, f);
205      FIX_ENDIAN_INT32_INPLACE(biHeight);
206      // Bitmap height can be negative too...
207 -    if (height != abs(biHeight)) {
208 +    if (height != abs((long int)biHeight)) {
209        fclose(f);
210        return -3;
211      }