On 17 Nov 2009, at 10:17, Aleksa Todorovic wrote:

> On Tue, Nov 17, 2009 at 10:05, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote:
>> 
>> Replace the PtrUInt types casts with PByte (or Pointer) type casts.
>> 
> 
> Does that mean that (PByte(p) + N) = (Pointer(p) + N) for
> pointer-castable p and integer N?

Yes. The general rule is that adding an ordinal N to a pointer type P increases 
P by the size of the type this pointer points to times N. Sizeof(pbyte^) = 
sizeof(byte) = 1. 

Pointer is a special case since it's untyped (sizeof(pointer^) = 0 in the FPC), 
and adding an ordinal N to an untyped pointer also increases its value by N.


Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to