diff --git a/appl/ftp/common/glob.c b/appl/ftp/common/glob.c index c4c327ffe..702a61ee3 100644 --- a/appl/ftp/common/glob.c +++ b/appl/ftp/common/glob.c @@ -573,7 +573,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern, * and dirent.h as taking pointers to differently typed opaque * structures. */ - struct dirent *(*readdirfunc)(); + struct dirent *(*readdirfunc)(void *); *pathend = EOS; errno = 0; @@ -595,7 +595,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern, if (pglob->gl_flags & GLOB_ALTDIRFUNC) readdirfunc = pglob->gl_readdir; else - readdirfunc = readdir; + readdirfunc = (struct dirent *(*)(void *))readdir; while ((dp = (*readdirfunc)(dirp))) { register u_char *sc; register Char *dc; diff --git a/appl/ftp/ftpd/ftpcmd.y b/appl/ftp/ftpd/ftpcmd.y index db63b0299..50dfcd8fd 100644 --- a/appl/ftp/ftpd/ftpcmd.y +++ b/appl/ftp/ftpd/ftpcmd.y @@ -660,8 +660,6 @@ cmd rcmd : RNFR check_login_no_guest SP pathname CRLF { - char *renamefrom(); - restart_point = (off_t) 0; if ($2 && $4) { fromname = renamefrom($4); @@ -699,8 +697,6 @@ host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER { - char *a; - data_dest.sin_family = AF_INET; data_dest.sin_port = htons($9 * 256 + $11); data_dest.sin_addr.s_addr = diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index 82c5cac06..052c04f38 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -370,7 +370,7 @@ main(int argc, char **argv) } #ifdef IP_TOS tos = IPTOS_LOWDELAY; - if (setsockopt(0, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0) + if (setsockopt(0, IPPROTO_IP, IP_TOS, (void *)&tos, sizeof(int)) < 0) syslog(LOG_WARNING, "setsockopt (IP_TOS): %m"); #endif data_source.sin_port = htons(ntohs(ctrl_addr.sin_port) - 1); @@ -383,14 +383,14 @@ main(int argc, char **argv) /* (void) freopen(_PATH_DEVNULL, "w", stderr); */ signal(SIGPIPE, lostconn); signal(SIGCHLD, SIG_IGN); - if ((int)signal(SIGURG, myoob) < 0) + if (signal(SIGURG, myoob) == SIG_ERR) syslog(LOG_ERR, "signal: %m"); auth_init(); /* Try to handle urgent data inline */ #ifdef SO_OOBINLINE - if (setsockopt(0, SOL_SOCKET, SO_OOBINLINE, (char *)&on, + if (setsockopt(0, SOL_SOCKET, SO_OOBINLINE, (void *)&on, sizeof(on)) < 0) syslog(LOG_ERR, "setsockopt: %m"); #endif @@ -822,7 +822,7 @@ set_buffer_size(int fd, int read) size_t size = 1048576; while(size >= 131072 && setsockopt(fd, SOL_SOCKET, read ? SO_RCVBUF : SO_SNDBUF, - (char*)&size, sizeof(size)) < 0) + (void *)&size, sizeof(size)) < 0) size /= 2; #endif } @@ -1056,7 +1056,7 @@ getdatasock(char *mode) if (s < 0) goto bad; if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, - (char *) &on, sizeof(on)) < 0) + (void *) &on, sizeof(on)) < 0) goto bad; /* anchor socket to avoid multi-homing problems */ data_source.sin_family = AF_INET; @@ -1072,7 +1072,7 @@ getdatasock(char *mode) (void) seteuid((uid_t)pw->pw_uid); #ifdef IP_TOS on = IPTOS_THROUGHPUT; - if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0) + if (setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&on, sizeof(int)) < 0) syslog(LOG_WARNING, "setsockopt (IP_TOS): %m"); #endif return (fdopen(s, mode)); @@ -1113,7 +1113,7 @@ dataconn(char *name, off_t size, char *mode) pdata = s; #ifdef IP_TOS tos = IPTOS_THROUGHPUT; - (void) setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, + (void) setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos, sizeof(int)); #endif reply(150, "Opening %s mode data connection for '%s'%s.", diff --git a/appl/ftp/ftpd/krb4.c b/appl/ftp/ftpd/krb4.c index dbe510d1f..39c3a7fd7 100644 --- a/appl/ftp/ftpd/krb4.c +++ b/appl/ftp/ftpd/krb4.c @@ -41,9 +41,15 @@ RCSID("$Id$"); #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_PARAM_H #include +#endif +#ifdef HAVE_NETINET_IN_h #include +#endif #include #include @@ -54,6 +60,7 @@ RCSID("$Id$"); #include "base64.h" #include "extern.h" #include "auth.h" +#include "krb4.h" #include diff --git a/appl/kx/kx.c b/appl/kx/kx.c index eb3c4dae9..ac92a58ad 100644 --- a/appl/kx/kx.c +++ b/appl/kx/kx.c @@ -193,13 +193,13 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule, return -1; } sscanf (tmp, "%u", &display_num); - if (krb_net_read (s, xauthfile, sizeof(xauthfile)) != sizeof(xauthfile)) { + if (krb_net_read (s, xauthfile, xauthfile_size) != xauthfile_size) { fprintf (stderr, "%s: read: %s\n", prog, strerror(errno)); return -1; } - memcpy(key, &cred.session, sizeof(des_cblock)); + memcpy(key, cred.session, sizeof(des_cblock)); return s; } @@ -376,7 +376,7 @@ doit (char *host, int passivep, int debugp, int tcpp) tcpp ? &rendez_vous2 : NULL); if (display_num < 0) return 1; - strncpy(xauthfile, tempnam("/tmp", NULL), sizeof(xauthfile)); + strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size); if (create_and_write_cookie (xauthfile, cookie, cookie_len)) return 1; diff --git a/appl/kx/kxd.c b/appl/kx/kxd.c index 69a0027ec..5ad6ac77f 100644 --- a/appl/kx/kxd.c +++ b/appl/kx/kxd.c @@ -71,7 +71,7 @@ fatal (int fd, char *s) } static void -cleanup() +cleanup(void) { if(xauthfile[0]) unlink(xauthfile); @@ -202,7 +202,7 @@ doit_conn (int fd, struct sockaddr_in *thataddr, */ static int -check_user_console () +check_user_console (void) { struct stat sb; @@ -320,7 +320,7 @@ doit(int sock, int tcpp) } static void -usage () +usage (void) { fprintf (stderr, "Usage: %s [-i] [-t]\n", prog); exit (1); diff --git a/appl/otp/otp.c b/appl/otp/otp.c index 06dc42253..c966d337a 100644 --- a/appl/otp/otp.c +++ b/appl/otp/otp.c @@ -43,7 +43,7 @@ RCSID("$Id$"); char *prog; static void -usage () +usage (void) { fprintf(stderr, "Usage: %s [-h] [-r] [-s] [-n count] [-f alg] num seed\n", diff --git a/appl/popper/popper.h b/appl/popper/popper.h index 702db2fdf..1e7f8979c 100644 --- a/appl/popper/popper.h +++ b/appl/popper/popper.h @@ -173,32 +173,6 @@ typedef enum { /* POP processing states */ bad happened */ } state; -typedef struct { /* State information for - each POP command */ - state ValidCurrentState; /* The operating state of - the command */ - char * command; /* The POP command */ - int min_parms; /* Minimum number of parms - for the command */ - int max_parms; /* Maximum number of parms - for the command */ - int (*function) (); /* The function that process - the command */ - state result[2]; /* The resulting state after - command processing */ -#define success_state result[0] /* State when a command - succeeds */ -} state_table; - -typedef struct { /* Table of extensions */ - char * subcommand; /* The POP XTND subcommand */ - int min_parms; /* Minimum number of parms for - the subcommand */ - int max_parms; /* Maximum number of parms for - the subcommand */ - int (*function) (); /* The function that processes - the subcommand */ -} xtnd_table; typedef struct { /* Message information */ int number; /* Message number relative to @@ -264,6 +238,33 @@ typedef struct { /* POP parameter block */ #endif } POP; +typedef struct { /* State information for + each POP command */ + state ValidCurrentState; /* The operating state of + the command */ + char * command; /* The POP command */ + int min_parms; /* Minimum number of parms + for the command */ + int max_parms; /* Maximum number of parms + for the command */ + int (*function) (); /* The function that process + the command */ + state result[2]; /* The resulting state after + command processing */ +#define success_state result[0] /* State when a command + succeeds */ +} state_table; + +typedef struct { /* Table of extensions */ + char * subcommand; /* The POP XTND subcommand */ + int min_parms; /* Minimum number of parms for + the subcommand */ + int max_parms; /* Maximum number of parms for + the subcommand */ + int (*function) (); /* The function that processes + the subcommand */ +} xtnd_table; + int pop_dele(POP *p); int pop_dropcopy(POP *p, struct passwd *pwp); int pop_dropinfo(POP *p); diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index 4c3c66d4d..2e558b20c 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -241,7 +241,7 @@ static void talk(int force_erase); static unsigned long look(void); static int -zrefresh() +zrefresh(void) { switch (fork()) { case -1: diff --git a/lib/des/mdtest.c b/lib/des/mdtest.c index 347993586..9d7d6dab2 100644 --- a/lib/des/mdtest.c +++ b/lib/des/mdtest.c @@ -48,7 +48,7 @@ RCSID("$Id$"); #include int -md4_tests () +md4_tests (void) { struct test { char *str; @@ -90,7 +90,7 @@ md4_tests () } int -md5_tests () +md5_tests (void) { struct test { char *str; @@ -124,7 +124,7 @@ md5_tests () } int -sha_tests () +sha_tests (void) { struct test { char *str; @@ -158,7 +158,7 @@ sha_tests () } int -main () +main (void) { return md4_tests() + md5_tests() + sha_tests(); } diff --git a/lib/otp/otp.h b/lib/otp/otp.h index 26ee6c3da..eea3ce0b8 100644 --- a/lib/otp/otp.h +++ b/lib/otp/otp.h @@ -81,7 +81,7 @@ int otp_challenge (OtpContext *ctx, char *user, char *str, size_t len); int otp_verify_user (OtpContext *ctx, char *passwd); int otp_verify_user_1 (OtpContext *ctx, char *passwd); -void *otp_db_open (); +void *otp_db_open (void); void otp_db_close (void *); int otp_put (void *, OtpContext *ctx); int otp_get (void *, OtpContext *ctx); diff --git a/lib/otp/otp_db.c b/lib/otp/otp_db.c index d93397291..3d3d60ffa 100644 --- a/lib/otp/otp_db.c +++ b/lib/otp/otp_db.c @@ -44,7 +44,7 @@ RCSID("$Id$"); #include "otp_locl.h" void * -otp_db_open () +otp_db_open (void) { int lock; diff --git a/lib/roken/glob.c b/lib/roken/glob.c index c4c327ffe..702a61ee3 100644 --- a/lib/roken/glob.c +++ b/lib/roken/glob.c @@ -573,7 +573,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern, * and dirent.h as taking pointers to differently typed opaque * structures. */ - struct dirent *(*readdirfunc)(); + struct dirent *(*readdirfunc)(void *); *pathend = EOS; errno = 0; @@ -595,7 +595,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern, if (pglob->gl_flags & GLOB_ALTDIRFUNC) readdirfunc = pglob->gl_readdir; else - readdirfunc = readdir; + readdirfunc = (struct dirent *(*)(void *))readdir; while ((dp = (*readdirfunc)(dirp))) { register u_char *sc; register Char *dc; diff --git a/lib/roken/roken.h b/lib/roken/roken.h index 52f71d223..f3b6975e9 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -43,8 +43,12 @@ #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "protos.h" @@ -83,6 +87,10 @@ SigAction signal(int iSig, SigAction pAction); /* BSD compatible */ #endif #endif +#ifndef SIG_ERR +#define SIG_ERR ((RETSIGTYPE (*)())-1) +#endif + #if !defined(HAVE_STRERROR) && !defined(strerror) char *strerror(int eno); #endif diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 52f71d223..f3b6975e9 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -43,8 +43,12 @@ #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "protos.h" @@ -83,6 +87,10 @@ SigAction signal(int iSig, SigAction pAction); /* BSD compatible */ #endif #endif +#ifndef SIG_ERR +#define SIG_ERR ((RETSIGTYPE (*)())-1) +#endif + #if !defined(HAVE_STRERROR) && !defined(strerror) char *strerror(int eno); #endif diff --git a/lib/roken/strnlen.c b/lib/roken/strnlen.c index 3b93ad739..6d9b12258 100644 --- a/lib/roken/strnlen.c +++ b/lib/roken/strnlen.c @@ -41,6 +41,8 @@ RCSID("$Id$"); #endif +#include "roken.h" + int strnlen(char *s, int len) { diff --git a/lib/roken/tm2time.c b/lib/roken/tm2time.c index 0e91da0b2..163b970b5 100644 --- a/lib/roken/tm2time.c +++ b/lib/roken/tm2time.c @@ -42,7 +42,10 @@ RCSID("$Id$"); #endif #include +#ifdef HAVE_SYS_TIME_H #include +#endif +#include "roken.h" time_t tm2time (struct tm tm, int local)