aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorN-R-K <nrk@disroot.org>2022-05-03 17:36:57 +0200
committerGitHub <noreply@github.com>2022-05-03 17:36:57 +0200
commit3a22e6a6c5ad10e8c5cb9abb3615d2a8867d63e9 (patch)
tree5a2e26fa1e6bd4b110c612054a6832275fced1f8 /main.c
parent591be8cecfaef143824e76c73f7c586261297c9c (diff)
downloadnsxiv-3a22e6a6c5ad10e8c5cb9abb3615d2a8867d63e9.tar.zst
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
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 10 insertions, 15 deletions
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 <stdlib.h>
@@ -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);
}