[Libguestfs] [libnbd PATCH v5 4/5] vector: introduce DEFINE_POINTER_VECTOR_TYPE()

Eric Blake eblake at redhat.com
Mon Feb 27 14:09:17 UTC 2023


On Sun, Feb 26, 2023 at 12:45:28PM +0100, Laszlo Ersek wrote:
> The "name##_iter" function is used 11 times in libnbd; in all those cases,
> "name" is "string_vector", and the "f" callback is "free":
> 
>   string_vector_iter (..., (void *) free);
> 
> Casting "free" to (void*) is ugly. (Well-defined by POSIX, but still.)
>
...
> 
> Switch "string_vector" to DEFINE_POINTER_VECTOR_TYPE(). The 11
> string_vector_iter() call sites continue working; they will be converted
> to string_vector_empty() in a subsequent patch.
> 
> Signed-off-by: Laszlo Ersek <lersek at redhat.com>
> ---
> 
> Notes:
>     v5:
>     
>     - resolve conflict from update to previous patch
>     
>     - force semicolon after ADD_VECTOR_EMPTY_METHOD() and
>       DEFINE_POINTER_VECTOR_TYPE() too
>     
>     - update example macro invocations in the commit message

Reviewed-by: Eric Blake <eblake at redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


More information about the Libguestfs mailing list