[PATCH 02/10] msvcrt: Use callback based printf in cprintf functions family

Alexandre Julliard julliard at winehq.org
Mon Apr 18 04:44:57 CDT 2011


Piotr Caban <piotr at codeweavers.com> writes:

> +printf_arg arg_clbk_valist(void *ctx, int arg_pos, size_t size, __ms_va_list *valist)
> +{
> +    printf_arg ret;
> +
> +    if(size == sizeof(LONGLONG))
> +        ret.get_longlong = va_arg(*valist, LONGLONG);
> +    else if(size == sizeof(int))
> +        ret.get_int = va_arg(*valist, int);
> +    else {
> +        ERR("Incorrect size\n");
> +        ret.get_int = 0;
> +    }

You can't do that, you need to use the correct type in va_arg. Different
types can be passed differently even if they have the same size.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list