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.
This commit is contained in:
NRK 2022-10-27 02:14:53 +06:00 committed by drkhsh
parent f29aa9ab06
commit 28ef0b242c
23 changed files with 23 additions and 1 deletions

View File

@ -31,7 +31,7 @@ COM =\
all: slstatus 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) slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
.c.o: .c.o:

View File

@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
#include <limits.h> #include <limits.h>

View File

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
const char * const char *

View File

@ -3,6 +3,7 @@
#include <time.h> #include <time.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
datetime(const char *fmt) datetime(const char *fmt)

View File

@ -3,6 +3,7 @@
#include <sys/statvfs.h> #include <sys/statvfs.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
disk_free(const char *path) disk_free(const char *path)

View File

@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>

View File

@ -3,6 +3,7 @@
#include <unistd.h> #include <unistd.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
hostname(void) hostname(void)

View File

@ -12,6 +12,7 @@
#endif #endif
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
static const char * static const char *
ip(const char *interface, unsigned short sa_family) ip(const char *interface, unsigned short sa_family)

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
kernel_release(void) kernel_release(void)

View File

@ -5,6 +5,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
/* /*
* fmt consists of uppercase or lowercase 'c' for caps lock and/or 'n' for num * fmt consists of uppercase or lowercase 'c' for caps lock and/or 'n' for num

View File

@ -6,6 +6,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
static int static int
valid_layout_or_variant(char *sym) valid_layout_or_variant(char *sym)

View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
load_avg(void) load_avg(void)

View File

@ -3,6 +3,7 @@
#include <limits.h> #include <limits.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
#include <stdint.h> #include <stdint.h>

View File

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
num_files(const char *path) num_files(const char *path)

View File

@ -2,6 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
#include <stdint.h> #include <stdint.h>

View File

@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
run_command(const char *cmd) run_command(const char *cmd)

View File

@ -2,6 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
separator(const char *separator) separator(const char *separator)

View File

@ -5,6 +5,7 @@
#include <string.h> #include <string.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)
static int static int

View File

@ -2,6 +2,7 @@
#include <stddef.h> #include <stddef.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__linux__) #if defined(__linux__)

View File

@ -4,6 +4,7 @@
#include <time.h> #include <time.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(CLOCK_BOOTTIME) #if defined(CLOCK_BOOTTIME)
#define UPTIME_FLAG CLOCK_BOOTTIME #define UPTIME_FLAG CLOCK_BOOTTIME

View File

@ -5,6 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
const char * const char *
gid(void) gid(void)

View File

@ -6,6 +6,7 @@
#include <unistd.h> #include <unistd.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#if defined(__OpenBSD__) | defined(__FreeBSD__) #if defined(__OpenBSD__) | defined(__FreeBSD__)
#include <sys/queue.h> #include <sys/queue.h>

View File

@ -7,6 +7,7 @@
#include <unistd.h> #include <unistd.h>
#include "../util.h" #include "../util.h"
#include "../slstatus.h"
#define RSSI_TO_PERC(rssi) \ #define RSSI_TO_PERC(rssi) \
rssi >= -50 ? 100 : \ rssi >= -50 ? 100 : \