From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoLP4-0005fu-90 for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:58:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoLOz-0002Pp-Bj for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:58:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoLOz-0002Pj-20 for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:58:41 -0500 Message-ID: <529FB39E.6090904@redhat.com> Date: Wed, 04 Dec 2013 15:58:38 -0700 From: Eric Blake MIME-Version: 1.0 References: <1385714473-7322-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1385714473-7322-10-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1385714473-7322-10-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E7EOCUQEtnPpEmHpWRucOFNE0P1q7Ut90" Subject: Re: [Qemu-devel] [PATCH V3 9/9] qapi script: do not add "_" for every capitalized char in enum List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E7EOCUQEtnPpEmHpWRucOFNE0P1q7Ut90 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/29/2013 01:41 AM, Wenchao Xia wrote: > Now "enum AIOContext" will generate AIO_CONTEXT instead of A_I_O_CONTEX= T, > "X86CPU" will generate X86_CPU instead of X86_C_P_U. >=20 > Signed-off-by: Wenchao Xia > --- > + l =3D len(c_fun_str) > + for i in range(l): > + c =3D c_fun_str[i] > + # When c is upper and no "_" appear before, do more check s/appear/appears/ s/check/checks/ > + if c.isupper() and (i > 0) and c_fun_str[i - 1] !=3D "_": > + # Case 1: Next string is lower > + # Case 2: previous string is digit > + if (i < (l - 1) and c_fun_str[i + 1].islower()) or \ > + c_fun_str[i - 1].isdigit(): Indentation looks odd. > + new_name +=3D '_' > new_name +=3D c > return new_name.lstrip('_').upper() Those are minor, so feel free to add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --E7EOCUQEtnPpEmHpWRucOFNE0P1q7Ut90 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSn7OeAAoJEKeha0olJ0NqakYH/i+j1Q9/FSUnppyIZsPivCzZ BSOTdDfqaoKvtwsqfW6nzUPS64xR9UFf/h4/d80GpP+HsGGHSZWGe95/jZjHAvMD UcVb+fnyaiY5XQw9bL5grrLNPexX3H181s7UaUfWWF1UjXGNhKznUnic5YqBVmBk e8aQvjggDlm9vxcglouh04YQdNsJ7trocmaEO6gOLLQBRxEL3ZiNw9efj54WHaS3 Ncb3mDzeQy11wtzMv3kjjrimxoVZt6d2SfhBMJOw2BPSTSMX50sC7hCZx7GNeesV BQllYvhkAN2Ygh4Ux/gAaWtNXvn5u4qWgSfo3/cla0R9W2uUxXdhFLD9KlibAGg= =Ot+R -----END PGP SIGNATURE----- --E7EOCUQEtnPpEmHpWRucOFNE0P1q7Ut90--