Re: [PATCH 7/8] examples: Use G_N_ELEMENTS instead of ARRAY_CARDINALITY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2019-10-15 at 14:21 +0200, Ján Tomko wrote:
> We try to keep the example programs independent of libraries
> other than libvirt.
> 
> Rename the locally defined ARRAY_CARDINALITY macro to G_N_ELEMENTS
> which GLib provides, even though we don't actually include GLib.

[...]

> -#define ARRAY_CARDINALITY(Array) (sizeof(Array) / sizeof(*(Array)))
> +#define G_N_ELEMENTS(Array) (sizeof(Array) / sizeof(*(Array)))

In this case, and in this case only, I think we should leave the name
alone.

When we use GLib and simply provide our own implementation when using
a version that's too old, the GLib name is obviously accurate, but in
this specific case I think it's misleading and we should stick with
the current one.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux