Re: [Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-21 Thread Eric Blake
On 11/21/18 4:35 AM, David Hildenbrand wrote: +int qemu_strtod_finite(const char *nptr, const char **endptr, double *result) +{ +double tmp; +int ret; + +ret = qemu_strtod(nptr, endptr, &tmp); +if (ret) { +return ret; So, if we overflow, we are returning -ERANGE but wit

Re: [Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-21 Thread Markus Armbruster
David Hildenbrand writes: > On 20.11.18 21:07, Markus Armbruster wrote: >> Eric Blake writes: >> >>> On 11/20/18 3:25 AM, David Hildenbrand wrote: Let's provide a wrapper for strtod(). Reviewed-by: Eric Blake >>> >>> This changed enough from v1 that I would have dropped R-b to e

Re: [Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-21 Thread David Hildenbrand
On 20.11.18 21:07, Markus Armbruster wrote: > Eric Blake writes: > >> On 11/20/18 3:25 AM, David Hildenbrand wrote: >>> Let's provide a wrapper for strtod(). >>> >>> Reviewed-by: Eric Blake >> >> This changed enough from v1 that I would have dropped R-b to ensure >> that reviewers notice the dif

Re: [Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-20 Thread Markus Armbruster
Eric Blake writes: > On 11/20/18 3:25 AM, David Hildenbrand wrote: >> Let's provide a wrapper for strtod(). >> >> Reviewed-by: Eric Blake > > This changed enough from v1 that I would have dropped R-b to ensure > that reviewers notice the differences. > >> Signed-off-by: David Hildenbrand >> ---

Re: [Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-20 Thread Eric Blake
On 11/20/18 3:25 AM, David Hildenbrand wrote: Let's provide a wrapper for strtod(). Reviewed-by: Eric Blake This changed enough from v1 that I would have dropped R-b to ensure that reviewers notice the differences. Signed-off-by: David Hildenbrand --- include/qemu/cutils.h | 2 ++ ut

[Qemu-devel] [PATCH v2 1/9] cutils: Add qemu_strtod() and qemu_strtod_finite()

2018-11-20 Thread David Hildenbrand
Let's provide a wrapper for strtod(). Reviewed-by: Eric Blake Signed-off-by: David Hildenbrand --- include/qemu/cutils.h | 2 ++ util/cutils.c | 65 +++ 2 files changed, 67 insertions(+) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h