qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 for-2.5 07/12] qjson: Inline token_is_escape(


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 for-2.5 07/12] qjson: Inline token_is_escape() and simplify
Date: Wed, 25 Nov 2015 15:14:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/25/2015 02:23 PM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  qobject/json-parser.c | 32 +++++++++++++++-----------------
>  1 file changed, 15 insertions(+), 17 deletions(-)
> 

> +    if (!strcmp(val, "%p")) {
>          obj = va_arg(*ap, QObject *);
> -    } else if (token_is_escape(token, "%i")) {
> +    } else if (!strcmp(val, "%i")) {
>          obj = QOBJECT(qbool_from_bool(va_arg(*ap, int)));
> -    } else if (token_is_escape(token, "%d")) {
> +    } else if (!strcmp(val, "%d")) {
>          obj = QOBJECT(qint_from_int(va_arg(*ap, int)));
> -    } else if (token_is_escape(token, "%ld")) {
> +    } else if (!strcmp(val, "%ld")) {

Not for this patch, but I'd love to kill our support for "%ld" - it has
behavior that differs between 32-bit and 64-bit platforms, and is
therefore useless for our goal of using fixed-width integer types.

>          obj = QOBJECT(qint_from_int(va_arg(*ap, long)));
> -    } else if (token_is_escape(token, "%lld") ||
> -               token_is_escape(token, "%I64d")) {
> +    } else if (!strcmp(val, "%lld") ||
> +               !strcmp(val, "%I64d")) {

Not for this patch, but I'd love to kill our support for "%I64d". Isn't
modern mingw friendlier to using POSIX escape sequences in printf()?
I'm assuming mingw is the only reason we have this hold-out?

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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