Hold only a const version of Settings in Process

This commit is contained in:
Christian Göttsche
2020-10-21 21:26:05 +02:00
committed by cgzones
parent 7109172431
commit 4eb443926f
20 changed files with 28 additions and 28 deletions

View File

@ -165,11 +165,11 @@ ProcessPidColumn Process_pidColumns[] = {
{ .id = 0, .label = NULL },
};
OpenBSDProcess* OpenBSDProcess_new(Settings* settings) {
Process* OpenBSDProcess_new(const Settings* settings) {
OpenBSDProcess* this = xCalloc(sizeof(OpenBSDProcess), 1);
Object_setClass(this, Class(OpenBSDProcess));
Process_init(&this->super, settings);
return this;
return &this->this;
}
void Process_delete(Object* cast) {

View File

@ -27,7 +27,7 @@ extern ProcessFieldData Process_fields[];
extern ProcessPidColumn Process_pidColumns[];
OpenBSDProcess* OpenBSDProcess_new(Settings* settings);
Process* OpenBSDProcess_new(const Settings* settings);
void Process_delete(Object* cast);

View File

@ -203,7 +203,7 @@ static inline void OpenBSDProcessList_scanProcs(OpenBSDProcessList* this) {
kproc = &kprocs[i];
preExisting = false;
proc = ProcessList_getProcess(&this->super, kproc->p_pid, &preExisting, (Process_New) OpenBSDProcess_new);
proc = ProcessList_getProcess(&this->super, kproc->p_pid, &preExisting, OpenBSDProcess_new);
fp = (OpenBSDProcess*) proc;
proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc))