Solaris: make Process callbacks static

Fixes prototype of SolarisProcess_compareByKey since 90ea3ac3
This commit is contained in:
Christian Göttsche 2021-01-09 20:17:31 +01:00
parent 6301d5c1da
commit a076488809
2 changed files with 13 additions and 17 deletions

View File

@ -18,17 +18,6 @@ in the source distribution for its full text.
#include <sys/syscall.h> #include <sys/syscall.h>
const ProcessClass SolarisProcess_class = {
.super = {
.extends = Class(Process),
.display = Process_display,
.delete = Process_delete,
.compare = Process_compare
},
.writeField = SolarisProcess_writeField,
.compareByKey = SolarisProcess_compareByKey
};
const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
[0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
[PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, },
@ -78,7 +67,7 @@ void Process_delete(Object* cast) {
free(sp); free(sp);
} }
void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field) { static void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field) {
const SolarisProcess* sp = (const 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];
@ -101,7 +90,7 @@ void SolarisProcess_writeField(const Process* this, RichString* str, ProcessFiel
RichString_appendWide(str, attr, buffer); RichString_appendWide(str, attr, buffer);
} }
int SolarisProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { static int SolarisProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) {
const SolarisProcess* p1 = (const SolarisProcess*)v1; const SolarisProcess* p1 = (const SolarisProcess*)v1;
const SolarisProcess* p2 = (const SolarisProcess*)v2; const SolarisProcess* p2 = (const SolarisProcess*)v2;
@ -140,3 +129,14 @@ bool Process_isThread(const Process* this) {
return 0; return 0;
} }
} }
const ProcessClass SolarisProcess_class = {
.super = {
.extends = Class(Process),
.display = Process_display,
.delete = Process_delete,
.compare = Process_compare
},
.writeField = SolarisProcess_writeField,
.compareByKey = SolarisProcess_compareByKey
};

View File

@ -40,10 +40,6 @@ Process* SolarisProcess_new(const Settings* settings);
void Process_delete(Object* cast); void Process_delete(Object* cast);
void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field);
long SolarisProcess_compareByKey(const Process* v1, const Process* v2, ProcessField field);
bool Process_isThread(const Process* this); bool Process_isThread(const Process* this);
#endif #endif