summaryrefslogtreecommitdiff
path: root/components/ram.c
diff options
context:
space:
mode:
authordrkhsh <me@drkhsh.at>2022-10-28 00:51:34 +0200
committerdrkhsh <me@drkhsh.at>2022-10-28 01:03:38 +0200
commit3251e911878b78b0aad8fc09c782f8d81c878f75 (patch)
treedc9b6927e963a994286babd803357615c9b37a22 /components/ram.c
parent2104dc362ca7336d98499a5945ea2a3d371f7568 (diff)
downloadslstatus-3251e911878b78b0aad8fc09c782f8d81c878f75.tar.gz
radical re-formatting 2/3: Fix blocks
Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
Diffstat (limited to 'components/ram.c')
-rw-r--r--components/ram.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/components/ram.c b/components/ram.c
index 518c18c..326153f 100644
--- a/components/ram.c
+++ b/components/ram.c
@@ -16,9 +16,8 @@
"MemTotal: %ju kB\n"
"MemFree: %ju kB\n"
"MemAvailable: %ju kB\n",
- &free, &free, &free) != 3) {
+ &free, &free, &free) != 3)
return NULL;
- }
return fmt_human(free * 1024, 1024);
}
@@ -35,13 +34,11 @@
"MemAvailable: %ju kB\n"
"Buffers: %ju kB\n"
"Cached: %ju kB\n",
- &total, &free, &buffers, &buffers, &cached) != 5) {
+ &total, &free, &buffers, &buffers, &cached) != 5)
return NULL;
- }
- if (total == 0) {
+ if (total == 0)
return NULL;
- }
percent = 100 * ((total - free) - (buffers + cached)) / total;
return bprintf("%d", percent);
@@ -53,9 +50,8 @@
uintmax_t total;
if (pscanf("/proc/meminfo", "MemTotal: %ju kB\n", &total)
- != 1) {
+ != 1)
return NULL;
- }
return fmt_human(total * 1024, 1024);
}
@@ -94,9 +90,8 @@
size = sizeof(*uvmexp);
- if (sysctl(uvmexp_mib, 2, uvmexp, &size, NULL, 0) >= 0) {
+ if (sysctl(uvmexp_mib, 2, uvmexp, &size, NULL, 0) >= 0)
return 1;
- }
return 0;
}