[gnome-system-monitor/migrateui] OpenBSD: use G_N_ELEMENTS instead of nitems
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor/migrateui] OpenBSD: use G_N_ELEMENTS instead of nitems
- Date: Sat, 21 Jul 2012 07:47:51 +0000 (UTC)
commit 0aa4540be4c1fd9052052fd9617dff435494791f
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]