From a11d01568c5e7bc5570fd48fa0703d837c4bcd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 17 Feb 2021 17:38:35 +0100 Subject: Use unsigned types for CPU counts and associated variables --- openbsd/OpenBSDProcessList.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd/OpenBSDProcessList.c') diff --git a/openbsd/OpenBSDProcessList.c b/openbsd/OpenBSDProcessList.c index ff5c9278..0a0c0a5f 100644 --- a/openbsd/OpenBSDProcessList.c +++ b/openbsd/OpenBSDProcessList.c @@ -63,7 +63,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui CRT_fatalError("pagesize sysconf call failed"); pageSizeKB = pageSize / ONE_K; - for (int i = 0; i <= pl->cpuCount; i++) { + for (unsigned int i = 0; i <= pl->cpuCount; i++) { CPUData* d = opl->cpus + i; d->totalTime = 1; d->totalPeriod = 1; @@ -313,7 +313,7 @@ static void OpenBSDProcessList_scanCPUTime(OpenBSDProcessList* this) { u_int64_t kernelTimes[CPUSTATES] = {0}; u_int64_t avg[CPUSTATES] = {0}; - for (int i = 0; i < this->super.cpuCount; i++) { + for (unsigned int i = 0; i < this->super.cpuCount; i++) { getKernelCPUTimes(i, kernelTimes); CPUData* cpu = this->cpus + i + 1; kernelCPUTimesToHtop(kernelTimes, cpu); -- cgit v1.2.3