summaryrefslogtreecommitdiffstats
path: root/darwin/Platform.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-02-17 17:38:35 +0100
committerBenny Baumann <BenBE@geshi.org>2021-03-19 23:30:54 +0100
commita11d01568c5e7bc5570fd48fa0703d837c4bcd84 (patch)
tree3e298e81123789ed6ae288e5bd32e91ebfb3ff01 /darwin/Platform.c
parent53bcc5cbffbdd69e0e08bd33c5e357dd5b753456 (diff)
Use unsigned types for CPU counts and associated variables
Diffstat (limited to 'darwin/Platform.c')
-rw-r--r--darwin/Platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 932b1832..3842fddc 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -182,12 +182,12 @@ int Platform_getMaxPid() {
static double Platform_setCPUAverageValues(Meter* mtr) {
const ProcessList* dpl = mtr->pl;
- int cpus = dpl->cpuCount;
+ unsigned int cpus = dpl->cpuCount;
double sumNice = 0.0;
double sumNormal = 0.0;
double sumKernel = 0.0;
double sumPercent = 0.0;
- for (int i = 1; i <= cpus; i++) {
+ for (unsigned int i = 1; i <= cpus; i++) {
sumPercent += Platform_setCPUValues(mtr, i);
sumNice += mtr->values[CPU_METER_NICE];
sumNormal += mtr->values[CPU_METER_NORMAL];
@@ -199,7 +199,7 @@ static double Platform_setCPUAverageValues(Meter* mtr) {
return sumPercent / cpus;
}
-double Platform_setCPUValues(Meter* mtr, int cpu) {
+double Platform_setCPUValues(Meter* mtr, unsigned int cpu) {
if (cpu == 0) {
return Platform_setCPUAverageValues(mtr);

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