summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-10-03 22:00:27 +0200
committercgzones <cgzones@googlemail.com>2020-10-08 15:37:03 +0200
commit4a78f4bb928a4fd6b7b0c003ebdea279cf0d319f (patch)
tree12660b02902315c4036085d428838ad062acf339 /openbsd
parent2970cae5436c1e38a98661da3d59c3371051d606 (diff)
Some more locations for ARRAYSIZE
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/OpenBSDProcessList.c3
-rw-r--r--openbsd/Platform.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/openbsd/OpenBSDProcessList.c b/openbsd/OpenBSDProcessList.c
index 9d1367e7..c3ba763a 100644
--- a/openbsd/OpenBSDProcessList.c
+++ b/openbsd/OpenBSDProcessList.c
@@ -10,6 +10,7 @@ in the source distribution for its full text.
#include "ProcessList.h"
#include "OpenBSDProcessList.h"
#include "OpenBSDProcess.h"
+#include "Macros.h"
#include <err.h>
#include <errno.h>
@@ -118,7 +119,7 @@ static inline void OpenBSDProcessList_scanMemoryInfo(ProcessList* pl) {
pl->cachedMem *= PAGE_SIZE_KB;
struct kvm_swap swap[16];
- int nswap = kvm_getswapinfo(opl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0);
+ int nswap = kvm_getswapinfo(opl->kd, swap, ARRAYSIZE(swap), 0);
pl->totalSwap = 0;
pl->usedSwap = 0;
for (int i = 0; i < nswap; i++) {
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 02a821e7..4c2ebdfb 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -7,6 +7,7 @@ in the source distribution for its full text.
*/
#include "Platform.h"
+#include "Macros.h"
#include "Meter.h"
#include "CPUMeter.h"
#include "MemoryMeter.h"
@@ -84,7 +85,7 @@ const SignalItem Platform_signals[] = {
{ .name = "32 SIGTHR", .number = 32 },
};
-const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
+const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals);
void Platform_setBindings(Htop_Action* keys) {
(void) keys;

© 2014-2024 Faster IT GmbH | imprint | privacy policy