>> and parsing gets abit more messy...
>How ?
[...]
This is how it looks now, better than using va_arg() at each case imho...
void lame_set_int(lame_global_flags *gfp, lame_param_tag tag1, ...)
{
va_list ap;
int param; /* (varargs promotes integrals to int) */
va_start(ap, tag1);
while (tag1 != TAG_END)
{
param = va_arg(ap, int);
switch (tag1)
{
case LAMEtag1:
gfp->test1 = param;
break;
case LAMEtag2:
gfp->test2 = param;
break;
default:
break;
}
tag1 = va_arg(ap, lame_param_tag);
}
va_end(ap);
}
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... ;)
- CISC
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )
- Re: [MP3 ENCODER] TagItem issues... Robert Hegemann
- Re: [MP3 ENCODER] TagItem issues... Sigbj�rn Skj�ret
- Re: [MP3 ENCODER] TagItem issues... Frank Klemm
- Re: [MP3 ENCODER] TagItem issues... Mark Taylor
- Re: [MP3 ENCODER] TagItem issues... Robert Hegemann
- Re: [MP3 ENCODER] TagItem issues... Takehiro Tominaga
- Re: [MP3 ENCODER] TagItem issues... Sigbj�rn Skj�ret
- Re: [MP3 ENCODER] TagItem issues... David Balazic
- Re: [MP3 ENCODER] TagItem issues... Sigbj�rn Skj�ret
- Re: [MP3 ENCODER] TagItem issues... David Balazic
- Re: [MP3 ENCODER] TagItem issues... Sigbj�rn Skj�ret
- Re: [MP3 ENCODER] TagItem issues... David Balazic
- Re: [MP3 ENCODER] TagItem issues... Sigbj�rn Skj�ret
- [MP3 ENCODER] Please Vote: Interface types Frank Klemm
- Re: [MP3 ENCODER] Please Vote: Interface types Robert Hegemann
- Re: [MP3 ENCODER] Please Vote: Interface types Whatever
- Re: [MP3 ENCODER] TagItem issues... David Balazic
- Re: [MP3 ENCODER] TagItem issues... Frank Klemm
- Re: [MP3 ENCODER] TagItem issues... David Balazic
- Re: [MP3 ENCODER] TagItem issues... Frank Klemm
- Re: [MP3 ENCODER] TagItem issues... Mark Taylor
