From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeOGn-0007sM-J5 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 02:42:57 -0500 Received: from [199.232.76.173] (port=43266 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeOGm-0007ru-9r for qemu-devel@nongnu.org; Mon, 08 Feb 2010 02:42:56 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeOGh-0002oz-G0 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 02:42:56 -0500 Received: from mail-pz0-f176.google.com ([209.85.222.176]:37586) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeOGh-0002ol-5R for qemu-devel@nongnu.org; Mon, 08 Feb 2010 02:42:51 -0500 Received: by pzk6 with SMTP id 6so4759826pzk.18 for ; Sun, 07 Feb 2010 23:42:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Roy Tam Date: Mon, 8 Feb 2010 15:42:30 +0800 Message-ID: <473191351002072342k2c0eddd3jc4698539025debab@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] use "%lld" instead of "%I64d" for qobject_from_jsonf in monitor.c and migration.c Content-Type: text/plain; charset=ISO-8859-1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TeLeMan Cc: qemu-devel 2010/2/8 TeLeMan : > The json parser does not support "%I64d", so we have to use "%lld" > instead of "%I64d". > We use PRId64 with json in more places besides migration.c and monitor.c, adding %I64d support in json lexer/parser is a better choice IMO. > Signed-off-by: TeLeMan > --- > migration.c | 6 +++--- > monitor.c | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/migration.c b/migration.c > index f20315f..f44b857 100644 > --- a/migration.c > +++ b/migration.c > @@ -180,9 +180,9 @@ static void migrate_put_status(QDict *qdict, const > char *name, > { > QObject *obj; > > - obj = qobject_from_jsonf("{ 'transferred': %" PRId64 ", " > - "'remaining': %" PRId64 ", " > - "'total': %" PRId64 " }", trans, rem, total); > + obj = qobject_from_jsonf("{ 'transferred': %lld, " > + "'remaining': %lld, " > + "'total': %lld }", trans, rem, total); > assert(obj != NULL); > > qdict_put_obj(qdict, name, obj); > diff --git a/monitor.c b/monitor.c > index a86454b..1738d2a 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -342,8 +342,8 @@ static void timestamp_put(QDict *qdict) > if (err < 0) > return; > > - obj = qobject_from_jsonf("{ 'seconds': %" PRId64 ", " > - "'microseconds': %" PRId64 " }", > + obj = qobject_from_jsonf("{ 'seconds': %lld, " > + "'microseconds': %lld }", > (int64_t) tv.tv_sec, (int64_t) tv.tv_usec); > assert(obj != NULL); > > -- > 1.6.5.1.1367.gcd48 > > -- > SUN OF A BEACH > > >