Mark Object classes and Object class fields const
diff --git a/CPUMeter.c b/CPUMeter.c
index 51c16c6..7298847 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -146,7 +146,7 @@
    AllCPUsMeter_getRange(this, &start, &count);
    for (int i = 0; i < count; i++) {
       if (!meters[i])
-         meters[i] = Meter_new(this->pl, start+i+1, (MeterClass*) Class(CPUMeter));
+         meters[i] = Meter_new(this->pl, start+i+1, (const MeterClass*) Class(CPUMeter));
       Meter_init(meters[i]);
    }
    if (this->mode == 0)
diff --git a/InfoScreen.h b/InfoScreen.h
index 196c56e..e5c5846 100644
--- a/InfoScreen.h
+++ b/InfoScreen.h
@@ -14,14 +14,14 @@
 typedef bool(*InfoScreen_OnKey)(InfoScreen*, int);
 
 typedef struct InfoScreenClass_ {
-   ObjectClass super;
+   const ObjectClass super;
    const InfoScreen_Scan scan;
    const InfoScreen_Draw draw;
    const InfoScreen_OnErr onErr;
    const InfoScreen_OnKey onKey;
 } InfoScreenClass;
 
-#define As_InfoScreen(this_)          ((InfoScreenClass*)(((InfoScreen*)(this_))->super.klass))
+#define As_InfoScreen(this_)          ((const InfoScreenClass*)(((InfoScreen*)(this_))->super.klass))
 #define InfoScreen_scan(this_)        As_InfoScreen(this_)->scan((InfoScreen*)(this_))
 #define InfoScreen_draw(this_)        As_InfoScreen(this_)->draw((InfoScreen*)(this_))
 #define InfoScreen_onErr(this_)       As_InfoScreen(this_)->onErr((InfoScreen*)(this_))
diff --git a/Meter.c b/Meter.c
index c0b2af9..cd6d089 100644
--- a/Meter.c
+++ b/Meter.c
@@ -27,13 +27,13 @@
    }
 };
 
-Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type) {
+Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type) {
    Meter* this = xCalloc(1, sizeof(Meter));
    Object_setClass(this, type);
    this->h = 1;
    this->param = param;
    this->pl = pl;
-   type->curItems = type->maxItems;
+   this->curItems = type->maxItems;
    this->values = xCalloc(type->maxItems, sizeof(double));
    this->total = type->total;
    this->caption = xStrdup(type->caption);
@@ -191,7 +191,7 @@
 
    // First draw in the bar[] buffer...
    int offset = 0;
-   int items = Meter_getItems(this);
+   int items = this->curItems;
    for (int i = 0; i < items; i++) {
       double value = this->values[i];
       value = CLAMP(value, 0.0, this->total);
@@ -292,7 +292,7 @@
       Meter_updateValues(this, buffer, nValues - 1);
 
       double value = 0.0;
-      int items = Meter_getItems(this);
+      int items = this->curItems;
       for (int i = 0; i < items; i++)
          value += this->values[i];
       value /= this->total;
diff --git a/Meter.h b/Meter.h
index 07e66e0..34f388f 100644
--- a/Meter.h
+++ b/Meter.h
@@ -22,7 +22,7 @@
 typedef void(*Meter_Draw)(Meter*, int, int, int);
 
 typedef struct MeterClass_ {
-   ObjectClass super;
+   const ObjectClass super;
    const Meter_Init init;
    const Meter_Done done;
    const Meter_UpdateMode updateMode;
@@ -30,16 +30,15 @@
    const Meter_UpdateValues updateValues;
    const int defaultMode;
    const double total;
-   const int* attributes;
-   const char* name;
-   const char* uiName;
-   const char* caption;
-   const char* description;
+   const int* const attributes;
+   const char* const name;
+   const char* const uiName;
+   const char* const caption;
+   const char* const description;
    const char maxItems;
-   char curItems;
 } MeterClass;
 
-#define As_Meter(this_)                ((MeterClass*)((this_)->super.klass))
+#define As_Meter(this_)                ((const MeterClass*)((this_)->super.klass))
 #define Meter_initFn(this_)            As_Meter(this_)->init
 #define Meter_init(this_)              As_Meter(this_)->init((Meter*)(this_))
 #define Meter_done(this_)              As_Meter(this_)->done((Meter*)(this_))
@@ -50,8 +49,6 @@
 #define Meter_updateValues(this_, buf_, sz_) \
                                        As_Meter(this_)->updateValues((Meter*)(this_), buf_, sz_)
 #define Meter_defaultMode(this_)       As_Meter(this_)->defaultMode
-#define Meter_getItems(this_)          As_Meter(this_)->curItems
-#define Meter_setItems(this_, n_)      As_Meter(this_)->curItems = (n_)
 #define Meter_attributes(this_)        As_Meter(this_)->attributes
 #define Meter_name(this_)              As_Meter(this_)->name
 #define Meter_uiName(this_)            As_Meter(this_)->uiName
@@ -66,6 +63,7 @@
    void* drawData;
    int h;
    struct ProcessList_* pl;
+   char curItems;
    double* values;
    double total;
 };
@@ -92,7 +90,7 @@
 
 extern MeterClass Meter_class;
 
-Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type);
+Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type);
 
 int Meter_humanUnit(char* buffer, unsigned long int value, int size);
 
diff --git a/Object.c b/Object.c
index 6f16009..97e913e 100644
--- a/Object.c
+++ b/Object.c
@@ -8,7 +8,7 @@
 
 #include "Object.h"
 
-ObjectClass Object_class = {
+const ObjectClass Object_class = {
    .extends = NULL
 };
 
diff --git a/Object.h b/Object.h
index 6fafd4e..0d0e003 100644
--- a/Object.h
+++ b/Object.h
@@ -19,26 +19,26 @@
 typedef void(*Object_Delete)(Object*);
 
 #define Object_getClass(obj_)         ((Object*)(obj_))->klass
-#define Object_setClass(obj_, class_) Object_getClass(obj_) = (ObjectClass*) class_
+#define Object_setClass(obj_, class_) Object_getClass(obj_) = (const ObjectClass*) class_
 
 #define Object_delete(obj_)           Object_getClass(obj_)->delete((Object*)(obj_))
 #define Object_displayFn(obj_)        Object_getClass(obj_)->display
 #define Object_display(obj_, str_)    Object_getClass(obj_)->display((Object*)(obj_), str_)
 #define Object_compare(obj_, other_)  Object_getClass(obj_)->compare((const void*)(obj_), other_)
 
-#define Class(class_)                 ((ObjectClass*)(&(class_ ## _class)))
+#define Class(class_)                 ((const ObjectClass*)(&(class_ ## _class)))
 
 #define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_));
 
 typedef struct ObjectClass_ {
-   const void* extends;
+   const void* const extends;
    const Object_Display display;
    const Object_Delete delete;
    const Object_Compare compare;
 } ObjectClass;
 
 struct Object_ {
-   ObjectClass* klass;
+   const ObjectClass* klass;
 };
 
 typedef union {
@@ -46,7 +46,7 @@
    void* v;
 } Arg;
 
-extern ObjectClass Object_class;
+extern const ObjectClass Object_class;
 
 #ifndef NDEBUG
 
diff --git a/Panel.c b/Panel.c
index b97fbc9..5922d4c 100644
--- a/Panel.c
+++ b/Panel.c
@@ -27,7 +27,7 @@
    .eventHandler = Panel_selectByTyping,
 };
 
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar) {
+Panel* Panel_new(int x, int y, int w, int h, bool owner, const ObjectClass* type, FunctionBar* fuBar) {
    Panel* this;
    this = xMalloc(sizeof(Panel));
    Object_setClass(this, Class(Panel));
@@ -41,7 +41,7 @@
    free(this);
 }
 
-void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar) {
+void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar) {
    this->x = x;
    this->y = y;
    this->w = w;
diff --git a/Panel.h b/Panel.h
index 239de0a..7c4a6f2 100644
--- a/Panel.h
+++ b/Panel.h
@@ -35,7 +35,7 @@
    const Panel_EventHandler eventHandler;
 } PanelClass;
 
