[Lazarus] C Integer types

Bernd prof7bit at gmail.com
Sun Jul 8 12:32:21 CEST 2012


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;

var
  Data: PDataHeader;
  SeqCrc: QWord;
  SeqKey: QWord;
  ...

begin
  Data := WhereverThisComesFrom();
  SeqCrc := Data.sequence_crc;
  SeqKey := Data.sequence_key;
  ...




More information about the Lazarus mailing list