Some more locations for ARRAYSIZE

This commit is contained in:
Benny Baumann
2020-10-03 22:00:27 +02:00
committed by cgzones
parent 2970cae543
commit 4a78f4bb92
9 changed files with 18 additions and 9 deletions

View File

@ -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 <unistd.h>
#include <stdlib.h>
@ -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++) {

View File

@ -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;