qemu-devel
[Top][All Lists]
Advanced

[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: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers
Date: Wed, 31 May 2017 07:38:09 +0000

Hi

On Tue, May 30, 2017 at 6:22 PM Eric Blake <address@hidden> wrote:

> 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.
>

I don't have a full picture of what we use it for, but if you can simplify
it, I am all for it.

In the meantime, I'll keep my change for testing and consistency. If your
patch goes first, I'll adapt it.

-- 
Marc-André Lureau


reply via email to

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