index d0248a151de9734a73c6eddfe1e08b7dd5e5cc63..c59302102436e38a1ad715ec74df08c7e908d315 100644 (file)
-{$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 e_amodes.inc}
unit e_fixedbuffer;
interface
if (B^.WritePos + N > B^.Len) then
B^.Len := B^.WritePos + N + 1;
- CopyMemory(Pointer(Cardinal(Addr(B^.Data)) + B^.WritePos),
+ CopyMemory(Pointer(NativeUInt(Addr(B^.Data)) + B^.WritePos),
@V, N);
B^.WritePos := B^.WritePos + N;
begin
if (B^.ReadPos + N >= BUF_SIZE) then Exit;
- CopyMemory(@V, Pointer(Cardinal(Addr(B^.Data)) + B^.ReadPos), N);
+ CopyMemory(@V, Pointer(NativeUInt(Addr(B^.Data)) + B^.ReadPos), N);
B^.ReadPos := B^.ReadPos + N;
end;
if (P > B^.Len) then B^.Len := P;
- CopyMemory(Pointer(Cardinal(Addr(B^.Data)) + B^.WritePos),
+ CopyMemory(Pointer(NativeUInt(Addr(B^.Data)) + B^.WritePos),
@V[1], Len);
B^.WritePos := P;
Len := B^.Len - B^.ReadPos;
SetLength(Result, Len);
- CopyMemory(@Result[1], Pointer(Cardinal(Addr(B^.Data)) + B^.ReadPos), Len);
+ CopyMemory(@Result[1], Pointer(NativeUInt(Addr(B^.Data)) + B^.ReadPos), Len);
B^.ReadPos := B^.ReadPos + Len;
end;
procedure e_Raw_Read_Generic(P: Pointer; var V; N: Cardinal);
begin
- CopyMemory(@V, Pointer(Cardinal(P) + RawPos), N);
+ CopyMemory(@V, Pointer(NativeUInt(P) + RawPos), N);
RawPos := RawPos + N;
end;
if Len = 0 then Exit;
SetLength(Result, Len);
- CopyMemory(@Result[1], Pointer(Cardinal(P) + RawPos), Len);
+ CopyMemory(@Result[1], Pointer(NativeUInt(P) + RawPos), Len);
RawPos := RawPos + Len;
end;