From 28ef0b242c32e8ae8b4df2b4b380e30bf581130f Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 27 Oct 2022 02:14:53 +0600 Subject: [PATCH] components/*.c: include slstatus.h this gives the compiler a chance to check weather the prototype and definiton matches or not, which would catch issues like 3c47701. --- Makefile | 2 +- components/battery.c | 1 + components/cpu.c | 1 + components/datetime.c | 1 + components/disk.c | 1 + components/entropy.c | 1 + components/hostname.c | 1 + components/ip.c | 1 + components/kernel_release.c | 1 + components/keyboard_indicators.c | 1 + components/keymap.c | 1 + components/load_avg.c | 1 + components/netspeeds.c | 1 + components/num_files.c | 1 + components/ram.c | 1 + components/run_command.c | 1 + components/separator.c | 1 + components/swap.c | 1 + components/temperature.c | 1 + components/uptime.c | 1 + components/user.c | 1 + components/volume.c | 1 + components/wifi.c | 1 + 23 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2f93b87..542b1f0 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ COM =\ all: slstatus -$(COM:=.o): config.mk $(REQ:=.h) +$(COM:=.o): config.mk $(REQ:=.h) slstatus.h slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h) .c.o: diff --git a/components/battery.c b/components/battery.c index a36132d..b7a2ec6 100644 --- a/components/battery.c +++ b/components/battery.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) #include diff --git a/components/cpu.c b/components/cpu.c index 9e28003..a5fabf8 100644 --- a/components/cpu.c +++ b/components/cpu.c @@ -4,6 +4,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) const char * diff --git a/components/datetime.c b/components/datetime.c index c3efae3..cf9fbba 100644 --- a/components/datetime.c +++ b/components/datetime.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * datetime(const char *fmt) diff --git a/components/disk.c b/components/disk.c index 15a221b..64e2105 100644 --- a/components/disk.c +++ b/components/disk.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * disk_free(const char *path) diff --git a/components/entropy.c b/components/entropy.c index 2a485de..cf60bc3 100644 --- a/components/entropy.c +++ b/components/entropy.c @@ -1,4 +1,5 @@ /* See LICENSE file for copyright and license details. */ +#include "../slstatus.h" #if defined(__linux__) #include #include diff --git a/components/hostname.c b/components/hostname.c index 23da677..8627a88 100644 --- a/components/hostname.c +++ b/components/hostname.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * hostname(void) diff --git a/components/ip.c b/components/ip.c index 70724eb..6d1da68 100644 --- a/components/ip.c +++ b/components/ip.c @@ -12,6 +12,7 @@ #endif #include "../util.h" +#include "../slstatus.h" static const char * ip(const char *interface, unsigned short sa_family) diff --git a/components/kernel_release.c b/components/kernel_release.c index 0457301..76a3827 100644 --- a/components/kernel_release.c +++ b/components/kernel_release.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * kernel_release(void) diff --git a/components/keyboard_indicators.c b/components/keyboard_indicators.c index b35eba1..5f482e8 100644 --- a/components/keyboard_indicators.c +++ b/components/keyboard_indicators.c @@ -5,6 +5,7 @@ #include #include "../util.h" +#include "../slstatus.h" /* * fmt consists of uppercase or lowercase 'c' for caps lock and/or 'n' for num diff --git a/components/keymap.c b/components/keymap.c index ddf7a15..87036db 100644 --- a/components/keymap.c +++ b/components/keymap.c @@ -6,6 +6,7 @@ #include #include "../util.h" +#include "../slstatus.h" static int valid_layout_or_variant(char *sym) diff --git a/components/load_avg.c b/components/load_avg.c index 5c2e252..2b523e7 100644 --- a/components/load_avg.c +++ b/components/load_avg.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * load_avg(void) diff --git a/components/netspeeds.c b/components/netspeeds.c index 0029177..f7bac2e 100644 --- a/components/netspeeds.c +++ b/components/netspeeds.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) #include diff --git a/components/num_files.c b/components/num_files.c index fb55df9..3911da7 100644 --- a/components/num_files.c +++ b/components/num_files.c @@ -4,6 +4,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * num_files(const char *path) diff --git a/components/ram.c b/components/ram.c index 6040e56..3fa78af 100644 --- a/components/ram.c +++ b/components/ram.c @@ -2,6 +2,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) #include diff --git a/components/run_command.c b/components/run_command.c index e00b478..be7d9e2 100644 --- a/components/run_command.c +++ b/components/run_command.c @@ -3,6 +3,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * run_command(const char *cmd) diff --git a/components/separator.c b/components/separator.c index 40fec52..39a594a 100644 --- a/components/separator.c +++ b/components/separator.c @@ -2,6 +2,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * separator(const char *separator) diff --git a/components/swap.c b/components/swap.c index 2509db1..98983ee 100644 --- a/components/swap.c +++ b/components/swap.c @@ -5,6 +5,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) static int diff --git a/components/temperature.c b/components/temperature.c index 8e1f222..306a09f 100644 --- a/components/temperature.c +++ b/components/temperature.c @@ -2,6 +2,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__linux__) diff --git a/components/uptime.c b/components/uptime.c index 7c23c98..fc3d204 100644 --- a/components/uptime.c +++ b/components/uptime.c @@ -4,6 +4,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(CLOCK_BOOTTIME) #define UPTIME_FLAG CLOCK_BOOTTIME diff --git a/components/user.c b/components/user.c index 71a0c9d..fbe6814 100644 --- a/components/user.c +++ b/components/user.c @@ -5,6 +5,7 @@ #include #include "../util.h" +#include "../slstatus.h" const char * gid(void) diff --git a/components/volume.c b/components/volume.c index c94f872..5c85011 100644 --- a/components/volume.c +++ b/components/volume.c @@ -6,6 +6,7 @@ #include #include "../util.h" +#include "../slstatus.h" #if defined(__OpenBSD__) | defined(__FreeBSD__) #include diff --git a/components/wifi.c b/components/wifi.c index 92c252e..b9957ab 100644 --- a/components/wifi.c +++ b/components/wifi.c @@ -7,6 +7,7 @@ #include #include "../util.h" +#include "../slstatus.h" #define RSSI_TO_PERC(rssi) \ rssi >= -50 ? 100 : \