[glib] goptions: use G_N_ELEMENTS instead of nitems



commit 4749878f9102d40d072bb5c838f2dd2e8d61d417
Author: Antoine Jacoutot <ajacoutot gnome org>
Date:   Mon Jul 9 18:17:01 2012 +0200

    goptions: use G_N_ELEMENTS instead of nitems

 glib/goption.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/glib/goption.c b/glib/goption.c
index d34901e..4ebc560 100644
--- a/glib/goption.c
+++ b/glib/goption.c
@@ -1681,11 +1681,7 @@ platform_get_argv0 (void)
 
   cmdline = (char **) realloc (cmdline, len);
 
-#ifndef nitems
-#define nitems(_a)      (sizeof((_a)) / sizeof((_a)[0]))
-#endif
-
-  if (sysctl (mib, nitems (mib), cmdline, &len, NULL, 0) == -1)
+  if (sysctl (mib, G_N_ELEMENTS (mib), cmdline, &len, NULL, 0) == -1)
     {
       g_free (cmdline);
       return NULL;



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