[glib] goptions: use G_N_ELEMENTS instead of nitems
- From: Antoine Jacoutot <ajacoutot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] goptions: use G_N_ELEMENTS instead of nitems
- Date: Tue, 10 Jul 2012 13:24:37 +0000 (UTC)
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]