From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8odW-0006on-U8 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 08:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8odT-0005TK-J6 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 08:55:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8odT-0005TG-DD for qemu-devel@nongnu.org; Fri, 03 Jun 2016 08:55:35 -0400 References: <1463632874-28559-1-git-send-email-eblake@redhat.com> <1463632874-28559-26-git-send-email-eblake@redhat.com> <87shwu66zk.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <57517E46.3090104@redhat.com> Date: Fri, 3 Jun 2016 06:55:34 -0600 MIME-Version: 1.0 In-Reply-To: <87shwu66zk.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EAffkgX7mklWl7OmhTSnnELtolNRuFtMv" Subject: Re: [Qemu-devel] [PATCH v4 25/28] qapi: Support pretty printing in JSON output visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EAffkgX7mklWl7OmhTSnnELtolNRuFtMv Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/03/2016 01:56 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Similar to pretty printing in the QObject visitor. The trickiest >> part is probably that the testsuite now has to honor parameterization >> on whether pretty printing is enabled. >=20 > Worth mentioning that the pretty-printing matches the one in > qobject-json.c? Yes, particularly since we later rely on that fact to rewrite qobject-json.c on top of the JSON visitor :) >> static void visitor_output_setup(TestOutputVisitorData *data, >> - const void *unused) >> + const void *arg) >> { >> - data->ov =3D json_output_visitor_new(&data->str); >> + const bool *pretty =3D arg; >=20 > Could do bool pretty =3D *(bool *)arg. Matter of taste. Same elsewher= e. Requires a cast. I like avoiding casts where C lets us do so. But I also agree that *pretty looks ugly, so maybe: =2E..(const void *arg) { const bool *data; bool pretty =3D *data; --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EAffkgX7mklWl7OmhTSnnELtolNRuFtMv 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/ iQEcBAEBCAAGBQJXUX5GAAoJEKeha0olJ0Nq6j4H/2AX1PO3dK+tb1y53H3nfB8j g5wOUMbT+Qzh+E5gfgdu79FGXSAIkFu8GSsV2Q8JyO9b54XSv2PlxR0BsW8KJKt5 Wp2L2M2THhGLhS0UrvkJQ3fZCfuZwK/Vrz+q5NfRB6BmZ7OADLJbXnC8sJcL+/cZ clGclWGH0mMuUXo1YBf9qwkTZOMVKtfPEzKHTogNEFpD9X3o8cI+ocC94IeHJnWU qWU0RwI2M58jOV0yz48vASZR9Bi32LQL1fFu24l8VE0w1mn7l6UMY6vMISaWXL1d nXoM/kGzdC3iT6UJw/V4E6ns2UbDeWqmgKPRVgpLmMuwNSdlqtN/AA+tbXD+t2g= =Q06p -----END PGP SIGNATURE----- --EAffkgX7mklWl7OmhTSnnELtolNRuFtMv--