From d91710ba036c039c7833fb0759d208691a69ad81 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sun, 26 Apr 2020 20:20:16 +0100 Subject: [PATCH] Fix all implicit declarations AC_HEADER_TIME is only needed if you need to include time.h and sys/time.h at the same time. The truth is this codebase is an unholy mess but at least this fixes the warnings. --- configure.ac | 1 - gram.y | 20 +++++++++++--------- icc.c | 1 + kbdmodule.y | 16 ++++++++-------- module.c | 4 ---- ppmtoinfo.c | 4 +--- screen.h | 5 +++++ 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 5ffbde0..7cfd9c1 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,6 @@ AC_C_CONST AC_C_CHAR_UNSIGNED AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_HEADER_TIME AC_STRUCT_TM AC_FUNC_ALLOCA diff --git a/gram.y b/gram.y index 76c821e..1d28b4e 100644 --- a/gram.y +++ b/gram.y @@ -13,7 +13,6 @@ extern void set_mwb_palette(void); extern void set_schwartz_palette(void); extern void set_custom_palette(char *fn); extern void add_toolitem(char *, char *, char *, int); -extern Scrn *openscreen(char *, Window); extern void create_module(Scrn *, char *, char *); extern char *default_colors[NUMDRIPENS]; extern char *default_screenfont, *label_font_name; @@ -44,6 +43,17 @@ static void append_to(char **x, char *y) } static int ti_level=0; + +int yylex(); + +extern char *progname; +extern int ParseError; +int yyerror(s) char *s; +{ + fprintf (stderr, "%s: error in input file: %s\n", progname, s ? s : ""); + ParseError = 1; + return 0; +} %} %union @@ -197,11 +207,3 @@ forcemove_policy : ALWAYS { $$ = FM_ALWAYS; } ; %% -extern char *progname; -extern int ParseError; -int yyerror(s) char *s; -{ - fprintf (stderr, "%s: error in input file: %s\n", progname, s ? s : ""); - ParseError = 1; - return 0; -} diff --git a/icc.c b/icc.c index dcb37f3..7593822 100644 --- a/icc.c +++ b/icc.c @@ -5,6 +5,7 @@ #include "style.h" #include "prefs.h" +#include #include #include diff --git a/kbdmodule.y b/kbdmodule.y index 96adb35..431ce61 100644 --- a/kbdmodule.y +++ b/kbdmodule.y @@ -8,6 +8,14 @@ void docmd(XEvent *e, void *callback) ((void (*)(Window))callback)(e->xany.window); } +int yylex(); + +char *progname; +int yyerror(s) char *s; +{ + fprintf (stderr, "%s: error in input file: %s\n", progname, s ? s : ""); + return 0; +} %} %union @@ -55,14 +63,6 @@ command : FUNCTION { $$=$1; } %% -char *progname; - -int yyerror(s) char *s; -{ - fprintf (stderr, "%s: error in input file: %s\n", progname, s ? s : ""); - return 0; -} - int main(int argc, char *argv[]) { char *arg=md_init(argc, argv); diff --git a/module.c b/module.c index 157008a..a3008e1 100644 --- a/module.c +++ b/module.c @@ -13,9 +13,6 @@ #ifdef HAVE_SYS_WAIT_H #include #endif -#ifdef HAVE_SYS_TIME_H -#include -#endif #ifdef HAVE_SYS_RESOURCE_H #include #endif @@ -42,7 +39,6 @@ extern Display *dpy; extern void add_fd_to_set(int); extern void remove_fd_from_set(int); -extern void screentoback(); extern void raiselowerclient(Client *, int); extern void wberror(Scrn *, char *); extern void reparent(Client *); diff --git a/ppmtoinfo.c b/ppmtoinfo.c index e4cc072..7684e57 100644 --- a/ppmtoinfo.c +++ b/ppmtoinfo.c @@ -1,12 +1,10 @@ #include #include #include +#include #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_SYS_TIME_H -#include -#endif #define WB_DISKMAGIC 0xe310 #define WB_DISKVERSION 1 diff --git a/screen.h b/screen.h index f92712c..26fef64 100644 --- a/screen.h +++ b/screen.h @@ -47,4 +47,9 @@ extern Scrn * openscreen(char *, Window); extern void realizescreens(); extern void screentoback(); +void closescreen(); +Scrn *openscreen(char *deftitle, Window root); +void realizescreens(); +void screentoback(); + #endif