[Lazarus] C Integer types
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Sun Jul 8 17:18:45 CEST 2012
Bernd schrieb:
> 2012/7/7 Marco van de Voort <marcov at stack.nl>:
>
>> seqence_crc:=pint64(data)^;
>> seqence_key:=pint64(@data[8])^;
>> compr_crc:=pint64(@data[16])^;
>> compr_len:=pint64(@data[24])^;
>
> How about defining something more pascalish first, a record type for example:
>
> {$modeswitch autoderef}
>
> type
> PDataHeader = ^TDataHeader;
> TDataHeader = record
> sequence_crc: QWord;
> sequence_key: QWord;
> compr_crc: QWord;
> compr_len: DWord;
> end;
IMO all these members should be pointers, of size 64 bit according to
the index increment (8 bytes?). Typecasts will be needed for 32 bit
pointers, as demonstrated in above code.
DoDi
More information about the Lazarus
mailing list