From 3a22e6a6c5ad10e8c5cb9abb3615d2a8867d63e9 Mon Sep 17 00:00:00 2001 From: N-R-K Date: Tue, 3 May 2022 15:36:57 +0000 Subject: Declare every extern function/variable in `nsxiv.h` (#268) with a couple exceptions as they cause too many -Wshadow warnings. also moves the `extcmd_t` typedef on top for cosmetic purposes. also enable `-Wmissing-prototypes` in the ci --- main.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 29bb1ec..976bd5f 100644 --- a/main.c +++ b/main.c @@ -18,8 +18,8 @@ */ #include "nsxiv.h" -#include "commands.h" #define _MAPPINGS_CONFIG +#include "commands.h" #include "config.h" #include @@ -45,18 +45,18 @@ typedef struct { timeout_f handler; } timeout_t; -/* timeout handler functions: */ -void redraw(void); -void reset_cursor(void); -void animate(void); -void slideshow(void); -void clear_resize(void); +typedef struct { + int err; + char *cmd; +} extcmd_t; -appmode_t mode; +/* these are not declared in nsxiv.h, as it causes too many -Wshadow warnings */ arl_t arl; img_t img; tns_t tns; win_t win; + +appmode_t mode; const XButtonEvent *xbutton_ev; fileinfo_t *files; @@ -70,11 +70,6 @@ static bool extprefix; static bool resized = false; -typedef struct { - int err; - char *cmd; -} extcmd_t; - static struct { extcmd_t f, ft; int fd; @@ -527,7 +522,7 @@ void clear_resize(void) resized = false; } -Bool is_input_ev(Display *dpy, XEvent *ev, XPointer arg) +static Bool is_input_ev(Display *dpy, XEvent *ev, XPointer arg) { return ev->type == ButtonPress || ev->type == KeyPress; } @@ -822,7 +817,7 @@ static int fncmp(const void *a, const void *b) return strcoll(((fileinfo_t*) a)->name, ((fileinfo_t*) b)->name); } -void sigchld(int sig) +static void sigchld(int sig) { while (waitpid(-1, NULL, WNOHANG) > 0); } -- cgit v1.2.3-54-g00ecf