From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz93c-0002dI-RJ for qemu-devel@nongnu.org; Wed, 18 Nov 2015 15:10:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz93Z-0006Rf-Kf for qemu-devel@nongnu.org; Wed, 18 Nov 2015 15:10:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz93Z-0006RN-Fp for qemu-devel@nongnu.org; Wed, 18 Nov 2015 15:10:17 -0500 References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-36-git-send-email-eblake@redhat.com> <87twoji1dy.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <564CDB27.3010801@redhat.com> Date: Wed, 18 Nov 2015 13:10:15 -0700 MIME-Version: 1.0 In-Reply-To: <87twoji1dy.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MqQOruo8rrcwRcVw0PHatcCaVhcCc6NlW" Subject: Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields 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) --MqQOruo8rrcwRcVw0PHatcCaVhcCc6NlW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/18/2015 11:54 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> None of the visitor callbacks would set an error when testing >> if an optional field was present; make this part of the interface >> contract by eliminating the errp argument. >> >> The resulting generated code has a nice diff: >> >> |- visit_optional(v, &has_fdset_id, "fdset-id", &err); >> |- if (err) { >> |- goto out; >> |- } >> |- if (has_fdset_id) { >> |+ visit_optional(v, &has_fdset_id, "fdset-id"); >> |+ if (has_fdset_id) { >> | visit_type_int(v, &fdset_id, "fdset-id", &err); >> | if (err) { >> | goto out; >> | } >> | } >=20 > I think this should be >=20 > |- visit_optional(v, &has_fdset_id, "fdset-id", &err); > |- if (err) { > |- goto out; > |- } > |+ visit_optional(v, &has_fdset_id, "fdset-id"); > | if (has_fdset_id) { Oh, yeah. Serves me right for hand-editing a diff in my commit message. (Patch applies either diff just fine, it's just that mine was longer than necessary). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MqQOruo8rrcwRcVw0PHatcCaVhcCc6NlW 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/ iQEcBAEBCAAGBQJWTNsoAAoJEKeha0olJ0Nq9OMH/RpF+Q4WCNzIVRfH82Fbtf68 +qFdhh4Kd5CwgabUPfX7rAgjlMchEcMWeuw0FQUzSlFtpg51asgzha35hAal9Rr1 GzclYqGH3D3cXGiFLY4brQ7TTMXL2CBSH+JoAeHZSUghyHLpiga2/qen9kjLGeb1 g9XJzX3UYAmjlDPIeH73+mFW5iNFP6Cz4+MGM2UZfemlzDohIe4d5tLWF1RYbqT7 iK7z84meoZFCz4cqKzFGPiFr2WYUa2W4rPgnElGXoquHYgBkvZyWogWd/gHo7bVR MuOrSM8zWU1SmP/YMwKhBDrktduyXOeO+l9Nxj6nuEkmD554rP0+5AP+2qXewj4= =7nkd -----END PGP SIGNATURE----- --MqQOruo8rrcwRcVw0PHatcCaVhcCc6NlW--