fix: lint

This commit is contained in:
Alex
2022-10-26 17:26:15 +02:00
parent 930a3e168b
commit 2d7e21ed7d
3 changed files with 33 additions and 35 deletions

View File

@ -31,17 +31,18 @@ auto waybar::modules::Memory::update() -> void {
}
if (memtotal > 0 && memfree >= 0) {
float total_ram_gigabytes = 0.01*round(memtotal / 10485.76); // 100*10485.76 = 2^20 = 1024^2 = GiB/KiB
float total_swap_gigabytes = 0.01*round(swaptotal / 10485.76);
float total_ram_gigabytes =
0.01 * round(memtotal / 10485.76); // 100*10485.76 = 2^20 = 1024^2 = GiB/KiB
float total_swap_gigabytes = 0.01 * round(swaptotal / 10485.76);
int used_ram_percentage = 100 * (memtotal - memfree) / memtotal;
int used_swap_percentage = 0;
if (swaptotal && swapfree) {
used_swap_percentage = 100 * (swaptotal - swapfree) / swaptotal;
}
float used_ram_gigabytes = 0.01*round((memtotal - memfree) / 10485.76);
float used_swap_gigabytes = 0.01*round((swaptotal - swapfree) / 10485.76);
float available_ram_gigabytes = 0.01*round(memfree / 10485.76);
float available_swap_gigabytes = 0.01*round(swapfree / 10485.76);
float used_ram_gigabytes = 0.01 * round((memtotal - memfree) / 10485.76);
float used_swap_gigabytes = 0.01 * round((swaptotal - swapfree) / 10485.76);
float available_ram_gigabytes = 0.01 * round(memfree / 10485.76);
float available_swap_gigabytes = 0.01 * round(swapfree / 10485.76);
auto format = format_;
auto state = getState(used_ram_percentage);