summaryrefslogtreecommitdiff
path: root/bin/free
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-25 19:24:38 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-25 20:35:03 +0100
commita984eb367c032dbe2577f01238c3d1268526be70 (patch)
tree437fef40379b2758b129ccea39df3570fa2d145e /bin/free
parent8834571b202cf4dc9c649cfb096c213b6ecf1566 (diff)
Clang-tidy fixes
Diffstat (limited to 'bin/free')
-rw-r--r--bin/free/free.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/bin/free/free.c b/bin/free/free.c
index b42ad99a..26ce195c 100644
--- a/bin/free/free.c
+++ b/bin/free/free.c
@@ -30,31 +30,19 @@ int main(int argc, char **argv)
if (sysinfo(&info) < 0)
perror("sysinfo");
- printf(" %13s%13s%13s%13s%13s\n", "total", "used", "free", "shared",
- "buffers");
+ printf(" %13s%13s%13s%13s%13s\n", "total", "used", "free", "shared", "buffers");
- printf("Mem: %13llu%13llu%13llu%13llu%13llu\n",
- (unsigned long long)((info.totalram * info.mem_unit) >> shift),
- (unsigned long long)(((info.totalram - info.freeram) *
- info.mem_unit) >>
- shift),
+ printf("Mem: %13llu%13llu%13llu%13llu%13llu\n", (unsigned long long)((info.totalram * info.mem_unit) >> shift),
+ (unsigned long long)(((info.totalram - info.freeram) * info.mem_unit) >> shift),
(unsigned long long)((info.freeram * info.mem_unit) >> shift),
(unsigned long long)((info.sharedram * info.mem_unit) >> shift),
(unsigned long long)((info.bufferram * info.mem_unit) >> shift));
printf("-/+ buffers/cache:%13llu%13llu\n",
- (unsigned long long)(((info.totalram - info.freeram -
- info.bufferram) *
- info.mem_unit) >>
- shift),
- (unsigned long long)(((info.freeram + info.bufferram) *
- info.mem_unit) >>
- shift));
- printf("Swap:%13llu%13llu%13llu\n",
- (unsigned long long)((info.totalswap * info.mem_unit) >> shift),
- (unsigned long long)(((info.totalswap - info.freeswap) *
- info.mem_unit) >>
- shift),
+ (unsigned long long)(((info.totalram - info.freeram - info.bufferram) * info.mem_unit) >> shift),
+ (unsigned long long)(((info.freeram + info.bufferram) * info.mem_unit) >> shift));
+ printf("Swap:%13llu%13llu%13llu\n", (unsigned long long)((info.totalswap * info.mem_unit) >> shift),
+ (unsigned long long)(((info.totalswap - info.freeswap) * info.mem_unit) >> shift),
(unsigned long long)((info.freeswap * info.mem_unit) >> shift));
return 0;