Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-02-04 Thread Laszlo Ersek
On 02/04/13 19:27, Eduardo Habkost wrote: > Changes on v7 are trivial: > - Patch refresh after changes on test/Makefile on qemu.git master > - Fix typo on comment on parse_uint() (missing whitespace) > > As the changes are really trivial, I am keeping the Reviewed-by lines > from Eric and Laszl

[Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-02-04 Thread Eduardo Habkost
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 functions to help parsing unsigned int values: parse_uint() and parse_uint_full(). Parsing function

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-18 Thread Markus Armbruster
Eduardo Habkost writes: > On Fri, Jan 18, 2013 at 11:01:14AM +0100, Markus Armbruster wrote: >> Eduardo Habkost writes: >> >> > 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

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-18 Thread Andreas Färber
Am 18.01.2013 14:26, schrieb Eduardo Habkost: > > On Fri, Jan 18, 2013 at 11:01:14AM +0100, Markus Armbruster wrote: >> Your list of error checks isn't quite complete. Here's my try: Even better would be: >> /** * parse_uint: >> * @s: String to parse >> * @value: Destination for parsed int

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-18 Thread Eduardo Habkost
On Fri, Jan 18, 2013 at 11:01:14AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > 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 i

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-18 Thread Markus Armbruster
Eduardo Habkost writes: > 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 functions > to help parsing unsigned int values: parse_uint() and pa

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-17 Thread Eduardo Habkost
On Thu, Jan 17, 2013 at 07:29:17PM +0100, Laszlo Ersek wrote: > On 01/16/13 19:28, Eduardo Habkost wrote: > > > +static void test_parse_uint_negative(void) > > +{ > > +unsigned long long i = 999; > > +char f = 'X'; > > +char *endptr = &f; > > +const char *str = " \t -321"; > > +

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-17 Thread Laszlo Ersek
On 01/16/13 19:28, Eduardo Habkost wrote: > +static void test_parse_uint_negative(void) > +{ > +unsigned long long i = 999; > +char f = 'X'; > +char *endptr = &f; > +const char *str = " \t -321"; > +int r; > + > +r = parse_uint(str, &i, &endptr, 0); > + > +g_assert_cmpi

[Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eduardo Habkost
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 functions to help parsing unsigned int values: parse_uint() and parse_uint_full(). Parsing function

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eduardo Habkost
On Wed, Jan 16, 2013 at 10:50:18AM -0700, Eric Blake wrote: > 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

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eric Blake
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 vis

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eduardo Habkost
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

Re: [Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eric Blake
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 functions > to help parsing unsigned int values

[Qemu-devel] [PATCH 1/8] cutils: unsigned int parsing functions

2013-01-16 Thread Eduardo Habkost
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 functions to help parsing unsigned int values: parse_uint() and parse_uint_full(). Parsing function