From a984eb367c032dbe2577f01238c3d1268526be70 Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 25 Dec 2025 19:24:38 +0100 Subject: Clang-tidy fixes --- bin/free/free.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'bin/free/free.c') 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; -- cgit v1.2.3