From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvX8n-0006cU-AG for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:51:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvX8j-0006J3-E4 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:51:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvX8j-0006Ie-5z for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:51:05 -0500 Message-ID: <50F6E85A.2040705@redhat.com> Date: Wed, 16 Jan 2013 10:50:18 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358349851-20960-1-git-send-email-ehabkost@redhat.com> <1358349851-20960-2-git-send-email-ehabkost@redhat.com> <50F6DF12.8030703@redhat.com> <20130116173336.GC10683@otherpad.lan.raisama.net> In-Reply-To: <20130116173336.GC10683@otherpad.lan.raisama.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2GNQCSCLRRUAPSEMXJUGJ" Subject: Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Laszlo Ersek , Chegu Vinod , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2GNQCSCLRRUAPSEMXJUGJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/16/2013 10:33 AM, Eduardo Habkost wrote: > On Wed, Jan 16, 2013 at 10:10:42AM -0700, Eric Blake wrote: >> On 01/16/2013 08:24 AM, Eduardo Habkost wrote: >>> There are lots of duplicate parsing code using strto*() in QEMU, and >>> most of that code is broken in one way or another. Even the visitors >>> code have duplicate integer parsing code[1]. This introduces function= s >>> to help parsing unsigned int values: parse_uint() and parse_uint_full= (). >>> >> >> Your test case lacks test of octal or hexadecimal input strings; is th= at >> worth adding? >=20 > I believe I trust strtoll() enough to not require tests for those cases= =2E But see my comments in 8/8 about whether it makes sense to add a 'base' parameter to let the caller choose whether they want to allow octal or require strict decimal parsing. >>> + r =3D -errno; >> >> Why two spaces? >=20 > Typo. I will send a fixed version (keeping your Reviewed-by, if you > don't mind). No problem - I wouldn't have left a reviewed-by if I didn't think the changes couldn't be trivially fixed. On the other hand, you may have a non-trivial fix in the form of adding a base parameter... --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2GNQCSCLRRUAPSEMXJUGJ 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ9uhaAAoJEKeha0olJ0NqgkUH/3Iv6uvTO9hWd30DWeZgYmYn lpSGbW1e6TECn90YBZqRv6071nq725fsRwYV43Fv0t6quf0aH+bk8AELjDiZPX97 HTB9W62XMAYdvRfNFk+rsxWMJEGTfw57UZYS3yn4xwWVDinlfTLLLX/bnsWSw71z 8HeP7fboAJ3toS8gU2phiDVlovIHVOQZpImQUqE5iut+VVMjgaMp/f5HWw8DS8A+ 0gcZcBFhf/SxGznQCH1lJvL4hR2vvbEutnab+YYrVOR9jIiEYjda/PYjRmGh9oNQ 1sIbYXYQdEZxEeCZKAHm0v4xDBd5Ub5QRAK8AmyIJYSh7nMQRcC46KOMgv1eeR8= =P52+ -----END PGP SIGNATURE----- ------enig2GNQCSCLRRUAPSEMXJUGJ--