[GEDI] [PATCH v2 07/19] cutils: Adjust signature of parse_uint[_full]

Eric Blake eblake at redhat.com
Fri May 12 16:25:46 UTC 2023


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 at 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



More information about the integration mailing list