aboutsummaryrefslogtreecommitdiffstats
path: root/MemoryMeter.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2023-02-05 04:25:56 +0100
committerDaniel Lange <DLange@git.local>2023-02-05 04:25:56 +0100
commitf288666edc9180a2e81e6655951878124f321df6 (patch)
treeda70bf44b2423f6f8e9a070c063fed79d190b489 /MemoryMeter.c
parent937052b231259a47d881d539ad5748245ef55b99 (diff)
downloaddebian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.gz
debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.bz2
debian_htop-f288666edc9180a2e81e6655951878124f321df6.zip
New upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'MemoryMeter.c')
-rw-r--r--MemoryMeter.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/MemoryMeter.c b/MemoryMeter.c
index 89e242c..ac01dfe 100644
--- a/MemoryMeter.c
+++ b/MemoryMeter.c
@@ -29,14 +29,14 @@ static void MemoryMeter_updateValues(Meter* this) {
int written;
/* shared and available memory are not supported on all platforms */
- this->values[2] = NAN;
- this->values[4] = NAN;
+ this->values[MEMORY_METER_SHARED] = NAN;
+ this->values[MEMORY_METER_AVAILABLE] = NAN;
Platform_setMemoryValues(this);
/* Do not print available memory in bar mode */
this->curItems = 4;
- written = Meter_humanUnit(buffer, this->values[0], size);
+ written = Meter_humanUnit(buffer, this->values[MEMORY_METER_USED], size);
METER_BUFFER_CHECK(buffer, size, written);
METER_BUFFER_APPEND_CHR(buffer, size, '/');
@@ -52,28 +52,28 @@ static void MemoryMeter_display(const Object* cast, RichString* out) {
Meter_humanUnit(buffer, this->total, sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer);
- Meter_humanUnit(buffer, this->values[0], sizeof(buffer));
+ Meter_humanUnit(buffer, this->values[MEMORY_METER_USED], sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:");
RichString_appendAscii(out, CRT_colors[MEMORY_USED], buffer);
- Meter_humanUnit(buffer, this->values[1], sizeof(buffer));
+ Meter_humanUnit(buffer, this->values[MEMORY_METER_BUFFERS], sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_TEXT], " buffers:");
RichString_appendAscii(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer);
/* shared memory is not supported on all platforms */
- if (!isnan(this->values[2])) {
- Meter_humanUnit(buffer, this->values[2], sizeof(buffer));
+ if (!isnan(this->values[MEMORY_METER_SHARED])) {
+ Meter_humanUnit(buffer, this->values[MEMORY_METER_SHARED], sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_TEXT], " shared:");
RichString_appendAscii(out, CRT_colors[MEMORY_SHARED], buffer);
}
- Meter_humanUnit(buffer, this->values[3], sizeof(buffer));
+ Meter_humanUnit(buffer, this->values[MEMORY_METER_CACHE], sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_TEXT], " cache:");
RichString_appendAscii(out, CRT_colors[MEMORY_CACHE], buffer);
/* available memory is not supported on all platforms */
- if (!isnan(this->values[4])) {
- Meter_humanUnit(buffer, this->values[4], sizeof(buffer));
+ if (!isnan(this->values[MEMORY_METER_AVAILABLE])) {
+ Meter_humanUnit(buffer, this->values[MEMORY_METER_AVAILABLE], sizeof(buffer));
RichString_appendAscii(out, CRT_colors[METER_TEXT], " available:");
RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy