[gnome-system-monitor] OpenBSD: use G_N_ELEMENTS instead of nitems
- From: Antoine Jacoutot <ajacoutot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] OpenBSD: use G_N_ELEMENTS instead of nitems
- Date: Fri, 20 Jul 2012 07:19:50 +0000 (UTC)
commit a9972b6a45b490fd316a1a536115baca465e3ae6
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Mon Jul 9 18:23:37 2012 +0200
OpenBSD: use G_N_ELEMENTS instead of nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL conditional.
Use G_N_ELEMENTS from GLib which is the proper way of doing this.
src/procproperties.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/procproperties.cpp b/src/procproperties.cpp
index 6821893..c61f1b9 100644
--- a/src/procproperties.cpp
+++ b/src/procproperties.cpp
@@ -120,7 +120,7 @@ fill_proc_properties (GtkWidget *tree, ProcInfo *info)
int HZ;
int mib[] = { CTL_KERN, KERN_CLOCKRATE };
- if (sysctl (mib, nitems(mib), &cinf, &size, NULL, 0) == -1)
+ if (sysctl (mib, G_N_ELEMENTS (mib), &cinf, &size, NULL, 0) == -1)
HZ = 100;
else
HZ = cinf.hz;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]