From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a754q-0000HP-8w for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:32:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a754m-0004Eu-10 for qemu-devel@nongnu.org; Thu, 10 Dec 2015 12:32:24 -0500 References: <1449546921-6378-1-git-send-email-eblake@redhat.com> <1449546921-6378-30-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <5669B71E.80102@redhat.com> Date: Thu, 10 Dec 2015 10:32:14 -0700 MIME-Version: 1.0 In-Reply-To: <1449546921-6378-30-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SMKO5sCQXlmOBdfqT0PXXWNTs8MBEJMA2" Subject: Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, David Gibson , "open list:sPAPR pseries" , Michael Roth , Alexander Graf This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SMKO5sCQXlmOBdfqT0PXXWNTs8MBEJMA2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/07/2015 08:55 PM, Eric Blake wrote: > We can greatly simplify things by hoisting the special case > into the start() routine, and flipping the order in the loop > to visit before advance: >=20 > start(head) > element =3D *head > while (element) { > visit(element) > element =3D next(element) > } >=20 > +++ b/include/qapi/visitor-impl.h > @@ -40,9 +40,10 @@ struct Visitor > void (*end_implicit_struct)(Visitor *v); >=20 > /* Must be set */ > - void (*start_list)(Visitor *v, const char *name, Error **errp); > + void (*start_list)(Visitor *v, const char *name, GenericList **lis= t, > + Error **errp); Looking at this, it is inconsistent with start_struct (where name comes AFTER the object); that is, I think this should probably be: void (*start_list)(Visitor *v, GenericList **list, const char *name, Error **errp); although I'll still wait for review comments before respinning. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SMKO5sCQXlmOBdfqT0PXXWNTs8MBEJMA2 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/ iQEcBAEBCAAGBQJWabceAAoJEKeha0olJ0Nqe4cIAJDrNfatluNNn7LB4QAWhJGj /R0rn1qOoUbu4Z8belFcc+JxTADcmQkmz8rNzDHyHhfBXyTijuJRsQXYTaWerXTB n40pmzmpytcR1TCVMcy/HBCzlNIB2wlXRP3fYlyTLbRexFe3pc8EdwEKvtfeFA3x vRdeVZB1OB2kzsFlPxcP2ZoevLRxEFmNP2dVDo9t0JGxpwhpl72nDMIwav9JB6if GFBmydQNb3dY1ZZJaSebF/Kx5Qq0NpA/hLZMrV64UV0LOAYFXhfGj+FrG09at/dx J9iw5Q8mY1DuLwLNA25g8CIDJMFMrFxwL+s9CGM7H+I0KZFVcwWBt2zhfC1nVDo= =MNhl -----END PGP SIGNATURE----- --SMKO5sCQXlmOBdfqT0PXXWNTs8MBEJMA2--