summaryrefslogtreecommitdiffstats
path: root/netbsd
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-03-03 23:47:43 +0100
committerBenBE <BenBE@geshi.org>2023-03-04 12:41:16 +0100
commitc803ec6dae5556fa35d6bd8124aa536633887f77 (patch)
tree8196fb34f6f1d2398b30989d8bab2024334a5024 /netbsd
parent11318b5ef6de6b2f80186a888cd5477e0ff167bb (diff)
Improve code readability by using enum values instead of raw numbers
Diffstat (limited to 'netbsd')
-rw-r--r--netbsd/Platform.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c
index c5c42d0a..9b07d8f0 100644
--- a/netbsd/Platform.c
+++ b/netbsd/Platform.c
@@ -254,11 +254,11 @@ double Platform_setCPUValues(Meter* this, int cpu) {
v[CPU_METER_IOWAIT] = 0.0;
v[CPU_METER_FREQUENCY] = NAN;
this->curItems = 8;
- totalPercent = v[0] + v[1] + v[2] + v[3];
+ totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL] + v[CPU_METER_IRQ];
} else {
- v[2] = cpuData->sysAllPeriod / total * 100.0;
- v[3] = 0.0; // No steal nor guest on NetBSD
- totalPercent = v[0] + v[1] + v[2];
+ v[CPU_METER_KERNEL] = cpuData->sysAllPeriod / total * 100.0;
+ v[CPU_METER_IRQ] = 0.0; // No steal nor guest on NetBSD
+ totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL];
this->curItems = 4;
}

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