-#define As_Panel(this_)                ((PanelClass*)((this_)->super.klass))
+#define As_Panel(this_)                ((const PanelClass*)((this_)->super.klass))
 #define Panel_eventHandlerFn(this_)    As_Panel(this_)->eventHandler
 #define Panel_eventHandler(this_, ev_) As_Panel(this_)->eventHandler((Panel*)(this_), ev_)
 
@@ -62,11 +62,11 @@
 
 extern PanelClass Panel_class;
 
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar);
+Panel* Panel_new(int x, int y, int w, int h, bool owner, const ObjectClass* type, FunctionBar* fuBar);
 
 void Panel_delete(Object* cast);
 
-void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar);
+void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar);
 
 void Panel_done(Panel* this);
 
diff --git a/Process.h b/Process.h
index dd9c052..2ff7f5e 100644
--- a/Process.h
+++ b/Process.h
@@ -129,7 +129,7 @@
    const Process_WriteField writeField;
 } ProcessClass;
 
-#define As_Process(this_)              ((ProcessClass*)((this_)->super.klass))
+#define As_Process(this_)              ((const ProcessClass*)((this_)->super.klass))
 
 #define Process_getParentPid(process_)    (process_->tgid == process_->pid ? process_->ppid : process_->tgid)
 
diff --git a/ProcessList.c b/ProcessList.c
index 6ec7ce8..e509b89 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -15,7 +15,7 @@
 #include <string.h>
 
 
-ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) {
+ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) {
    this->processes = Vector_new(klass, true, DEFAULT_SIZE);
    this->processTable = Hashtable_new(140, false);
    this->usersTable = usersTable;
diff --git a/ProcessList.h b/ProcessList.h
index c9d1f28..164ff7b 100644
--- a/ProcessList.h
+++ b/ProcessList.h
@@ -69,7 +69,7 @@
 void ProcessList_goThroughEntries(ProcessList* pl);
 
 
-ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
+ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
 
 void ProcessList_done(ProcessList* this);
 
diff --git a/Vector.c b/Vector.c
index 3d4e646..a12d6bb 100644
--- a/Vector.c
+++ b/Vector.c
@@ -13,7 +13,7 @@
 #include <stdbool.h>
 
 
-Vector* Vector_new(ObjectClass* type, bool owner, int size) {
+Vector* Vector_new(const ObjectClass* type, bool owner, int size) {
    Vector* this;
 
    if (size == DEFAULT_SIZE)
diff --git a/Vector.h b/Vector.h
index e2de5e8..d0d42c6 100644
--- a/Vector.h
+++ b/Vector.h
@@ -17,14 +17,14 @@
 
 typedef struct Vector_ {
    Object **array;
-   ObjectClass* type;
+   const ObjectClass* type;
    int arraySize;
    int growthRate;
    int items;
    bool owner;
 } Vector;
 
-Vector* Vector_new(ObjectClass* type, bool owner, int size);
+Vector* Vector_new(const ObjectClass* type, bool owner, int size);
 
 void Vector_delete(Vector* this);
 
diff --git a/darwin/Platform.c b/darwin/Platform.c
index b7451e8..fabf552 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -216,7 +216,7 @@
    mtr->values[CPU_METER_KERNEL]
            = ((double)curr->cpu_ticks[CPU_STATE_SYSTEM] - (double)prev->cpu_ticks[CPU_STATE_SYSTEM])* 100.0 / total;
 
-   Meter_setItems(mtr, 3);
+   mtr->curItems = 3;
 
    /* Convert to percent and return */
    total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL];
diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c
index 8fd929e..3328240 100644
--- a/dragonflybsd/Platform.c
+++ b/dragonflybsd/Platform.c
@@ -167,11 +167,11 @@
    if (this->pl->settings->detailedCPUTime) {
       v[CPU_METER_KERNEL]  = cpuData->systemPercent;
       v[CPU_METER_IRQ]     = cpuData->irqPercent;
-      Meter_setItems(this, 4);
+      this->curItems = 4;
       percent = v[0]+v[1]+v[2]+v[3];
    } else {
       v[2] = cpuData->systemAllPercent;
-      Meter_setItems(this, 3);
+      this->curItems = 3;
       percent = v[0]+v[1]+v[2];
    }
 
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
index 5925685..3e4b9b7 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -170,11 +170,11 @@
    if (this->pl->settings->detailedCPUTime) {
       v[CPU_METER_KERNEL]  = cpuData->systemPercent;
       v[CPU_METER_IRQ]     = cpuData->irqPercent;
-      Meter_setItems(this, 4);
+      this->curItems = 4;
       percent = v[0]+v[1]+v[2]+v[3];
    } else {
       v[2] = cpuData->systemAllPercent;
-      Meter_setItems(this, 3);
+      this->curItems = 3;
       percent = v[0]+v[1]+v[2];
    }
 
diff --git a/linux/Platform.c b/linux/Platform.c
index b0053bc..6ec0d07 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -191,7 +191,7 @@
       v[CPU_METER_STEAL]   = cpuData->stealPeriod / total * 100.0;
       v[CPU_METER_GUEST]   = cpuData->guestPeriod / total * 100.0;
       v[CPU_METER_IOWAIT]  = cpuData->ioWaitPeriod / total * 100.0;
-      Meter_setItems(this, 8);
+      this->curItems = 8;
       if (this->pl->settings->accountGuestInCPUMeter) {
          percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];
       } else {
@@ -200,7 +200,7 @@
    } else {
       v[2] = cpuData->systemAllPeriod / total * 100.0;
       v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0;
-      Meter_setItems(this, 4);
+      this->curItems = 4;
       percent = v[0]+v[1]+v[2]+v[3];
    }
    percent = CLAMP(percent, 0.0, 100.0);
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 6649064..0368d72 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -173,13 +173,13 @@
       v[CPU_METER_GUEST]   = 0.0;
       v[CPU_METER_IOWAIT]  = 0.0;
       v[CPU_METER_FREQUENCY] = NAN;
-      Meter_setItems(this, 8);
+      this->curItems = 8;
       totalPercent = v[0]+v[1]+v[2]+v[3];
    } 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];
-      Meter_setItems(this, 4);
+      this->curItems = 4;
    }
 
    totalPercent = CLAMP(totalPercent, 0.0, 100.0);
diff --git a/solaris/Platform.c b/solaris/Platform.c
index 4a5daee..5f73734 100644
--- a/solaris/Platform.c
+++ b/solaris/Platform.c
@@ -185,11 +185,11 @@
    if (this->pl->settings->detailedCPUTime) {
       v[CPU_METER_KERNEL]  = cpuData->systemPercent;
       v[CPU_METER_IRQ]     = cpuData->irqPercent;
-      Meter_setItems(this, 4);
+      this->curItems = 4;
       percent = v[0]+v[1]+v[2]+v[3];
    } else {
       v[2] = cpuData->systemAllPercent;
-      Meter_setItems(this, 3);
+      this->curItems = 3;
       percent = v[0]+v[1]+v[2];
    }
 
diff --git a/zfs/ZfsArcMeter.c b/zfs/ZfsArcMeter.c
index 94bffdc..d52605c 100644
--- a/zfs/ZfsArcMeter.c
+++ b/zfs/ZfsArcMeter.c
@@ -38,7 +38,7 @@
    // "Hide" the last value so it can
    // only be accessed by index and is not
    // displayed by the Bar or Graph style
-   Meter_setItems(this, 5);
+   this->curItems = 5;
    this->values[5] = stats->size;
 }