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

2019-10-16 Thread Andrea Bolognani
On Tue, 2019-10-15 at 18:21 +0100, Daniel P. Berrangé wrote: > On Tue, Oct 15, 2019 at 04:10:55PM +0200, Andrea Bolognani wrote: > > On Tue, 2019-10-15 at 14:21 +0200, Ján Tomko wrote: > > > -#define ARRAY_CARDINALITY(Array) (sizeof(Array) / sizeof(*(Array))) > > > +#define G_N_ELEMENTS(Array)

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

2019-10-15 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 04:10:55PM +0200, Andrea Bolognani wrote: > 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

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

2019-10-15 Thread Ján Tomko
On Tue, Oct 15, 2019 at 04:10:55PM +0200, Andrea Bolognani wrote: 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

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

2019-10-15 Thread Andrea Bolognani
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

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

2019-10-15 Thread Ján Tomko
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. Signed-off-by: Ján Tomko --- examples/c/misc/event-test.c | 26