From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZPXu-0000kP-So for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:04:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZPXq-0000ej-R7 for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:04:02 -0500 Received: from [199.232.76.173] (port=53901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZPXq-0000eN-Gr for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:03:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44973) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZPXp-0003Wq-T9 for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:03:58 -0500 Date: Mon, 25 Jan 2010 12:03:48 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] Re: [PATCH] win32: use PRId64 instead of %lld Message-ID: <20100125120348.461ce622@doriath> In-Reply-To: <20100125100905.GA9019@redhat.com> References: <1264368221-3040-1-git-send-email-hpoussin@reactos.org> <20100125100905.GA9019@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, Herve Poussineau , qemu-devel@nongnu.org On Mon, 25 Jan 2010 12:09:06 +0200 "Michael S. Tsirkin" 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.