From 2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:18 +0200 Subject: Imported Upstream version 0.5.4 --- CPUMeter.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'CPUMeter.c') diff --git a/CPUMeter.c b/CPUMeter.c index d624802..8e9918b 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -1,6 +1,6 @@ /* -htop -(C) 2004 Hisham H. Muhammad +htop - CPUMeter.c +(C) 2004,2005 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ @@ -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] = &(CRT_colors[CPU_NICE]); + ((Meter*)this)->attributes[1] = &(CRT_colors[CPU_NORMAL]); + ((Meter*)this)->attributes[2] = &(CRT_colors[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, *(this->attributes[1]), 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, *(this->attributes[2]), 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, *(this->attributes[0]), buffer); } -- cgit v1.2.3