summaryrefslogtreecommitdiffstats
path: root/MemoryMeter.c
diff options
context:
space:
mode:
authorIvan Shapovalov <intelfx@intelfx.name>2023-03-12 20:17:03 +0400
committerBenBE <BenBE@geshi.org>2023-04-23 16:00:17 +0200
commitb2ada278403e643a3bc339783740f262b7879803 (patch)
tree081651d2cfa0c86d02c633cea81dcc40a233c825 /MemoryMeter.c
parent1b640dff5759d73458204c87e217dab8759badd9 (diff)
{Memory,Swap}Meter: make sure new constants are used consistently
Diffstat (limited to 'MemoryMeter.c')
-rw-r--r--MemoryMeter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MemoryMeter.c b/MemoryMeter.c
index ac01dfe7..1dad1356 100644
--- a/MemoryMeter.c
+++ b/MemoryMeter.c
@@ -34,7 +34,9 @@ static void MemoryMeter_updateValues(Meter* this) {
Platform_setMemoryValues(this);
/* Do not print available memory in bar mode */
- this->curItems = 4;
+ static_assert(MEMORY_METER_AVAILABLE + 1 == MEMORY_METER_ITEMCOUNT,
+ "MEMORY_METER_AVAILABLE is not the last item in MemoryMeterValues");
+ this->curItems = MEMORY_METER_AVAILABLE;
written = Meter_humanUnit(buffer, this->values[MEMORY_METER_USED], size);
METER_BUFFER_CHECK(buffer, size, written);
@@ -87,7 +89,7 @@ const MeterClass MemoryMeter_class = {
},
.updateValues = MemoryMeter_updateValues,
.defaultMode = BAR_METERMODE,
- .maxItems = 5,
+ .maxItems = MEMORY_METER_ITEMCOUNT,
.total = 100.0,
.attributes = MemoryMeter_attributes,
.name = "Memory",

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