Mark several non-modified pointer variables const

This commit is contained in:
Christian Göttsche
2021-01-05 23:42:55 +01:00
committed by BenBE
parent 1b2d48bc9a
commit d72b0a682e
33 changed files with 97 additions and 100 deletions

View File

@ -93,7 +93,7 @@ static const char* alignedProcessFieldTitle(ProcessField field) {
return titleBuffer;
}
void ProcessList_printHeader(ProcessList* this, RichString* header) {
void ProcessList_printHeader(const ProcessList* this, RichString* header) {
RichString_prune(header);
const Settings* settings = this->settings;
@ -141,11 +141,11 @@ void ProcessList_add(ProcessList* this, Process* p) {
assert(Hashtable_count(this->processTable) == Vector_count(this->processes));
}
void ProcessList_remove(ProcessList* this, Process* p) {
void ProcessList_remove(ProcessList* this, const Process* p) {
assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1);
assert(Hashtable_get(this->processTable, p->pid) != NULL);
Process* pp = Hashtable_remove(this->processTable, p->pid);
const Process* pp = Hashtable_remove(this->processTable, p->pid);
assert(pp == p); (void)pp;
pid_t pid = p->pid;
@ -169,7 +169,7 @@ Process* ProcessList_get(ProcessList* this, int idx) {
return (Process*)Vector_get(this->processes, idx);
}
int ProcessList_size(ProcessList* this) {
int ProcessList_size(const ProcessList* this) {
return Vector_size(this->processes);
}