From 79ad39c718bfb2973d610c2d039a5024354e602f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 6 Oct 2020 12:28:11 +0200 Subject: Mark Object pointer to _display function const --- Process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Process.c') diff --git a/Process.c b/Process.c index ea703e4b..2d5ffb4f 100644 --- a/Process.c +++ b/Process.c @@ -181,9 +181,9 @@ void Process_printTime(RichString* str, unsigned long long totalHundredths) { } } -static inline void Process_writeCommand(Process* this, int attr, int baseattr, RichString* str) { +static inline void Process_writeCommand(const Process* this, int attr, int baseattr, RichString* str) { int start = RichString_size(str), finish = 0; - char* comm = this->comm; + const char* comm = this->comm; if (this->settings->highlightBaseName || !this->settings->showProgramPath) { int i, basename = 0; @@ -240,7 +240,7 @@ void Process_outputRate(RichString* str, char* buffer, int n, double rate, int c } } -void Process_writeField(Process* this, RichString* str, ProcessField field) { +void Process_writeField(const Process* this, RichString* str, ProcessField field) { char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; int baseattr = CRT_colors[PROCESS_BASENAME]; @@ -366,9 +366,9 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) { RichString_append(str, attr, buffer); } -void Process_display(Object* cast, RichString* out) { - Process* this = (Process*) cast; - ProcessField* fields = this->settings->fields; +void Process_display(const Object* cast, RichString* out) { + const Process* this = (const Process*) cast; + const ProcessField* fields = this->settings->fields; RichString_prune(out); for (int i = 0; fields[i]; i++) As_Process(this)->writeField(this, out, fields[i]); -- cgit v1.2.3