From: git Date: Sun, 24 May 2026 15:21:19 +0000 (-0400) Subject: make all functions static X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=a7857215bcfe5d6d5d4258ef68cea2693b3656bd;p=free.git make all functions static --- diff --git a/free.c b/free.c index 971711b..f3c1e1f 100644 --- a/free.c +++ b/free.c @@ -25,14 +25,14 @@ static kvm_t *kd; static long pgsz; static char sbuff[32]; -void +static void usage(void) { fprintf(stderr, "usage: %s [-bghkmpt]\n", getprogname()); exit(2); } -long long +static long long getphysmem(int unused) { (void)unused; @@ -46,7 +46,7 @@ getphysmem(int unused) return physcnt; } -long long +static long long getavailmem(int flag) { size_t len; @@ -66,7 +66,7 @@ getavailmem(int flag) return (long long)((freecnt + inactcnt) * pgsz); } -long long +static long long getwiredmem(int unused) { (void)unused; @@ -82,7 +82,7 @@ getwiredmem(int unused) } -long long +static long long getbufcachestats(int unused) { (void)unused; @@ -104,7 +104,7 @@ getbufcachestats(int unused) return (long long)(cachecnt * pgsz + bufspace + arcspace); } -long long +static long long getswapstats(int flag) { int nswap; @@ -121,7 +121,7 @@ getswapstats(int flag) return (long long)((swap.ksw_total - swap.ksw_used) * pgsz); } -int +static int tohumansize(long long bytes, char **buff, ConvFlags flag) { int i = 0; @@ -147,7 +147,7 @@ tohumansize(long long bytes, char **buff, ConvFlags flag) return asprintf(buff, "%.0f%c", size, units[i]); } -void +static void sprintfaligned(char *buff, size_t len) { size_t blen;