Sigbjřrn Skjćret wrote:
> >/* in my man page va_start has only one argument (ap) ... */
> 
> Your man-page is wrong then I think, the second argument is so that va_arg()
> knows where to start (ie, it makes ap point to the next argument).

HP-UX 10.20 man varargs say that it has only one arg.
/usr/include/varargs.h on the same system has definitions
with both two or one argument. Which one is used is dependent 
on some preprocessor variables ( platform/CPU type , I guess ).

A linux libc5 system has a definition in include files with one arg too.

 
> >> I can still implement a way to have the tag also contain the type of the
> >> parameter, but since the general consensus seemed to be that this would be
> >> too complicated I went for this approach... ;)
> >But your existing tag "contain" the type , at least as much as they
> >would in my method.
> 
> What I meant was that I could device another way of passing the tags that
> would allow me to supply information of the parameters type (ptr/float/int),
> but this isn't too convenient at the calling end.
> 
> >#ifdef YOU
> >#define SOME_TAG some_int_value
> >#else
> >#define SOME_TAG some_int_value
> >#end
> 
> What was the purpose of this?

To demonstrate that your tags have the same as much type information
as mine :-)
 
> >Unless I use
> >SOME_TAG__WARNING_THIS_IS_FLOAT_AND_NOT_INT_OR_ANYTHING_ELSE,
> >but that is not the point , since it would work both with your and my
> >code.
> 
> The advantage of having 3 different functions is also that you at a later
> stage can change the type of the internal parameter, and still accept the
> old without having to add a duplicate tag (f.ex. if you change from int to
> float, then you can just add the tag to lame_set_float(), and add a cast in
> lame_set_int)...

Oh ,  code complexity for the sake of backward compatibility :-)


-- 
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to