Mark remaining classes const

This commit is contained in:
Christian Göttsche 2020-10-13 14:35:30 +02:00 committed by cgzones
parent 5cc20e7cb2
commit 7af06659e2
19 changed files with 30 additions and 34 deletions

View File

@ -67,7 +67,7 @@ static void MaskItem_display(const Object* cast, RichString* out) {
RichString_append(out, CRT_colors[CHECK_TEXT], this->text); RichString_append(out, CRT_colors[CHECK_TEXT], this->text);
} }
static ObjectClass MaskItem_class = { static const ObjectClass MaskItem_class = {
.display = MaskItem_display, .display = MaskItem_display,
.delete = MaskItem_delete .delete = MaskItem_delete
}; };

View File

@ -16,7 +16,7 @@ in the source distribution for its full text.
#include <mach/mach.h> #include <mach/mach.h>
ProcessClass DarwinProcess_class = { const ProcessClass DarwinProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -20,7 +20,7 @@ typedef struct DarwinProcess_ {
bool taskAccess; bool taskAccess;
} DarwinProcess; } DarwinProcess;
extern ProcessClass DarwinProcess_class; extern const ProcessClass DarwinProcess_class;
DarwinProcess* DarwinProcess_new(Settings* settings); DarwinProcess* DarwinProcess_new(Settings* settings);

View File

