mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Hold only a const version of Settings in Process
This commit is contained in:

committed by
cgzones

parent
7109172431
commit
4eb443926f
@ -138,11 +138,11 @@ const ProcessClass LinuxProcess_class = {
|
||||
.writeField = LinuxProcess_writeField,
|
||||
};
|
||||
|
||||
LinuxProcess* LinuxProcess_new(Settings* settings) {
|
||||
Process* LinuxProcess_new(const Settings* settings) {
|
||||
LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess));
|
||||
Object_setClass(this, Class(LinuxProcess));
|
||||
Process_init(&this->super, settings);
|
||||
return this;
|
||||
return &this->super;
|
||||
}
|
||||
|
||||
void Process_delete(Object* cast) {
|
||||
|
@ -167,7 +167,7 @@ extern ProcessPidColumn Process_pidColumns[];
|
||||
|
||||
extern const ProcessClass LinuxProcess_class;
|
||||
|
||||
LinuxProcess* LinuxProcess_new(Settings* settings);
|
||||
Process* LinuxProcess_new(const Settings* settings);
|
||||
|
||||
void Process_delete(Object* cast);
|
||||
|
||||
|
@ -971,7 +971,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||
continue;
|
||||
|
||||
bool preExisting = false;
|
||||
Process* proc = ProcessList_getProcess(pl, pid, &preExisting, (Process_New) LinuxProcess_new);
|
||||
Process* proc = ProcessList_getProcess(pl, pid, &preExisting, LinuxProcess_new);
|
||||
proc->tgid = parent ? parent->pid : pid;
|
||||
|
||||
LinuxProcess* lp = (LinuxProcess*) proc;
|
||||
|
Reference in New Issue
Block a user