all repos — slstatus @ b4f55e7170576a2dd800018c8690832bbc7f9bf0

my build of slstatus (tools.suckless.org/slstatus/)

(void)ed the prototypes
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 12:00:51 +0300
commit

b4f55e7170576a2dd800018c8690832bbc7f9bf0

parent

46b6876d7ec6e17bb51ee647f77bd238c864ca25

1 files changed, 28 insertions(+), 25 deletions(-)

jump to
M slstatus.cslstatus.c

@@ -39,26 +39,26 @@

static void setstatus(const char *); static char *smprintf(const char *, ...); static char *battery_perc(const char *); -static char *cpu_perc(const char *); +static char *cpu_perc(void); static char *datetime(const char *); static char *disk_free(const char *); static char *disk_perc(const char *); static char *disk_total(const char *); static char *disk_used(const char *); -static char *entropy(const char *); -static char *gid(const char *); -static char *hostname(const char *); +static char *entropy(void); +static char *gid(void); +static char *hostname(void); static char *ip(const char *); -static char *load_avg(const char *); -static char *ram_free(const char *); -static char *ram_perc(const char *); -static char *ram_used(const char *); -static char *ram_total(const char *); +static char *load_avg(void); +static char *ram_free(void); +static char *ram_perc(void); +static char *ram_used(void); +static char *ram_total(void); static char *run_command(const char *); static char *temp(const char *); -static char *uid(const char *); -static char *uptime(const char *); -static char *username(const char *); +static char *uid(void); +static char *uptime(void); +static char *username(void); static char *vol_perc(const char *); static char *wifi_perc(const char *); static char *wifi_essid(const char *);

@@ -129,7 +129,7 @@ return smprintf("%d%%", perc);

} static char * -cpu_perc(const char *null) +cpu_perc(void) { int perc; long double a[4], b[4];

@@ -237,7 +237,7 @@ return smprintf("%f", (float)fs.f_bsize * ((float)fs.f_blocks - (float)fs.f_bfree) / 1024 / 1024 / 1024);

} static char * -entropy(const char *null) +entropy(void) { int entropy = 0; FILE *fp;

@@ -253,7 +253,7 @@ return smprintf("%d", entropy);

} static char * -gid(const char *null) +gid(void) { gid_t gid;

@@ -266,7 +266,7 @@ return smprintf(unknowntext);

} static char * -hostname(const char *null) +hostname(void) { char hostname[HOST_NAME_MAX]; FILE *fp;

@@ -316,7 +316,7 @@ return smprintf(unknowntext);

} static char * -load_avg(const char *null) +load_avg(void) { double avgs[3];

@@ -329,7 +329,7 @@ return smprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]);

} static char * -ram_free(const char *null) +ram_free(void) { long free; FILE *fp;

@@ -345,7 +345,7 @@ return smprintf("%f", (float)free / 1024 / 1024);

} static char * -ram_perc(const char *null) +ram_perc(void) { int perc; long total, free, buffers, cached;

@@ -367,7 +367,7 @@ return smprintf("%d%%", perc);

} static char * -ram_total(const char *null) +ram_total(void) { long total; FILE *fp;

@@ -383,7 +383,7 @@ return smprintf("%f", (float)total / 1024 / 1024);

} static char * -ram_used(const char *null) +ram_used(void) { long free, total, buffers, cached, used; FILE *fp;

@@ -445,7 +445,7 @@ return smprintf("%d°C", temperature / 1000);

} static char * -uptime(const char *null) +uptime(void) { struct sysinfo info; int hours = 0;

@@ -459,7 +459,7 @@ return smprintf("%dh %dm", hours, minutes);

} static char * -username(const char *null) +username(void) { register struct passwd *pw; register uid_t uid;

@@ -478,7 +478,7 @@ return smprintf(unknowntext);

} static char * -uid(const char *null) +uid(void) { register uid_t uid;

@@ -624,7 +624,10 @@ for (;;) {

memset(status_string, 0, sizeof(status_string)); for (size_t i = 0; i < sizeof(args) / sizeof(args[0]); ++i) { argument = args[i]; - char *res = argument.func(argument.args); + if (argument.args == NULL) + char *res = argument.func(); + else + char *res = argument.func(argument.args); char *element = smprintf(argument.format, res); if (element == NULL) { element = smprintf(unknowntext);