From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yhrn2-0000Ci-BD for qemu-devel@nongnu.org; Mon, 13 Apr 2015 23:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yhrmy-0003gI-Qy for qemu-devel@nongnu.org; Mon, 13 Apr 2015 23:45:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yhrmy-0003fk-IU for qemu-devel@nongnu.org; Mon, 13 Apr 2015 23:45:28 -0400 Message-ID: <552C8D2B.20603@redhat.com> Date: Mon, 13 Apr 2015 21:44:43 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427995743-7865-1-git-send-email-armbru@redhat.com> <1427995743-7865-18-git-send-email-armbru@redhat.com> In-Reply-To: <1427995743-7865-18-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bVIG0tKKatmsaVPLU6VB0SbqV1XOUHwn1" Subject: Re: [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bVIG0tKKatmsaVPLU6VB0SbqV1XOUHwn1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/02/2015 11:29 AM, Markus Armbruster wrote: > I'm going to fix the JSON parser to recognize null. The obvious > representation of JSON null as (QObject *)NULL doesn't work, because > the parser already uses it as an error value. Perhaps we should > change it to free NULL for null, but that's more than I can do right > now. Create a special null QObject instead. >=20 > Signed-off-by: Markus Armbruster > --- > include/qapi/qmp/qobject.h | 9 +++++++++ > qobject/Makefile.objs | 2 +- > qobject/qjson.c | 3 +++ > qobject/qnull.c | 29 +++++++++++++++++++++++++++++ > 4 files changed, 42 insertions(+), 1 deletion(-) > create mode 100644 qobject/qnull.c >=20 > +static const QType qnull_type =3D { > + .code =3D QTYPE_QINT, s/QINT/QNULL/ > + .destroy =3D qnull_destroy_obj, > +}; > + > +QObject qnull_ =3D { > + .type =3D &qnull_type, > + .refcnt =3D 1 > +}; Worth a trailing comma in the initializer? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --bVIG0tKKatmsaVPLU6VB0SbqV1XOUHwn1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVLI0rAAoJEKeha0olJ0Nq0VAIAJrsMrnMeChTimZiUikd1pVz iOjn73FB9G/WOlSqyoR6eNWTGxgwhO9ypNW6PjwTaN8Zq5XiJPsA+lOCijc+MDVr ujsoKy1JF0qHoKrY6iqseeqOni+wCOhC18Xoz+8Bg+69oPF45/f6vqde5uC196XC kNDjAGBe37MEBOPuP8U1+ZUoJGG8nS/haUOOZLILPZpz91DTehFyktSVhwCD3S8e QoLOX93YghElnuYKHTUbX//IlgpemAGL0oSOoKHdUnHT+aYd48v1tQwjPCjmQK/4 0YZML8rMnJ22oiuAw44t7ZLHGDNhATAZhYprrQS9QFHkW66K1nhX3euAQYvzI0Y= =Ej14 -----END PGP SIGNATURE----- --bVIG0tKKatmsaVPLU6VB0SbqV1XOUHwn1--