@ -18,7 +18,7 @@ in the source distribution for its full text.
#include <sys/syscall.h> #include <sys/syscall.h>
ProcessClass DragonFlyBSDProcess_class = { const ProcessClass DragonFlyBSDProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -27,7 +27,7 @@ typedef struct DragonFlyBSDProcess_ {
//#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
#define Process_isUserlandThread(_process) (_process->nlwp > 1) #define Process_isUserlandThread(_process) (_process->nlwp > 1)
extern ProcessClass DragonFlyBSDProcess_class; extern const ProcessClass DragonFlyBSDProcess_class;
extern ProcessFieldData Process_fields[]; extern ProcessFieldData Process_fields[];

View File

@ -17,7 +17,7 @@ in the source distribution for its full text.
#include <sys/syscall.h> #include <sys/syscall.h>
ProcessClass FreeBSDProcess_class = { const ProcessClass FreeBSDProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -25,7 +25,7 @@ typedef struct FreeBSDProcess_ {
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
extern ProcessClass FreeBSDProcess_class; extern const ProcessClass FreeBSDProcess_class;
extern ProcessFieldData Process_fields[]; extern ProcessFieldData Process_fields[];

View File

@ -126,7 +126,7 @@ ProcessPidColumn Process_pidColumns[] = {
{ .id = 0, .label = NULL }, { .id = 0, .label = NULL },
}; };
ProcessClass LinuxProcess_class = { const ProcessClass LinuxProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -157,7 +157,7 @@ extern ProcessFieldData Process_fields[];
extern ProcessPidColumn Process_pidColumns[]; extern ProcessPidColumn Process_pidColumns[];
extern ProcessClass LinuxProcess_class; extern const ProcessClass LinuxProcess_class;
LinuxProcess* LinuxProcess_new(Settings* settings); LinuxProcess* LinuxProcess_new(Settings* settings);

View File

@ -16,7 +16,7 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
}*/ }*/
static int PressureStallMeter_attributes[] = { static const int PressureStallMeter_attributes[] = {
PRESSURE_STALL_TEN, PRESSURE_STALL_SIXTY, PRESSURE_STALL_THREEHUNDRED PRESSURE_STALL_TEN, PRESSURE_STALL_SIXTY, PRESSURE_STALL_THREEHUNDRED
}; };
@ -52,7 +52,7 @@ static void PressureStallMeter_display(const Object* cast, RichString* out) {
RichString_append(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer); RichString_append(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer);
} }
MeterClass PressureStallCPUSomeMeter_class = { const MeterClass PressureStallCPUSomeMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,
@ -68,7 +68,7 @@ MeterClass PressureStallCPUSomeMeter_class = {
.caption = "Some CPU pressure: " .caption = "Some CPU pressure: "
}; };
MeterClass PressureStallIOSomeMeter_class = { const MeterClass PressureStallIOSomeMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,
@ -84,7 +84,7 @@ MeterClass PressureStallIOSomeMeter_class = {
.caption = "Some IO pressure: " .caption = "Some IO pressure: "
}; };
MeterClass PressureStallIOFullMeter_class = { const MeterClass PressureStallIOFullMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,
@ -100,7 +100,7 @@ MeterClass PressureStallIOFullMeter_class = {
.caption = "Full IO pressure: " .caption = "Full IO pressure: "
}; };
MeterClass PressureStallMemorySomeMeter_class = { const MeterClass PressureStallMemorySomeMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,
@ -116,7 +116,7 @@ MeterClass PressureStallMemorySomeMeter_class = {
.caption = "Some Mem pressure: " .caption = "Some Mem pressure: "
}; };
MeterClass PressureStallMemoryFullMeter_class = { const MeterClass PressureStallMemoryFullMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,

View File

@ -12,14 +12,14 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
extern MeterClass PressureStallCPUSomeMeter_class; extern const MeterClass PressureStallCPUSomeMeter_class;
extern MeterClass PressureStallIOSomeMeter_class; extern const MeterClass PressureStallIOSomeMeter_class;
extern MeterClass PressureStallIOFullMeter_class; extern const MeterClass PressureStallIOFullMeter_class;
extern MeterClass PressureStallMemorySomeMeter_class; extern const MeterClass PressureStallMemorySomeMeter_class;
extern MeterClass PressureStallMemoryFullMeter_class; extern const MeterClass PressureStallMemoryFullMeter_class;
#endif #endif

View File

@ -17,7 +17,7 @@ in the source distribution for its full text.
#include <sys/syscall.h> #include <sys/syscall.h>
ProcessClass OpenBSDProcess_class = { const ProcessClass OpenBSDProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -21,7 +21,7 @@ typedef struct OpenBSDProcess_ {
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
extern ProcessClass OpenBSDProcess_class; extern const ProcessClass OpenBSDProcess_class;
extern ProcessFieldData Process_fields[]; extern ProcessFieldData Process_fields[];

View File

@ -18,7 +18,7 @@ in the source distribution for its full text.
#include <sys/syscall.h> #include <sys/syscall.h>
ProcessClass SolarisProcess_class = { const ProcessClass SolarisProcess_class = {
.super = { .super = {
.extends = Class(Process), .extends = Class(Process),
.display = Process_display, .display = Process_display,

View File

@ -44,7 +44,7 @@ typedef struct SolarisProcess_ {
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
extern ProcessClass SolarisProcess_class; extern const ProcessClass SolarisProcess_class;
extern ProcessFieldData Process_fields[]; extern ProcessFieldData Process_fields[];

View File

@ -23,7 +23,7 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
}*/ }*/
int ZfsArcMeter_attributes[] = { static const int ZfsArcMeter_attributes[] = {
ZFS_MFU, ZFS_MRU, ZFS_ANON, ZFS_HEADER, ZFS_OTHER ZFS_MFU, ZFS_MRU, ZFS_ANON, ZFS_HEADER, ZFS_OTHER
}; };
@ -86,7 +86,7 @@ static void ZfsArcMeter_display(const Object* cast, RichString* out) {
} }
} }
MeterClass ZfsArcMeter_class = { const MeterClass ZfsArcMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,

View File

@ -11,10 +11,8 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
extern int ZfsArcMeter_attributes[];
void ZfsArcMeter_readStats(Meter* this, ZfsArcStats* stats); void ZfsArcMeter_readStats(Meter* this, ZfsArcStats* stats);
extern MeterClass ZfsArcMeter_class; extern const MeterClass ZfsArcMeter_class;
#endif #endif

View File

@ -23,7 +23,7 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
}*/ }*/
int ZfsCompressedArcMeter_attributes[] = { static const int ZfsCompressedArcMeter_attributes[] = {
ZFS_COMPRESSED ZFS_COMPRESSED
}; };
@ -68,7 +68,7 @@ static void ZfsCompressedArcMeter_display(const Object* cast, RichString* out) {
} }
} }
MeterClass ZfsCompressedArcMeter_class = { const MeterClass ZfsCompressedArcMeter_class = {
.super = { .super = {
.extends = Class(Meter), .extends = Class(Meter),
.delete = Meter_delete, .delete = Meter_delete,

View File

@ -11,10 +11,8 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
extern int ZfsCompressedArcMeter_attributes[];
void ZfsCompressedArcMeter_readStats(Meter* this, ZfsArcStats* stats); void ZfsCompressedArcMeter_readStats(Meter* this, ZfsArcStats* stats);
extern MeterClass ZfsCompressedArcMeter_class; extern const MeterClass ZfsCompressedArcMeter_class;
#endif #endif