Piotr Caban <[email protected]> writes: > @@ -552,6 +552,74 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, > void *puts_ctx, const API > return written; > } > > +#ifndef PRINTF_WIDE > +/* This functions stores sizes of arguments. It uses args[0] > + * internally (in the following way): > + * 0x1 - using positional parameters > + * 0x2 - not using positional parameters > + * 0x4 - error occurred > + */ > +static printf_arg arg_clbk_size(void *ctx, int pos, int type, __ms_va_list > *valist) > +{ > + static const printf_arg ret; > + printf_arg *args = ctx; > + > + if(pos == -1) { > + args[0].get_int |= 1; > + return ret; > + } else > + args[0].get_int |= 2; > + > + if(pos<1 || pos>MSVCRT__ARGMAX || (args[pos].get_int && > args[pos].get_int!=type)) > + args[0].get_int |= 4; > + else > + args[pos].get_int = type; > + return ret; > +}
Using magic values like this is ugly, please add proper defines. Also you probably want to fix the name of the function and the comments. -- Alexandre Julliard [email protected]
