diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-03-03 23:47:43 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-03-04 12:41:16 +0100 |
commit | c803ec6dae5556fa35d6bd8124aa536633887f77 (patch) | |
tree | 8196fb34f6f1d2398b30989d8bab2024334a5024 /openbsd | |
parent | 11318b5ef6de6b2f80186a888cd5477e0ff167bb (diff) |
Improve code readability by using enum values instead of raw numbers
Diffstat (limited to 'openbsd')
-rw-r--r-- | openbsd/Platform.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c index 71419f8e..615397e2 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -205,11 +205,11 @@ double Platform_setCPUValues(Meter* this, unsigned 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 OpenBSD - 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 OpenBSD + totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL]; this->curItems = 4; } |