[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 07/19] cutils: Adjust signature of parse_uint[_full]
|
From: |
Eric Blake |
|
Subject: |
Re: [PATCH v2 07/19] cutils: Adjust signature of parse_uint[_full] |
|
Date: |
Fri, 12 May 2023 11:25:46 -0500 |
|
User-agent: |
NeoMutt/20230512 |
On Thu, May 11, 2023 at 09:10:21PM -0500, Eric Blake wrote:
>
> It's already confusing that we have two very similar functions for
> wrapping the parse of a 64-bit unsigned value, differing mainly on
> whether they permit leading '-'. Adjust the signature of parse_uint()
> and parse_uint_full() to be like all of qemu_strto*(): put the result
> parameter last, use the same types (uint64_t is not always the same as
> unsigned long long, and mark endptr const (only latter affects the
I blame my late night editing. Looks better as:
...use the same types (uint64_t and unsigned long long have the same
width, but are not always the same type), and mark endptr const (this
latter change only affects the...
> rare caller of parse_uint). Adjust all callers in the tree.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> include/qemu/cutils.h | 5 +-
> audio/audio_legacy.c | 4 +-
> block/gluster.c | 4 +-
> block/nfs.c | 4 +-
> blockdev.c | 4 +-
> contrib/ivshmem-server/main.c | 4 +-
> qapi/opts-visitor.c | 10 +--
> tests/unit/test-cutils.c | 113 +++++++++++++++-------------------
> ui/vnc.c | 4 +-
> util/cutils.c | 13 ++--
> util/guest-random.c | 4 +-
> util/qemu-sockets.c | 10 +--
> 12 files changed, 82 insertions(+), 97 deletions(-)
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH v2 08/19] cutils: Allow NULL endptr in parse_uint(), (continued)
- [PATCH v2 04/19] test-cutils: Test more integer corner cases, Eric Blake, 2023/05/11
- [PATCH v2 10/19] test-cutils: Prepare for upcoming semantic change in qemu_strtosz, Eric Blake, 2023/05/11
- [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui, Eric Blake, 2023/05/11
- [PATCH v2 07/19] cutils: Adjust signature of parse_uint[_full], Eric Blake, 2023/05/11
- [PATCH v2 09/19] test-cutils: Add coverage of qemu_strtod, Eric Blake, 2023/05/11
[PATCH v2 11/19] test-cutils: Refactor qemu_strtosz tests for less boilerplate, Eric Blake, 2023/05/11
[PATCH v2 14/19] test-cutils: Add more coverage to qemu_strtosz11; rgb:1e1e/1e1e/1e1e, Eric Blake, 2023/05/11