[fpc-devel]Range check error?!

Peter Vreman pfv at cooldown.demon.nl
Sat Jan 27 12:53:00 CET 2001


> I have some problems with a little CRC-calculation routine I ported from some C code.
> The FPC version gives a range check error, but I can't find the reason for this...
> Here's the source:
> 
> function build_edc (var inout : array of byte; from, upto : integer) : longint;
> 
> var i : integer;
> 
> begin
>   build_edc:= 0;
>   for i:= from to upto-1 do
>     build_edc:= EDC_crctable[(build_edc xor inout[i]) and $FF] xor (build_edc shr 8);
> end;
> 
> FYI: EDC_crctable[] is an array with longint values
> 
> Could somebody please help me?
> Many thanks in advance!

crcs are cardinal values (0-$ffffffff).







More information about the fpc-devel mailing list