From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLzsT-0002gl-G5 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 16:01:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLzsQ-0004Hm-A7 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 16:01:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLzsQ-0004Hh-20 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 16:01:14 -0500 References: <1453219845-30939-1-git-send-email-eblake@redhat.com> <1453219845-30939-17-git-send-email-eblake@redhat.com> <87wpr4krmy.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <569FF598.1020909@redhat.com> Date: Wed, 20 Jan 2016 14:01:12 -0700 MIME-Version: 1.0 In-Reply-To: <87wpr4krmy.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RaXApIcVJrf5233XrDxGhepcgKSkJle6O" Subject: Re: [Qemu-devel] [PATCH v9 16/37] qapi: Swap 'name' in visit_* callbacks to match public API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RaXApIcVJrf5233XrDxGhepcgKSkJle6O Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/20/2016 11:55 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> As explained in the previous patches, matching argument order of >> 'name, &value' to JSON's "name":value makes sense. However, >> while the last two patches were easy with Coccinelle, I ended up >> doing this one all by hand. Now all the visitor callbacks match >> the main interface. >> >> Signed-off-by: Eric Blake >> Reviewed-by: Marc-Andr=C3=A9 Lureau >> >> @@ -30,39 +30,42 @@ struct Visitor >> GenericList *(*next_list)(Visitor *v, GenericList **list, Error *= *errp); >> void (*end_list)(Visitor *v, Error **errp); >> >> - void (*type_enum)(Visitor *v, int *obj, const char * const string= s[], >> - const char *kind, const char *name, Error **err= p); >> + void (*type_enum)(Visitor *v, const char *name, int *obj, >> + const char * const strings[], const char *kind,= >=20 > Opportunity to change to 'const char *const'. I prefer that, because i= t > makes the fact that this is a pointer-* and not a binary operator-* > visually obvious. >=20 > Same elsewhere. Hmm, I probably have churn later in the series. Will fix. >> /* May be NULL; most useful for input visitors. */ >> - void (*optional)(Visitor *v, bool *present, const char *name); >> + void (*optional)(Visitor *v, const char *name, bool *present); >> >=20 > I checked the changes to this file carefully. Can we rely on the > compiler to flag mistakes in the rest of the patch? C's (intentionally-loose) treatment of 'char *' like 'void *' is a bit worrisome, but the fact that we have 'const' on only one of the two swapped arguments was indeed enough to make the compiler complain about mismatch in parameter types when trying to assign incorrectly-typed static functions to the updated struct members. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RaXApIcVJrf5233XrDxGhepcgKSkJle6O 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/ iQEcBAEBCAAGBQJWn/WYAAoJEKeha0olJ0NqMX0H/2Vha9DjV7/mCvw7Lvfzy7qM zJcQdrv8nQl+4IcnVBOGeXZ8c/96O4FGLiM0r/aLW1ZsK9we8lnCXQ1+kw1NtrdD nJc6JbcT2DbwlGL7G9naYE6r4AcjsHL5BFoPduNHmxNN8gSenRTlbG+mnhPztC1+ a/09a/FObB4brPQk2G+RkQXwqz89EfEXCa8uDwsRgJ6tqwxox/SEkg26qGYxrxoH ouVyt16TOVQiyxU26AQQG3AuR8VodmZri+OU72AnNcgqeFPbzSFmU4c9o9t4EkfR w0cD2XQJSMobws3Bjrbt8/obqXWp2Cm1Mkyig/z76PqvQYobJ8mHLOAFAp4DOQk= =CXOb -----END PGP SIGNATURE----- --RaXApIcVJrf5233XrDxGhepcgKSkJle6O--