Skip to content

Commit

Permalink
Use 0 instead of NAN and save setting
Browse files Browse the repository at this point in the history
  • Loading branch information
batk0 committed Oct 28, 2024
1 parent f2e453c commit 83739b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MemoryMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ static void MemoryMeter_updateValues(Meter* this) {
this->values[MEMORY_METER_COMPRESSED] = NAN;
this->values[MEMORY_METER_AVAILABLE] = NAN;
Platform_setMemoryValues(this);
if (this->mode == GRAPH_METERMODE && !settings->showCachedMemory) {
this->values[MEMORY_METER_BUFFERS] = NAN;
this->values[MEMORY_METER_CACHE] = NAN;
if ((this->mode == GRAPH_METERMODE || this->mode == BAR_METERMODE) && !settings->showCachedMemory) {
this->values[MEMORY_METER_BUFFERS] = 0;
this->values[MEMORY_METER_CACHE] = 0;
}
/* Do not print available memory in bar mode */
static_assert(MEMORY_METER_AVAILABLE + 1 == MEMORY_METER_ITEMCOUNT,
Expand Down
1 change: 1 addition & 0 deletions Settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ int Settings_write(const Settings* this, bool onCrash) {
printSettingInteger("show_cpu_temperature", this->showCPUTemperature);
printSettingInteger("degree_fahrenheit", this->degreeFahrenheit);
#endif
printSettingInteger("show_cached_memory", this->showCachedMemory);
printSettingInteger("update_process_names", this->updateProcessNames);
printSettingInteger("account_guest_in_cpu_meter", this->accountGuestInCPUMeter);
printSettingInteger("color_scheme", this->colorScheme);
Expand Down

0 comments on commit 83739b7

Please sign in to comment.