diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:18 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:18 +0200 |
commit | 2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2 (patch) | |
tree | afaa05858260763c1d25fa092f3905cf51ffd7b2 /CPUMeter.c | |
parent | 031c3bb95f3d0a74d985286068baa6dd4d29d83f (diff) | |
download | debian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.tar.gz debian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.tar.bz2 debian_htop-2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2.zip |
Imported Upstream version 0.5.4upstream/0.5.4
Diffstat (limited to 'CPUMeter.c')
-rw-r--r-- | CPUMeter.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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); } |