From a3ba41fba2fbab1248c610f5306a7bf76a11fb78 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Tue, 13 Dec 2022 11:13:09 -0800 Subject: [PATCH] fix warning: a function declaration without a prototype is deprecated in all versions of C make savestr() static and remove it from dlpidefs.h since it is not used outside of dlpi.c --- inc/dlpidefs.h | 1 - src/dlpi.c | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/inc/dlpidefs.h b/inc/dlpidefs.h index 0825dc4..0f19aef 100644 --- a/inc/dlpidefs.h +++ b/inc/dlpidefs.h @@ -4,6 +4,5 @@ int setup_dlpi_dev(char *device); void flush_dlpi(int fd); int dlpi_devtype(int fd); -char *savestr(char *s); int dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri, u_long maxpri, u_char *datap, int datalen); #endif diff --git a/src/dlpi.c b/src/dlpi.c index adce2ee..b55123e 100644 --- a/src/dlpi.c +++ b/src/dlpi.c @@ -78,17 +78,18 @@ #include "nfswatch.h" -static void dlbindreq(); -static void dlinforeq(); -static void dlattachreq(); -static void dlpromisconreq(); -static void sigalrm(); -static int dlokack(); -static int dlinfoack(); -static int dlbindack(); -static int expecting(); -static int strgetmsg(); -static char *savestr(); +static void dlbindreq(int fd, u_long sap, u_long max_conind, u_long service_mode, u_long conn_mgmt, u_long xidtest); +static void dlinforeq(int fd); +static void dlattachreq(int fd, u_long ppa); +static void dlpromisconreq(int fd, u_long level); +static void sigalrm(int sig); +static int dlokack(int fd, char *bufp); +static int dlinfoack(int fd, char *bufp); +static int dlbindack(int fd, char *bufp); +static int expecting(int prim, union DL_primitives *dlp); +static int strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *flagsp, char *caller); +static char *savestr(char *s) + static char *pname; extern unsigned char ether_host[6]; @@ -538,7 +539,6 @@ static int expecting(int prim, union DL_primitives *dlp) static int strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *flagsp, char *caller) { int rc; - void sigalrm(); /* * Start timer. @@ -585,12 +585,12 @@ static int strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *fla /* * sigalrm - handle alarms. */ -static void sigalrm() { (void)fprintf(stderr, "dlpi: timeout\n"); } +static void sigalrm(int sig) { (void)fprintf(stderr, "dlpi: timeout\n"); } /* * savestr - save string in dynamic memory. */ -char *savestr(char *s) +static char *savestr(char *s) { char *t;