[fpc-pascal] How to solve "Conversion between ordinals and pointers is not portable"

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Nov 17 10:05:49 CET 2009


On 17 Nov 2009, at 10:02, Graeme Geldenhuys wrote:

> How to I solve this compiler hint?

Don't cast ordinals to pointers.

> ---------------------------------
> procedure XorBlock(var InData1, InData2; Size: longword);
> var
>  i: longword;
> begin
>  for i:= 1 to Size do
>    Pbyte(PtrUInt(@InData1)+i-1)^ :=
>       Pbyte(PtrUInt(@InData1)+i-1)^ xor
>       Pbyte(PtrUInt(@InData2)+i-1)^;
> end;

Replace the PtrUInt types casts with PByte (or Pointer) type casts.


Jonas



More information about the fpc-pascal mailing list