lzip-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lzip-bug] Restarting an lzip member at any time


From: Antonio Diaz Diaz
Subject: Re: [Lzip-bug] Restarting an lzip member at any time
Date: Fri, 11 Dec 2009 17:24:45 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Hello list,

Jacob Rief wrote:
BTW, is there any special reason why the encoder and decoder are
void*-pointers? I know, behind the scenes these pointers are casted
onto a C++ object, but from type safety considerations I would expect
a pointer onto some kind of type. Why don't you declare a zero sized
C-struct, say struct LZ_Decoder {}; and struct LZ_Encoder {}; and
rewrite the prototypes of the functions to expect a pointer onto these
dummy structs. This would make the code of the lzlib clients a lot
typesafer, so that mixing up a decoder with an encoder is detected
during compile time instead of runtime.

What do you think about this change? Should I use a typedef so that C programs can declare variables this way:
  LZ_Encoder * encoder;
instead of the standard C
  struct LZ_Encoder * encoder;
?


Regards,
Antonio.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]