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

2013-01-17 Thread Eduardo Habkost
On Thu, Jan 17, 2013 at 05:06:50PM -0200, 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 u

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

2013-01-17 Thread Blue Swirl
On Thu, Jan 17, 2013 at 7:06 PM, 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

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

2013-01-17 Thread Eric Blake
On 01/17/2013 12:06 PM, 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

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

2013-01-17 Thread Laszlo Ersek
On 01/17/13 20:06, Eduardo Habkost wrote: > Changes v4: > - Return -EINVAL in case a minus sign is found > - Make endptr point to beginning of string in case -EINVAL >is returned (like the strtoull() behavior) Reviewed-by: Laszlo Ersek

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

2013-01-17 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