Fix CPU meters
Introduction of CP_SPIN sched state broke hard-coded state indexes resulting in the meters incorrectly reporting bogus intr data instead of CPU usage. Change hardcoded values to sched.h macros.
Also fix a zero index bug
Thank you for looking into this — help with ports is definitely appreciated! I was reviewing that code of Platform_setCPUValues and ended up wondering: are the color bars returning values with their correct meanings on OpenBSD? When trying to follow the code, it seems it gets the vector of CPU states straight from the sysctl and that then goes into the this->values vector of the Meter object, which for a CPUMeter, has this sequence (clearly based on Linux).
So this left me wondering if the numbers match the names: on OpenBSD is the first (blue) part of the bar really showing the numbers for NICE, the second (green) bar the number for NORMAL, the third (red) the number for KERNEL, etc? (In other words, what are the names/values for those CP_* enum values on OpenBSD?) If they're not in the right order, then that v vector might need to be reordered for calculation/display...
Merged here: htop-dev/htop@5a17cee