mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
json: Replace %I64d, %I64u by %PRId64, %PRIu64
Support for %I64d got added in commit 2c0d4b36e7
"json: fix PRId64 on
Win32". We had to hard-code I64d because we used the lexer's finite
state machine to check interpolations. No more, so clean this up.
Additional conversion specifications would be easy enough to implement
when needed.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-42-armbru@redhat.com>
This commit is contained in:
parent
f7617d45d4
commit
53a0d616fe
2 changed files with 16 additions and 4 deletions
|
@ -438,16 +438,18 @@ static QObject *parse_interpolation(JSONParserContext *ctxt, va_list *ap)
|
|||
return QOBJECT(qnum_from_int(va_arg(*ap, int)));
|
||||
} else if (!strcmp(token->str, "%ld")) {
|
||||
return QOBJECT(qnum_from_int(va_arg(*ap, long)));
|
||||
} else if (!strcmp(token->str, "%lld") ||
|
||||
!strcmp(token->str, "%I64d")) {
|
||||
} else if (!strcmp(token->str, "%lld")) {
|
||||
return QOBJECT(qnum_from_int(va_arg(*ap, long long)));
|
||||
} else if (!strcmp(token->str, "%" PRId64)) {
|
||||
return QOBJECT(qnum_from_int(va_arg(*ap, int64_t)));
|
||||
} else if (!strcmp(token->str, "%u")) {
|
||||
return QOBJECT(qnum_from_uint(va_arg(*ap, unsigned int)));
|
||||
} else if (!strcmp(token->str, "%lu")) {
|
||||
return QOBJECT(qnum_from_uint(va_arg(*ap, unsigned long)));
|
||||
} else if (!strcmp(token->str, "%llu") ||
|
||||
!strcmp(token->str, "%I64u")) {
|
||||
} else if (!strcmp(token->str, "%llu")) {
|
||||
return QOBJECT(qnum_from_uint(va_arg(*ap, unsigned long long)));
|
||||
} else if (!strcmp(token->str, "%" PRIu64)) {
|
||||
return QOBJECT(qnum_from_uint(va_arg(*ap, uint64_t)));
|
||||
} else if (!strcmp(token->str, "%s")) {
|
||||
return QOBJECT(qstring_from_str(va_arg(*ap, const char *)));
|
||||
} else if (!strcmp(token->str, "%f")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue