[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers |
Date: |
Tue, 30 May 2017 09:22:22 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 05/30/2017 06:35 AM, Marc-André Lureau wrote:
> Hi
>
> On Mon, May 15, 2017 at 6:00 PM Markus Armbruster <address@hidden> wrote:
>
>> Marc-André Lureau <address@hidden> writes:
>>
>>> Switch strtoll() usage to qemu_strtoi64() helper while at it.
>>>
>>> Replace temporarily the error in qnum_get_int() with values >INT64_MAX
>>> until the visitor is updated.
>>>
>>> Add a few tests for large numbers.
>>>
>>> Signed-off-by: Marc-André Lureau <address@hidden>
>>> ---
>>> qobject/json-lexer.c | 4 ++++
>>> qobject/json-parser.c | 30 ++++++++++++++++++++++--------
>>> qobject/qnum.c | 4 ++--
>>> tests/check-qjson.c | 28 ++++++++++++++++++++++++++++
>>> tests/check-qnum.c | 9 +++++----
>>> tests/test-qobject-input-visitor.c | 7 ++-----
>>> 6 files changed, 63 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
>>> index af4a75e05b..a0beb0b106 100644
>>> --- a/qobject/json-lexer.c
>>> +++ b/qobject/json-lexer.c
>>> @@ -227,15 +227,18 @@ static const uint8_t json_lexer[][256] = {
>>> /* escape */
>>> [IN_ESCAPE_LL] = {
>>> ['d'] = JSON_ESCAPE,
>>> + ['u'] = JSON_ESCAPE,
Do we really want to add MORE escape sequences to our pseudo-JSON escape
parser? I had a series a while back that was able to completely kill the
pseudo-JSON escapes, in favor of teaching the testsuite how to directly
handle %s (which is really the most useful of the escapes - we really
aren't using many others).
If there's interest in removing the JSON parser escape sequences, I can
revive my series.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum, (continued)
[Qemu-devel] [PATCH 05/17] qapi: remove promote_int, Marc-André Lureau, 2017/05/09
[Qemu-devel] [PATCH 06/17] qnum: add uint type, Marc-André Lureau, 2017/05/09
[Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers, Marc-André Lureau, 2017/05/09
[Qemu-devel] [PATCH 08/17] qapi: update the qobject visitor to use QUInt, Marc-André Lureau, 2017/05/09
[Qemu-devel] [PATCH 09/17] qnum: fix get_int() with values > INT64_MAX, Marc-André Lureau, 2017/05/09