While porting the Delphi Kylix CLX library to fpc, I had errors related to Tbits class. Simply lifting the Delphi implementation into the code solved the problems.

A quick investigations shows that at least the Size property has a different meaning. While Delphi reports the actual number of allocated bits (i.e. 1-2-3 etc) FPC reports a fixed value of 31 for 1 to 32 bits allocated, and then 63, and so on:

{bits.inc}
function TBits.getSize : longint;
begin
   result := (FSize shl BITSHIFT) - 1;
end;

It seems to me that, besides not being Delphi compatible, this is also wrong, because the actual available space size is (FSize shl BITSHIFT) not decreased by one.

However FPC implementation makes inconsistent the values returned from OpenBit with those obtained reading Size.

Do I miss some point?

Giuliano

--
Giuliano Colla

Whenever people agree with me, I always feel I must be wrong (O. Wilde)
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to