Mark process parameter of Process_writeField consistently const

This commit is contained in:
Christian Göttsche 2020-10-21 21:26:01 +02:00 committed by cgzones
parent 72103e9613
commit 7109172431
10 changed files with 19 additions and 19 deletions

View File

@ -25,7 +25,7 @@ const ProcessClass DragonFlyBSDProcess_class = {
.delete = Process_delete, .delete = Process_delete,
.compare = DragonFlyBSDProcess_compare .compare = DragonFlyBSDProcess_compare
}, },
.writeField = (Process_WriteField) DragonFlyBSDProcess_writeField, .writeField = DragonFlyBSDProcess_writeField,
}; };
ProcessFieldData Process_fields[] = { ProcessFieldData Process_fields[] = {
@ -83,8 +83,8 @@ void Process_delete(Object* cast) {
free(this); free(this);
} }
void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { void DragonFlyBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) {
DragonFlyBSDProcess* fp = (DragonFlyBSDProcess*) this; const DragonFlyBSDProcess* fp = (const DragonFlyBSDProcess*) this;
char buffer[256]; buffer[255] = '\0'; char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR]; int attr = CRT_colors[DEFAULT_COLOR];
int n = sizeof(buffer) - 1; int n = sizeof(buffer) - 1;

View File

@ -37,7 +37,7 @@ DragonFlyBSDProcess* DragonFlyBSDProcess_new(Settings* settings);
void Process_delete(Object* cast); void Process_delete(Object* cast);
void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField field); void DragonFlyBSDProcess_writeField(const Process* this, RichString* str, ProcessField field);
long DragonFlyBSDProcess_compare(const void* v1, const void* v2); long DragonFlyBSDProcess_compare(const void* v1, const void* v2);

View File

@ -24,7 +24,7 @@ const ProcessClass FreeBSDProcess_class = {
.delete = Process_delete, .delete = Process_delete,
.compare = FreeBSDProcess_compare .compare = FreeBSDProcess_compare
}, },
.writeField = (Process_WriteField) FreeBSDProcess_writeField, .writeField = FreeBSDProcess_writeField,
}; };
ProcessFieldData Process_fields[] = { ProcessFieldData Process_fields[] = {
@ -83,8 +83,8 @@ void Process_delete(Object* cast) {
free(this); free(this);
} }
void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { void FreeBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) {
FreeBSDProcess* fp = (FreeBSDProcess*) this; const FreeBSDProcess* fp = (const FreeBSDProcess*) this;
char buffer[256]; buffer[255] = '\0'; char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR]; int attr = CRT_colors[DEFAULT_COLOR];
int n = sizeof(buffer) - 1; int n = sizeof(buffer) - 1;

View File

@ -43,7 +43,7 @@ FreeBSDProcess* FreeBSDProcess_new(Settings* settings);
void Process_delete(Object* cast); void Process_delete(Object* cast);
void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field); void FreeBSDProcess_writeField(const Process* this, RichString* str, ProcessField field);
long FreeBSDProcess_compare(const void* v1, const void* v2); long FreeBSDProcess_compare(const void* v1, const void* v2);

View File

@ -135,7 +135,7 @@ const ProcessClass LinuxProcess_class = {
.delete = Process_delete, .delete = Process_delete,
.compare = LinuxProcess_compare .compare = LinuxProcess_compare
}, },
.writeField = (Process_WriteField) LinuxProcess_writeField, .writeField = LinuxProcess_writeField,
}; };
LinuxProcess* LinuxProcess_new(Settings* settings) { LinuxProcess* LinuxProcess_new(Settings* settings) {
@ -197,8 +197,8 @@ void LinuxProcess_printDelay(float delay_percent, char* buffer, int n) {
} }
#endif #endif
void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field) { void LinuxProcess_writeField(const Process* this, RichString* str, ProcessField field) {
LinuxProcess* lp = (LinuxProcess*) this; const LinuxProcess* lp = (const LinuxProcess*) this;
bool coloring = this->settings->highlightMegabytes; bool coloring = this->settings->highlightMegabytes;
char buffer[256]; buffer[255] = '\0'; char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR]; int attr = CRT_colors[DEFAULT_COLOR];

View File

@ -189,7 +189,7 @@ bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio);
void LinuxProcess_printDelay(float delay_percent, char* buffer, int n); void LinuxProcess_printDelay(float delay_percent, char* buffer, int n);
#endif #endif
void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field); void LinuxProcess_writeField(const Process* this, RichString* str, ProcessField field);
long LinuxProcess_compare(const void* v1, const void* v2); long LinuxProcess_compare(const void* v1, const void* v2);

View File

@ -24,7 +24,7 @@ const ProcessClass OpenBSDProcess_class = {
.delete = Process_delete, .delete = Process_delete,
.compare = OpenBSDProcess_compare .compare = OpenBSDProcess_compare
}, },
.writeField = (Process_WriteField) OpenBSDProcess_writeField, .writeField = OpenBSDProcess_writeField,
}; };
ProcessFieldData Process_fields[] = { ProcessFieldData Process_fields[] = {
@ -178,7 +178,7 @@ void Process_delete(Object* cast) {
free(this); free(this);
} }
void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { void OpenBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) {
//OpenBSDProcess* fp = (OpenBSDProcess*) this; //OpenBSDProcess* fp = (OpenBSDProcess*) this;
char buffer[256]; buffer[255] = '\0'; char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR]; int attr = CRT_colors[DEFAULT_COLOR];

View File

@ -31,7 +31,7 @@ OpenBSDProcess* OpenBSDProcess_new(Settings* settings);
void Process_delete(Object* cast); void Process_delete(Object* cast);
void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field); void OpenBSDProcess_writeField(const Process* this, RichString* str, ProcessField field);
long OpenBSDProcess_compare(const void* v1, const void* v2); long OpenBSDProcess_compare(const void* v1, const void* v2);

View File

@ -25,7 +25,7 @@ const ProcessClass SolarisProcess_class = {
.delete = Process_delete, .delete = Process_delete,
.compare = SolarisProcess_compare .compare = SolarisProcess_compare
}, },
.writeField = (Process_WriteField) SolarisProcess_writeField, .writeField = SolarisProcess_writeField,
}; };
ProcessFieldData Process_fields[] = { ProcessFieldData Process_fields[] = {
@ -93,8 +93,8 @@ void Process_delete(Object* cast) {
free(sp); free(sp);
} }
void SolarisProcess_writeField(Process* this, RichString* str, ProcessField field) { void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field) {
SolarisProcess* sp = (SolarisProcess*) this; const SolarisProcess* sp = (const SolarisProcess*) this;
char buffer[256]; buffer[255] = '\0'; char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR]; int attr = CRT_colors[DEFAULT_COLOR];
int n = sizeof(buffer) - 1; int n = sizeof(buffer) - 1;

View File

@ -54,7 +54,7 @@ SolarisProcess* SolarisProcess_new(Settings* settings);
void Process_delete(Object* cast); void Process_delete(Object* cast);
void SolarisProcess_writeField(Process* this, RichString* str, ProcessField field); void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field);
long SolarisProcess_compare(const void* v1, const void* v2); long SolarisProcess_compare(const void* v1, const void* v2);