DEADSOFTWARE

Fix access violation on x86_64
[d2df-sdl.git] / src / sheditor / WADEDITOR_full.pas
index e9b2c3f5c36195deaeb2d764cf84943f6927e6c7..4c61f454d8c1c021d51f7a147959cbc666b22c70 100644 (file)
@@ -1,3 +1,18 @@
+(* Copyright (C)  DooM 2D:Forever Developers
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *)
 {$MODE DELPHI}
 unit WADEDITOR_full;
 
@@ -633,7 +648,7 @@ begin
   else
  begin
   TempData := GetMemory(FResTable[i].Length);
-  CopyMemory(TempData, Pointer(LongWord(FResData)+FResTable[i].Address+6+
+  CopyMemory(TempData, Pointer(NativeUInt(FResData)+FResTable[i].Address+6+
              LongWord(SizeOf(TWADHeaderRec_1)+SizeOf(TResourceTableRec_1)*Length(FResTable))),
              FResTable[i].Length);
   DecompressBuf(TempData, FResTable[i].Length, 0, pData, OutBytes);
@@ -795,19 +810,19 @@ begin
   Exit;
  end;
 
- CopyMemory(@FVersion, Pointer(LongWord(Data)+5), 1);
+ CopyMemory(@FVersion, Pointer(NativeUInt(Data)+5), 1);
  if FVersion <> DFWAD_VERSION then
  begin
    FLastError := DFWAD_ERROR_WRONGVERSION;
    Exit;
  end;
 
- CopyMemory(@FHeader, Pointer(LongWord(Data)+6), SizeOf(TWADHeaderRec_1));
+ CopyMemory(@FHeader, Pointer(NativeUInt(Data)+6), SizeOf(TWADHeaderRec_1));
 
  SetLength(FResTable, FHeader.RecordsCount);
  if FResTable <> nil then
  begin
-  CopyMemory(@FResTable[0], Pointer(LongWord(Data)+6+SizeOf(TWADHeaderRec_1)),
+  CopyMemory(@FResTable[0], Pointer(NativeUInt(Data)+6+SizeOf(TWADHeaderRec_1)),
              SizeOf(TResourceTableRec_1)*FHeader.RecordsCount);
 
   for a := 0 to High(FResTable) do