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.
This commit is contained in:
James Le Cuirot
2020-04-26 20:20:16 +01:00
parent cf6e360a7e
commit d91710ba03
7 changed files with 26 additions and 25 deletions

View File

@@ -26,7 +26,6 @@ AC_C_CONST
AC_C_CHAR_UNSIGNED AC_C_CHAR_UNSIGNED
AC_TYPE_PID_T AC_TYPE_PID_T
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM AC_STRUCT_TM
AC_FUNC_ALLOCA AC_FUNC_ALLOCA

20
gram.y
View File

@@ -13,7 +13,6 @@ extern void set_mwb_palette(void);
extern void set_schwartz_palette(void); extern void set_schwartz_palette(void);
extern void set_custom_palette(char *fn); extern void set_custom_palette(char *fn);
extern void add_toolitem(char *, char *, char *, int); extern void add_toolitem(char *, char *, char *, int);
extern Scrn *openscreen(char *, Window);
extern void create_module(Scrn *, char *, char *); extern void create_module(Scrn *, char *, char *);
extern char *default_colors[NUMDRIPENS]; extern char *default_colors[NUMDRIPENS];
extern char *default_screenfont, *label_font_name; extern char *default_screenfont, *label_font_name;
@@ -44,6 +43,17 @@ static void append_to(char **x, char *y)
} }
static int ti_level=0; 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 %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;
}

1
icc.c
View File

@@ -5,6 +5,7 @@
#include "style.h" #include "style.h"
#include "prefs.h" #include "prefs.h"
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -8,6 +8,14 @@ void docmd(XEvent *e, void *callback)
((void (*)(Window))callback)(e->xany.window); ((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 %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[]) int main(int argc, char *argv[])
{ {
char *arg=md_init(argc, argv); char *arg=md_init(argc, argv);

View File

@@ -13,9 +13,6 @@
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
@@ -42,7 +39,6 @@ extern Display *dpy;
extern void add_fd_to_set(int); extern void add_fd_to_set(int);
extern void remove_fd_from_set(int); extern void remove_fd_from_set(int);
extern void screentoback();
extern void raiselowerclient(Client *, int); extern void raiselowerclient(Client *, int);
extern void wberror(Scrn *, char *); extern void wberror(Scrn *, char *);
extern void reparent(Client *); extern void reparent(Client *);

View File

@@ -1,12 +1,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#define WB_DISKMAGIC 0xe310 #define WB_DISKMAGIC 0xe310
#define WB_DISKVERSION 1 #define WB_DISKVERSION 1

View File

@@ -47,4 +47,9 @@ extern Scrn * openscreen(char *, Window);
extern void realizescreens(); extern void realizescreens();
extern void screentoback(); extern void screentoback();
void closescreen();
Scrn *openscreen(char *deftitle, Window root);
void realizescreens();
void screentoback();
#endif #endif