diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-02-17 17:38:35 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2021-03-19 23:30:54 +0100 |
commit | a11d01568c5e7bc5570fd48fa0703d837c4bcd84 (patch) | |
tree | 3e298e81123789ed6ae288e5bd32e91ebfb3ff01 /dragonflybsd | |
parent | 53bcc5cbffbdd69e0e08bd33c5e357dd5b753456 (diff) |
Use unsigned types for CPU counts and associated variables
Diffstat (limited to 'dragonflybsd')
-rw-r--r-- | dragonflybsd/DragonFlyBSDProcessList.c | 6 | ||||
-rw-r--r-- | dragonflybsd/Platform.c | 4 | ||||
-rw-r--r-- | dragonflybsd/Platform.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index 976dbea0..79c8f886 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -139,8 +139,8 @@ void ProcessList_delete(ProcessList* this) { static inline void DragonFlyBSDProcessList_scanCPUTime(ProcessList* pl) { const DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) pl; - int cpus = pl->cpuCount; // actual CPU count - int maxcpu = cpus; // max iteration (in case we have average + smp) + unsigned int cpus = pl->cpuCount; // actual CPU count + unsigned int maxcpu = cpus; // max iteration (in case we have average + smp) int cp_times_offset; assert(cpus > 0); @@ -167,7 +167,7 @@ static inline void DragonFlyBSDProcessList_scanCPUTime(ProcessList* pl) { sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_n, &sizeof_cp_time_array, NULL, 0); } - for (int i = 0; i < maxcpu; i++) { + for (unsigned int i = 0; i < maxcpu; i++) { if (cpus == 1) { // single CPU box cp_time_n = dfpl->cp_time_n; diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 1bbbf2c4..14fbbf0f 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -157,9 +157,9 @@ int Platform_getMaxPid() { return maxPid; } -double Platform_setCPUValues(Meter* this, int cpu) { +double Platform_setCPUValues(Meter* this, unsigned int cpu) { const DragonFlyBSDProcessList* fpl = (const DragonFlyBSDProcessList*) this->pl; - int cpus = this->pl->cpuCount; + unsigned int cpus = this->pl->cpuCount; const CPUData* cpuData; if (cpus == 1) { diff --git a/dragonflybsd/Platform.h b/dragonflybsd/Platform.h index 4defaaf8..2cac44df 100644 --- a/dragonflybsd/Platform.h +++ b/dragonflybsd/Platform.h @@ -41,7 +41,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(void); -double Platform_setCPUValues(Meter* this, int cpu); +double Platform_setCPUValues(Meter* this, unsigned int cpu); void Platform_setMemoryValues(Meter* this); |