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 --- MemoryMeter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'MemoryMeter.c') diff --git a/MemoryMeter.c b/MemoryMeter.c index 01a9ac1..43029ff 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -35,9 +35,9 @@ struct MemoryMeter_ { MemoryMeter* MemoryMeter_new(ProcessList* pl) { MemoryMeter* this = malloc(sizeof(MemoryMeter)); Meter_init((Meter*)this, String_copy("Memory"), String_copy("Mem"), 3); - ((Meter*)this)->attributes[0] = CRT_colors[MEMORY_USED]; - ((Meter*)this)->attributes[1] = CRT_colors[MEMORY_BUFFERS]; - ((Meter*)this)->attributes[2] = CRT_colors[MEMORY_CACHE]; + ((Meter*)this)->attributes[0] = &(CRT_colors[MEMORY_USED]); + ((Meter*)this)->attributes[1] = &(CRT_colors[MEMORY_BUFFERS]); + ((Meter*)this)->attributes[2] = &(CRT_colors[MEMORY_CACHE]); ((Meter*)this)->setValues = MemoryMeter_setValues; ((Object*)this)->display = MemoryMeter_display; this->pl = pl; @@ -88,11 +88,11 @@ void MemoryMeter_display(Object* cast, RichString* out) { RichString_append(out, CRT_colors[METER_VALUE], buffer); sprintf(buffer, format, usedMem); RichString_append(out, CRT_colors[METER_TEXT], "used:"); - RichString_append(out, meter->attributes[0], buffer); + RichString_append(out, *(meter->attributes[0]), buffer); sprintf(buffer, format, buffersMem); RichString_append(out, CRT_colors[METER_TEXT], "buffers:"); - RichString_append(out, meter->attributes[1], buffer); + RichString_append(out, *(meter->attributes[1]), buffer); sprintf(buffer, format, cachedMem); RichString_append(out, CRT_colors[METER_TEXT], "cache:"); - RichString_append(out, meter->attributes[2], buffer); + RichString_append(out, *(meter->attributes[2]), buffer); } -- cgit v1.2.3