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

committed by
cgzones

parent
7109172431
commit
4eb443926f
@ -28,7 +28,7 @@ const ProcessClass DarwinProcess_class = {
|
||||
.writeField = Process_writeField,
|
||||
};
|
||||
|
||||
DarwinProcess* DarwinProcess_new(Settings* settings) {
|
||||
Process* DarwinProcess_new(const Settings* settings) {
|
||||
DarwinProcess* this = xCalloc(1, sizeof(DarwinProcess));
|
||||
Object_setClass(this, Class(DarwinProcess));
|
||||
Process_init(&this->super, settings);
|
||||
@ -37,7 +37,7 @@ DarwinProcess* DarwinProcess_new(Settings* settings) {
|
||||
this->stime = 0;
|
||||
this->taskAccess = true;
|
||||
|
||||
return this;
|
||||
return &this->super;
|
||||
}
|
||||
|
||||
void Process_delete(Object* cast) {
|
||||
|
@ -22,7 +22,7 @@ typedef struct DarwinProcess_ {
|
||||
|
||||
extern const ProcessClass DarwinProcess_class;
|
||||
|
||||
DarwinProcess* DarwinProcess_new(Settings* settings);
|
||||
Process* DarwinProcess_new(const Settings* settings);
|
||||
|
||||
void Process_delete(Object* cast);
|
||||
|
||||
|
@ -186,7 +186,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
|
||||
ps = ProcessList_getKInfoProcs(&count);
|
||||
|
||||
for(size_t i = 0; i < count; ++i) {
|
||||
proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, (Process_New)DarwinProcess_new);
|
||||
proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, DarwinProcess_new);
|
||||
|
||||
DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], preExisting);
|
||||
DarwinProcess_setFromLibprocPidinfo(proc, dpl);
|
||||
|
Reference in New Issue
Block a user