From 266ab52b3a741a58fb17c48b0f7939d7c5d266de Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:19 +0200 Subject: Imported Upstream version 0.6 --- CPUMeter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'CPUMeter.c') diff --git a/CPUMeter.c b/CPUMeter.c index 8e9918b..c59c2c4 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -49,9 +49,9 @@ CPUMeter* CPUMeter_new(ProcessList* pl, int processor) { Meter_init((Meter*)this, NULL, caption, 3); ((Meter*)this)->name = malloc(20); sprintf(((Meter*)this)->name, "CPU(%d)", processor); - ((Meter*)this)->attributes[0] = &(CRT_colors[CPU_NICE]); - ((Meter*)this)->attributes[1] = &(CRT_colors[CPU_NORMAL]); - ((Meter*)this)->attributes[2] = &(CRT_colors[CPU_KERNEL]); + ((Meter*)this)->attributes[0] = CPU_NICE; + ((Meter*)this)->attributes[1] = CPU_NORMAL; + ((Meter*)this)->attributes[2] = CPU_KERNEL; ((Meter*)this)->setValues = CPUMeter_setValues; ((Object*)this)->display = CPUMeter_display; ((Meter*)this)->total = 1.0; @@ -76,11 +76,11 @@ void CPUMeter_display(Object* cast, RichString* out) { RichString_prune(out); sprintf(buffer, "%5.1f%% ", this->values[1] * 100.0); RichString_append(out, CRT_colors[METER_TEXT], ":"); - RichString_append(out, *(this->attributes[1]), buffer); + RichString_append(out, CRT_colors[CPU_NORMAL], buffer); sprintf(buffer, "%5.1f%% ", this->values[2] * 100.0); RichString_append(out, CRT_colors[METER_TEXT], "sys:"); - RichString_append(out, *(this->attributes[2]), buffer); + RichString_append(out, CRT_colors[CPU_KERNEL], buffer); sprintf(buffer, "%5.1f%% ", this->values[0] * 100.0); RichString_append(out, CRT_colors[METER_TEXT], "low:"); - RichString_append(out, *(this->attributes[0]), buffer); + RichString_append(out, CRT_colors[CPU_NICE], buffer); } -- cgit v1.2.3