$OpenBSD: patch-openbsd_Platform_c,v 1.4 2018/07/26 12:49:04 ians Exp $

Use sched.h macros instead of hardcoding, the former broke when we introduced
CP_SPIN cpu state.

https://github.com/hishamhm/htop/pull/817

Index: openbsd/Platform.c
--- openbsd/Platform.c.orig
+++ openbsd/Platform.c
@@ -46,7 +46,7 @@ extern ProcessFieldData Process_fields[];
 
 #define MAXCPU 256
 // XXX: probably should be a struct member
-static int64_t old_v[MAXCPU][5];
+static int64_t old_v[MAXCPU][CPUSTATES];
 
 /*
  * Copyright (c) 1984, 1989, William LeFebvre, Rice University
@@ -225,7 +225,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
       v[i] = diff_v[i] / 10.;
    }
 
-   Meter_setItems(this, 4);
+   Meter_setItems(this, CP_IDLE);
 
    perc = v[0] + v[1] + v[2] + v[3];
 
