On Wed, Mar 2, 2011 at 12:33 PM, Jonas Maebe <jonas.ma...@elis.ugent.be>wrote:

>
> On 02 Mar 2011, at 09:02, Roland Turcan wrote:
>
>   ...
>>  p := PByteArray (PtrUInt (@FData.Content[0]) + MOffset);
>>  ...
>>
>>
>> But the compiler informs about %subj%.
>>
>> How to get rid of this warning and to make code portable?
>>
>
> Typecast to PByte instead of to PtrUInt.
>
>

If Roland wants to keep compatibility with Delphi for some reasons, I
suggest using something like

{$ifdef fpc}
  AddrInt = PByte;
{$else}
  AddrInt = integer;
{$endif}

if this approach is used the line
  PByteArray (AddrInt(@FData.Content[0]) + MOffset)
should not lead to any question both from fpc and Delphi

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

Reply via email to