1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00
libvirt/tools/nss
John Ferlan 4a3d6ed5ee util: Clean up consumers of virJSONValueArraySize
Rather than have virJSONValueArraySize return a -1 when the input
is not an array and then splat an error message, let's check for
an array before calling and then change the return to be a size_t
instead of ssize_t.

That means using the helper virJSONValueIsArray as well as using a
more generic error message such as "Malformed <something> array".
In some cases we can remove stack variables and when we cannot,
those variables should be size_t not ssize_t. Alter a few references
of if (!value) to be if (value == 0) instead as well.

Some callers can already assume an array is being worked on based
on the previous call, so there's less to do.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-05-10 14:59:15 -04:00
..
libvirt_guest_nss.syms nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
libvirt_nss_bsd.syms nss: FreeBSD support 2016-03-30 10:21:44 +03:00
libvirt_nss.c util: Clean up consumers of virJSONValueArraySize 2018-05-10 14:59:15 -04:00
libvirt_nss.h nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
libvirt_nss.syms Implement _nss_libvirt_gethostbyname4_r 2016-03-18 17:29:53 +01:00