From 4a78f4bb928a4fd6b7b0c003ebdea279cf0d319f Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 3 Oct 2020 22:00:27 +0200 Subject: Some more locations for ARRAYSIZE --- dragonflybsd/DragonFlyBSDProcessList.c | 3 ++- dragonflybsd/Platform.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'dragonflybsd') diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index 1c10a412..87f16069 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -9,6 +9,7 @@ in the source distribution for its full text. #include "ProcessList.h" #include "DragonFlyBSDProcessList.h" #include "DragonFlyBSDProcess.h" +#include "Macros.h" #include #include @@ -253,7 +254,7 @@ static inline void DragonFlyBSDProcessList_scanMemoryInfo(ProcessList* pl) { //pl->freeMem *= pageSizeKb; struct kvm_swap swap[16]; - int nswap = kvm_getswapinfo(dfpl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0); + int nswap = kvm_getswapinfo(dfpl->kd, swap, ARRAYSIZE(swap), 0); pl->totalSwap = 0; pl->usedSwap = 0; for (int i = 0; i < nswap; i++) { diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 21ebc40a..6eb1e99c 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/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" @@ -71,7 +72,7 @@ const SignalItem Platform_signals[] = { { .name = "33 SIGLIBRT", .number = 33 }, }; -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; -- cgit v1.2.3