X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fengine%2Fe_fixedbuffer.pas;h=c59302102436e38a1ad715ec74df08c7e908d315;hb=7292fe409145dfcbb2776e34bb64d56e32985b9d;hp=d0248a151de9734a73c6eddfe1e08b7dd5e5cc63;hpb=bd49d7f62886832d9d3b4bf0169269315fe7262f;p=d2df-sdl.git diff --git a/src/engine/e_fixedbuffer.pas b/src/engine/e_fixedbuffer.pas index d0248a1..c593021 100644 --- a/src/engine/e_fixedbuffer.pas +++ b/src/engine/e_fixedbuffer.pas @@ -1,4 +1,19 @@ -{$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 . + *) +{$INCLUDE e_amodes.inc} unit e_fixedbuffer; interface @@ -95,7 +110,7 @@ begin 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; @@ -104,7 +119,7 @@ procedure e_Buffer_Read_Generic(B: pTBuffer; var V; N: Cardinal); 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; @@ -164,7 +179,7 @@ begin 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; @@ -226,7 +241,7 @@ begin 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; @@ -241,7 +256,7 @@ 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; @@ -286,7 +301,7 @@ begin 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;