[fpc-devel] patch minigzip

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Sep 8 10:44:11 CEST 2006


On 8 sep 2006, at 10:37, Daniƫl Mantione wrote:

>>> No, there is no reason why you want to use types like Pulong etc.
>>
>> One reason to do that is to keep code portable between different  
>> Pascal
>> compilers.
>
> C compilers.

I'm only talking Pascal compilers: this is a unit part of a package  
which is available for different Pascal compiler, so people using  
different Pascal compilers (apparently) use the unit and the types  
declared to it.

I'm not talking about the reason for the original C implementation,  
but the reason to include the unit in FPC (possibly without the  
special memory allocation functions, although those as well may be  
used by external code which then may have to be ifdef'ed for FPC).

> Speaking about paszlib portability, there are many endian issues  
> nobody
> has ever looked at:
>
>     {put_short(s, s.bi_buf);}
>     s.pending_buf^[s.pending] := byte(s.bi_buf and $ff);
>     inc(s.pending);
>     s.pending_buf^[s.pending] := byte(word(s.bi_buf) shr 8);;
>     inc(s.pending);

Not knowing what this is for, this may be right (maybe it's when  
compressing and the zipped data must always be stored little endian?)  
or wrong...

> Sure, I agree here. But the reason to kick zutil was not because there
> were declarations like "type arrayname = array[0..$ffffffff] of  
> byte", in
> fact, such types are still in the code. I consider such types perfect
> Pascal code.

The problem is that it breaks code which depends on zutil and the  
types declared in it.


Jonas


More information about the fpc-devel mailing list