[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld |
Date: |
Mon, 25 Jan 2010 12:03:48 -0200 |
On Mon, 25 Jan 2010 12:09:06 +0200
"Michael S. Tsirkin" <address@hidden> wrote:
> On Sun, Jan 24, 2010 at 09:23:41PM +0000, Herve Poussineau wrote:
> > Replace %lld occurrences by PRId64.
> > diff --git a/json-lexer.c b/json-lexer.c
> > index 53697c5..9d64920 100644
> > --- a/json-lexer.c
> > +++ b/json-lexer.c
> > @@ -54,6 +54,9 @@ enum json_lexer_state {
> > IN_ESCAPE,
> > IN_ESCAPE_L,
> > IN_ESCAPE_LL,
> > + IN_ESCAPE_I,
> > + IN_ESCAPE_I6,
> > + IN_ESCAPE_I64,
> > IN_ESCAPE_DONE,
> > IN_WHITESPACE,
> > IN_OPERATOR_DONE,
> > @@ -223,6 +226,18 @@ static const uint8_t json_lexer[][256] = {
> > ['l'] = IN_ESCAPE_LL,
> > },
> >
> > + [IN_ESCAPE_I64] = {
> > + ['d'] = IN_ESCAPE_DONE,
> > + },
> > +
> > + [IN_ESCAPE_I6] = {
> > + ['4'] = IN_ESCAPE_I64,
> > + },
> > +
> > + [IN_ESCAPE_I] = {
> > + ['6'] = IN_ESCAPE_I6,
> > + },
> > +
> > [IN_ESCAPE] = {
> > ['d'] = IN_ESCAPE_DONE,
> > ['i'] = IN_ESCAPE_DONE,
> > @@ -230,6 +245,7 @@ static const uint8_t json_lexer[][256] = {
> > ['s'] = IN_ESCAPE_DONE,
> > ['f'] = IN_ESCAPE_DONE,
> > ['l'] = IN_ESCAPE_L,
> > + ['I'] = IN_ESCAPE_I,
> > },
> >
> > /* top level rule */
>
>
> Why do we want yet another tag?
>
> OTOH, Luiz, maybe it is a mistake to use "long"
> in QMP: legal values might vary between platforms.
> How about we get rid of long and only use long long to mean 64
> bit/int to mean 32 bit? Or even redefine "l" to mean 64 bit and "i" to
> mean "32 bit.
Not that familiar with the parser (Anthony wrote it), but I guess
it will convert any int type (with the limit of int64_t) to
json int.
> Also, why do we allow "d" as synonym of "i"? Keeping all
> of int/long/long long around does not make sense to me though. Finally,
> don't we want unsigned values in protocol?
JSON doesn't support them.
- [Qemu-devel] [PATCH] win32: use PRId64 instead of %lld, Herve Poussineau, 2010/01/24
- [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Michael S. Tsirkin, 2010/01/25
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld,
Luiz Capitulino <=
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Markus Armbruster, 2010/01/25
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Luiz Capitulino, 2010/01/25
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Michael S. Tsirkin, 2010/01/25
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Luiz Capitulino, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Markus Armbruster, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Anthony Liguori, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Michael S. Tsirkin, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Anthony Liguori, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Michael S. Tsirkin, 2010/01/26
- Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld, Anthony Liguori, 2010/01/26