-
- Downloads
cutils: Adjust signature of parse_uint[_full]
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 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. While at it, note that since cutils.c already includes: QEMU_BUILD_BUG_ON(sizeof(int64_t) != sizeof(long long)); we are guaranteed that the result of parse_uint* cannot exceed UINT64_MAX (or the build would have failed), so we can drop pre-existing dead comparisons in opts-visitor.c that were never false. Reviewed-by:Hanna Czenczek <hreitz@redhat.com> Message-Id: <20230522190441.64278-8-eblake@redhat.com> [eblake: Drop dead code spotted by Markus] Signed-off-by:
Eric Blake <eblake@redhat.com>
Showing
- audio/audio_legacy.c 2 additions, 2 deletionsaudio/audio_legacy.c
- block/gluster.c 2 additions, 2 deletionsblock/gluster.c
- block/nfs.c 2 additions, 2 deletionsblock/nfs.c
- blockdev.c 2 additions, 2 deletionsblockdev.c
- contrib/ivshmem-server/main.c 2 additions, 2 deletionscontrib/ivshmem-server/main.c
- include/qemu/cutils.h 2 additions, 3 deletionsinclude/qemu/cutils.h
- qapi/opts-visitor.c 6 additions, 6 deletionsqapi/opts-visitor.c
- tests/unit/test-cutils.c 53 additions, 66 deletionstests/unit/test-cutils.c
- ui/vnc.c 2 additions, 2 deletionsui/vnc.c
- util/cutils.c 6 additions, 7 deletionsutil/cutils.c
- util/guest-random.c 2 additions, 2 deletionsutil/guest-random.c
- util/qemu-sockets.c 5 additions, 5 deletionsutil/qemu-sockets.c
Loading
Please register or sign in to comment