index 50867f41ff60e4664e4c664a326b65977b3b9c99..1f53456f23d6a009e21d136c418c4aff19ab7555 100644 (file)
--- a/src/shared/BinEditor.pas
+++ b/src/shared/BinEditor.pas
-{$MODE DELPHI}
+(* 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/>.
+ *)
+{$INCLUDE a_modes.inc}
Unit BinEditor;
Interface
if (FPosition + varSize) > FSize then
ExtendMemory(varSize);
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@x, varSize);
FPosition := FPosition + varSize;
end;
ExtendMemory(SizeOf(Byte) + len);
// Äëèíà ñòðîêè:
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@len, SizeOf(Byte));
FPosition := FPosition + SizeOf(Byte);
// Ñòðîêà:
if len > 0 then
begin
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@x[1], len);
FPosition := FPosition + len;
end;
ExtendMemory(SizeOf(Cardinal) + memSize);
// Äëèíà áëîêà ïàìÿòè:
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
@memSize, SizeOf(Cardinal));
FPosition := FPosition + SizeOf(Cardinal);
// Áëîê ïàìÿòè:
if memSize > 0 then
begin
- CopyMemory(Pointer(Cardinal(FData) + FPosition),
+ CopyMemory(Pointer(NativeUInt(FData) + FPosition),
x, memSize);
FPosition := FPosition + memSize;
end;
if aLen > 0 then
begin
- FillMemory(Pointer(Cardinal(FData) + FPosition),
+ FillMemory(Pointer(NativeUInt(FData) + FPosition),
aLen, aFillSym);
FPosition := FPosition + aLen;
end;
if (FPosition + varSize) <= FSize then
begin
CopyMemory(@x,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
varSize);
FPosition := FPosition + varSize;
end
begin
// Äëèíà ñòðîêè:
CopyMemory(@len,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
SizeOf(Byte));
if (FPosition + SizeOf(Byte) + len) <= FSize then
if len > 0 then
begin
CopyMemory(@x[1],
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
len);
FPosition := FPosition + len;
end
begin
// Äëèíà áëîêà ïàìÿòè:
CopyMemory(@memSize,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
SizeOf(Cardinal));
if (FPosition + SizeOf(Cardinal) + memSize) <= FSize then
begin
GetMem(x, memSize);
CopyMemory(x,
- Pointer(Cardinal(FData) + FPosition),
+ Pointer(NativeUInt(FData) + FPosition),
memSize);
FPosition := FPosition + memSize;
end