[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/4] cutils: Add qemu_strto*l() wrappers
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 0/4] cutils: Add qemu_strto*l() wrappers |
Date: |
Wed, 8 Jul 2015 15:02:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
On 08/07/2015 03:09, Carlos L. Torres wrote:
> From: "Carlos L. Torres" <address@hidden>
>
> Introduce qemu_ wrappers for strtol/strtoul/strtoll/strtoull
> C functions, ensure that errno is checked, and if NULL is
> passed as the endptr argument, then whole string has to be
> a valid number on the given base, otherwise return appropriate
> error.
>
> Different from the C strto*l() functions, these wrappers
> return through the 'result' out parameter.
>
> Include unit-tests for each wrapper function.
>
> Signed-off-by: Carlos L. Torres <address@hidden>
>
>
> Carlos L. Torres (4):
> cutils: Add qemu_strtol() wrapper
> cutils: Add qemu_strtoul() wrapper
> cutils: Add qemu_strtoll() wrapper
> cutils: Add qemu_strtoull() wrapper
>
> include/qemu-common.h | 8 +
> tests/test-cutils.c | 1172
> +++++++++++++++++++++++++++++++++++++++++++++++++
> util/cutils.c | 131 ++++++
> 3 files changed, 1311 insertions(+)
>
This looks pretty much okay. Of course, you would include at least one
conversion from strto* to qemu_strto* (not necessarily one per function,
though one signed case and one unsigned case would be great).
Paolo