Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-13 Thread Markus Armbruster
Eric Blake writes: > On 06/13/2016 02:22 AM, Markus Armbruster wrote: > >>> I may still try to tackle fixing the QMP parser to accept NaN and >>> infinity on input (since it's hand-written, we at least have control >>> over that) >> >> Making json-lexer.c recognize infinities and NaNs in strtod(

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-13 Thread Eric Blake
On 06/13/2016 02:22 AM, Markus Armbruster wrote: >> I may still try to tackle fixing the QMP parser to accept NaN and >> infinity on input (since it's hand-written, we at least have control >> over that) > > Making json-lexer.c recognize infinities and NaNs in strtod() syntax > shouldn't be hard.

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-13 Thread Markus Armbruster
Eric Blake writes: > On 06/03/2016 03:02 AM, Markus Armbruster wrote: > Suggest: * Return 0 if the number is finite, as required by RFC 7159, else -1. The return value makes some sense only for symmetry with qstring_append_json_string(). Without that, I'd ask you t

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-09 Thread Eric Blake
On 06/03/2016 03:02 AM, Markus Armbruster wrote: >>> Suggest: >>> >>> * Return 0 if the number is finite, as required by RFC 7159, else -1. >>> >>> The return value makes some sense only for symmetry with >>> qstring_append_json_string(). Without that, I'd ask you to keep this >>> function simpl

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > On 06/02/2016 09:02 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Pull out a new qstring_append_json_number() helper, so that all >>> JSON output producers can use a consistent style for printing >>> floating point without duplicating code (since we are doing mo

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-02 Thread Markus Armbruster
Eric Blake writes: > Pull out a new qstring_append_json_number() helper, so that all > JSON output producers can use a consistent style for printing > floating point without duplicating code (since we are doing more > data massaging than a simple printf format can handle). (For > now, there is o

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-02 Thread Eric Blake
On 06/02/2016 09:02 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Pull out a new qstring_append_json_number() helper, so that all >> JSON output producers can use a consistent style for printing >> floating point without duplicating code (since we are doing more >> data massaging than a

[Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-05-18 Thread Eric Blake
Pull out a new qstring_append_json_number() helper, so that all JSON output producers can use a consistent style for printing floating point without duplicating code (since we are doing more data massaging than a simple printf format can handle). (For now, there is only one client, but later patch