]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Use G_N_ELEMENTS() more
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Mar 2023 09:43:50 +0000 (10:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Mar 2023 12:29:07 +0000 (13:29 +0100)
commit7db8373e082e6413b2ad5a7ec311bbad4cbc0e91
tree801632071674ff58eab89305892c2e5ad8289dcc
parentb07a1f40c72fc8eaa9b57d2b5dd9c6699ff1af8e
Use G_N_ELEMENTS() more

In a few places we still use the good old:

  sizeof(var) / sizeof(var[0])
  sizeof(var) / sizeof(int)

The G_N_ELEMENTS() macro is preferred though. In a few places we
don't link with glib, so provide the macro definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
examples/c/misc/openauth.c
src/libvirt.c
tests/virbitmaptest.c
tests/virnetdevtest.c
tools/nss/libvirt_nss.c
tools/virt-login-shell.c