diff options
author | Roy Tam <roytam@gmail.com> | 2010-02-04 10:30:30 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-23 14:07:58 -0600 |
commit | ea299062eb66dba86b390b7e0f414f6a4e41f11f (patch) | |
tree | 185f3641de86ea3fa2d701ad52973515e8b1c012 /json-parser.c | |
parent | e03dd1a6c24d96d6ba4b154f2266c44c314c6688 (diff) | |
download | qemu-ea299062eb66dba86b390b7e0f414f6a4e41f11f.tar.gz |
json: fix PRId64 on Win32
OK we are fooled by the json lexer and parser. As we use %I64d to
print 'long long' variables in Win32, but lexer and parser only deal
with %lld but not %I64d, this patch add support for %I64d and solve
'info pci', 'powser_reset' and 'power_powerdown' assert failure in
Win32.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2c0d4b36e7fe28c569c5436f7724735e35d3c493)
Diffstat (limited to 'json-parser.c')
-rw-r--r-- | json-parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/json-parser.c b/json-parser.c index 7624c0f9bd..2ab6f6c11b 100644 --- a/json-parser.c +++ b/json-parser.c @@ -476,7 +476,8 @@ static QObject *parse_escape(JSONParserContext *ctxt, QList **tokens, va_list *a obj = QOBJECT(qint_from_int(va_arg(*ap, int))); } else if (token_is_escape(token, "%ld")) { obj = QOBJECT(qint_from_int(va_arg(*ap, long))); - } else if (token_is_escape(token, "%lld")) { + } else if (token_is_escape(token, "%lld") || + token_is_escape(token, "%I64d")) { obj = QOBJECT(qint_from_int(va_arg(*ap, long long))); } else if (token_is_escape(token, "%s")) { obj = QOBJECT(qstring_from_str(va_arg(*ap, const char *))); |