Skip to content

Commit 83739b7

Browse files
committed
Use 0 instead of NAN and save setting
1 parent f2e453c commit 83739b7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

MemoryMeter.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ static void MemoryMeter_updateValues(Meter* this) {
4040
this->values[MEMORY_METER_COMPRESSED] = NAN;
4141
this->values[MEMORY_METER_AVAILABLE] = NAN;
4242
Platform_setMemoryValues(this);
43-
if (this->mode == GRAPH_METERMODE && !settings->showCachedMemory) {
44-
this->values[MEMORY_METER_BUFFERS] = NAN;
45-
this->values[MEMORY_METER_CACHE] = NAN;
43+
if ((this->mode == GRAPH_METERMODE || this->mode == BAR_METERMODE) && !settings->showCachedMemory) {
44+
this->values[MEMORY_METER_BUFFERS] = 0;
45+
this->values[MEMORY_METER_CACHE] = 0;
4646
}
4747
/* Do not print available memory in bar mode */
4848
static_assert(MEMORY_METER_AVAILABLE + 1 == MEMORY_METER_ITEMCOUNT,

Settings.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ int Settings_write(const Settings* this, bool onCrash) {
699699
printSettingInteger("show_cpu_temperature", this->showCPUTemperature);
700700
printSettingInteger("degree_fahrenheit", this->degreeFahrenheit);
701701
#endif
702+
printSettingInteger("show_cached_memory", this->showCachedMemory);
702703
printSettingInteger("update_process_names", this->updateProcessNames);
703704
printSettingInteger("account_guest_in_cpu_meter", this->accountGuestInCPUMeter);
704705
printSettingInteger("color_scheme", this->colorScheme);

0 commit comments

Comments
 (0)