diff options
author | wollman <wollman@FreeBSD.org> | 1998-09-11 18:49:33 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1998-09-11 18:49:33 +0000 |
commit | aac5469d30c451307f3e3a8b2356165d289e444a (patch) | |
tree | 1b213289729f05f466126dd9e293923a84a7f250 /usr.sbin/lpr | |
parent | 37d2c8c237e33bd1be4f6e346e9d1e928b9bfd19 (diff) | |
download | FreeBSD-src-aac5469d30c451307f3e3a8b2356165d289e444a.zip FreeBSD-src-aac5469d30c451307f3e3a8b2356165d289e444a.tar.gz |
Fix additional warnings. Remove -Werror, since some people have complained
about it.
PR: 7886
Submitted by: Stefan Eggers <seggers@semyam.dinoco.de> (partially)
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/Makefile.inc | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/chkprintcap/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/Makefile | 5 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpc/extern.h | 2 | ||||
-rw-r--r-- | usr.sbin/lpr/lpc/lpc.c | 17 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/extern.h | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/lpd.c | 3 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/modes.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 10 | ||||
-rw-r--r-- | usr.sbin/lpr/lpq/lpq.c | 3 | ||||
-rw-r--r-- | usr.sbin/lpr/lpr/lpr.c | 7 | ||||
-rw-r--r-- | usr.sbin/lpr/lprm/lprm.c | 3 | ||||
-rw-r--r-- | usr.sbin/lpr/pac/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/pac/pac.c | 5 |
17 files changed, 49 insertions, 38 deletions
diff --git a/usr.sbin/lpr/Makefile.inc b/usr.sbin/lpr/Makefile.inc index 34d4fcb..bb67834 100644 --- a/usr.sbin/lpr/Makefile.inc +++ b/usr.sbin/lpr/Makefile.inc @@ -1,6 +1,6 @@ -# $Id: Makefile.inc,v 1.2 1997/12/17 19:38:30 wollman Exp $ +# $Id: Makefile.inc,v 1.3 1998/03/07 09:47:52 bde Exp $ -CWARNFLAGS= -Werror -Wall -Wnested-externs -Wmissing-prototypes -Wno-unused +CWARNFLAGS= -Wall -Wnested-externs -Wmissing-prototypes -Wno-unused -Wredundant-decls -Wstrict-prototypes .if exists(${.OBJDIR}/../common_source) LIBLPR= ${.OBJDIR}/../common_source/liblpr.a diff --git a/usr.sbin/lpr/chkprintcap/Makefile b/usr.sbin/lpr/chkprintcap/Makefile index 54ad387..25d4775 100644 --- a/usr.sbin/lpr/chkprintcap/Makefile +++ b/usr.sbin/lpr/chkprintcap/Makefile @@ -1,8 +1,8 @@ -# $Id: Makefile,v 1.4 1998/05/13 06:50:09 jb Exp $ +# $Id: Makefile,v 1.5 1998/06/11 03:51:34 jb Exp $ PROG= chkprintcap MAN8= chkprintcap.8 -CFLAGS+=-I${.CURDIR}/../common_source -Wall +CFLAGS+=-I${.CURDIR}/../common_source ${CWARNFLAGS} .PATH: ${.CURDIR}/../common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} diff --git a/usr.sbin/lpr/common_source/Makefile b/usr.sbin/lpr/common_source/Makefile index 6e76588..a9d7bfc 100644 --- a/usr.sbin/lpr/common_source/Makefile +++ b/usr.sbin/lpr/common_source/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1998/05/13 06:49:19 jb Exp $ +# $Id: Makefile,v 1.3 1998/06/11 03:53:23 jb Exp $ # # Library of internal routines for the print spooler suite. @@ -11,8 +11,7 @@ SRCS= common.c displayq.c net.c printcap.c request.c rmjob.c \ NOMAN= noman NOPROFILE= noprofile NOPIC= nopic -CFLAGS+= -Wall -Wnested-externs -Wmissing-prototypes \ - -Wstrict-prototypes -Wredundant-decls +CFLAGS+= ${CWARNFLAGS} install: diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 8cfacab..be95dc7 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95"; */ static const char rcsid[] = - "$Id$"; + "$Id: common.c,v 1.10 1997/12/02 20:45:18 wollman Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -79,7 +79,7 @@ getline(cfp) { register int linel = 0; register char *lp = line; - register c; + register int c; while ((c = getc(cfp)) != '\n' && linel+1 < sizeof(line)) { if (c == EOF) diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 650ab00..4aef15d 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/28/95"; */ static const char rcsid[] = - "$Id$"; + "$Id: cmds.c,v 1.11 1997/12/02 20:45:37 wollman Exp $"; #endif /* not lint */ /* @@ -70,8 +70,6 @@ static const char rcsid[] = #include "extern.h" #include "pathnames.h" -extern uid_t uid, euid; - static void abortpr __P((struct printer *, int)); static int doarg __P((char *)); static int doselect __P((struct dirent *)); diff --git a/usr.sbin/lpr/lpc/extern.h b/usr.sbin/lpr/lpc/extern.h index c61c474..a07a09a 100644 --- a/usr.sbin/lpr/lpc/extern.h +++ b/usr.sbin/lpr/lpc/extern.h @@ -35,6 +35,7 @@ */ +#include <sys/types.h> #include <sys/cdefs.h> @@ -57,3 +58,4 @@ __END_DECLS extern int NCMDS; extern struct cmd cmdtab[]; +extern uid_t uid, euid; diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c index af72370..7724b36 100644 --- a/usr.sbin/lpr/lpc/lpc.c +++ b/usr.sbin/lpr/lpc/lpc.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: lpc.c,v 1.6 1997/12/02 20:45:43 wollman Exp $"; + "$Id: lpc.c,v 1.7 1998/03/22 20:19:27 jb Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -74,16 +74,17 @@ static const char rcsid[] = #define MAX_CMDLINE 200 #define MAX_MARGV 20 -int fromatty; +static int fromatty; -char cmdline[MAX_CMDLINE]; -int margc; -char *margv[MAX_MARGV]; -int top; -uid_t uid, euid; +static char cmdline[MAX_CMDLINE]; +static int margc; +static char *margv[MAX_MARGV]; +static int top; +uid_t uid, euid; -jmp_buf toplevel; +static jmp_buf toplevel; +int main __P((int, char *[])); static void cmdscanner __P((int)); static struct cmd *getcmd __P((char *)); static void intr __P((int)); diff --git a/usr.sbin/lpr/lpd/Makefile b/usr.sbin/lpr/lpd/Makefile index 2152c4c..c97dc8e 100644 --- a/usr.sbin/lpr/lpd/Makefile +++ b/usr.sbin/lpr/lpd/Makefile @@ -1,8 +1,8 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $Id: Makefile,v 1.7 1998/05/13 06:48:18 jb Exp $ +# $Id: Makefile,v 1.8 1998/06/11 03:52:41 jb Exp $ PROG= lpd -CFLAGS+=-I${.CURDIR}/../common_source -Wall +CFLAGS+=-I${.CURDIR}/../common_source ${CWARNFLAGS} MAN8= lpd.8 SRCS= lpd.c printjob.c recvjob.c lpdchar.c modes.c DPADD= ${LIBLPR} diff --git a/usr.sbin/lpr/lpd/extern.h b/usr.sbin/lpr/lpd/extern.h index db732f5..9d85082 100644 --- a/usr.sbin/lpr/lpd/extern.h +++ b/usr.sbin/lpr/lpd/extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)extern.h 8.1 (Berkeley) 6/6/93 - * $Id$ + * $Id: extern.h,v 1.3 1997/12/02 20:45:53 wollman Exp $ */ #include <sys/cdefs.h> @@ -40,9 +40,11 @@ extern char scnkey[][HEIGHT]; /* in lpdchar.c */ extern char fromb[]; struct printer; +struct termios; __BEGIN_DECLS void printjob __P((struct printer *pp)); void startprinting __P((const char *printer)); void recvjob __P((const char *printer)); +int msearch __P((char *str, struct termios *ip)); __END_DECLS diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c index 50ee865..827bf0d 100644 --- a/usr.sbin/lpr/lpd/lpd.c +++ b/usr.sbin/lpr/lpd/lpd.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95"; #endif static const char rcsid[] = - "$Id: lpd.c,v 1.8 1997/09/24 06:47:54 charnier Exp $"; + "$Id: lpd.c,v 1.9 1997/12/02 20:45:54 wollman Exp $"; #endif /* not lint */ /* @@ -106,6 +106,7 @@ static const char rcsid[] = int lflag; /* log requests flag */ int from_remote; /* from remote socket */ +int main __P((int, char **)); static void reapchild __P((int)); static void mcleanup __P((int)); static void doit __P((void)); diff --git a/usr.sbin/lpr/lpd/modes.c b/usr.sbin/lpr/lpd/modes.c index c85c669..b24cffa 100644 --- a/usr.sbin/lpr/lpd/modes.c +++ b/usr.sbin/lpr/lpd/modes.c @@ -36,12 +36,14 @@ static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94"; */ static const char rcsid[] = - "$Id$"; + "$Id: modes.c,v 1.4 1997/12/02 20:45:56 wollman Exp $"; #endif /* not lint */ #include <stddef.h> #include <string.h> #include <termios.h> +#include "lp.local.h" +#include "extern.h" struct modes { char *name; diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index ea3d2fc..c635341 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; */ static const char rcsid[] = - "$Id: printjob.c,v 1.18 1997/12/02 20:45:58 wollman Exp $"; + "$Id: printjob.c,v 1.19 1998/08/21 18:08:46 brian Exp $"; #endif /* not lint */ @@ -141,8 +141,6 @@ static int sendit __P((struct printer *pp, char *file)); static void sendmail __P((struct printer *pp, char *user, int bombed)); static void setty __P((const struct printer *pp)); -void msearch __P((char *, struct termios *)); - void printjob(pp) struct printer *pp; @@ -1150,7 +1148,7 @@ scnline(key, p, c) register char *p; int c; { - register scnwidth; + register int scnwidth; for (scnwidth = WIDTH; --scnwidth;) { key <<= 1; @@ -1168,7 +1166,7 @@ scan_out(pp, scfd, scsp, dlm) char *scsp; { register char *strp; - register nchrs, j; + register int nchrs, j; char outbuf[LINELEN+1], *sp, c, cc; int d, scnhgt; @@ -1596,7 +1594,7 @@ setty(pp) char *s = strdup(pp->mode_set), *tmp; while ((tmp = strsep(&s, ",")) != NULL) { - msearch(tmp, &ttybuf); + (void) msearch(tmp, &ttybuf); } } if (pp->mode_set != 0 || pp->baud_rate > 0) { diff --git a/usr.sbin/lpr/lpq/lpq.c b/usr.sbin/lpr/lpq/lpq.c index 81151a2..04adc94 100644 --- a/usr.sbin/lpr/lpq/lpq.c +++ b/usr.sbin/lpr/lpq/lpq.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)lpq.c 8.3 (Berkeley) 5/10/95"; */ static const char rcsid[] = - "$Id$"; + "$Id: lpq.c,v 1.5 1997/12/02 20:46:04 wollman Exp $"; #endif /* not lint */ /* @@ -79,6 +79,7 @@ uid_t uid, euid; static int ckqueue __P((const struct printer *)); static void usage __P((void)); +int main __P((int, char **)); int main(argc, argv) diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 56fdaa6..54131ad 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -48,7 +48,7 @@ static const char copyright[] = static char sccsid[] = "@(#)from: lpr.c 8.4 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: lpr.c,v 1.23 1997/12/06 17:55:07 jdp Exp $"; + "$Id: lpr.c,v 1.24 1998/04/17 17:25:49 obrien Exp $"; #endif /* not lint */ /* @@ -550,7 +550,7 @@ static void cleanup(signo) int signo; { - register i; + register int i; signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); @@ -610,6 +610,9 @@ test(file) printf("%s: cannot open %s\n", name, file); return(-1); } + /* + * XXX Shall we add a similar test for ELF? + */ if (read(fd, &execb, sizeof(execb)) == sizeof(execb) && !N_BADMAG(execb)) { printf("%s: %s is an executable program", name, file); diff --git a/usr.sbin/lpr/lprm/lprm.c b/usr.sbin/lpr/lprm/lprm.c index 676869a..91c3e44 100644 --- a/usr.sbin/lpr/lprm/lprm.c +++ b/usr.sbin/lpr/lprm/lprm.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)lprm.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: lprm.c,v 1.3 1997/09/24 06:48:17 charnier Exp $"; + "$Id: lprm.c,v 1.4 1997/12/02 20:46:15 wollman Exp $"; #endif /* not lint */ /* @@ -82,6 +82,7 @@ uid_t uid, euid; /* real and effective user id's */ static char luser[16]; /* buffer for person */ +int main __P((int, char *[])); static void usage __P((void)); int diff --git a/usr.sbin/lpr/pac/Makefile b/usr.sbin/lpr/pac/Makefile index 9e0b03f..41105db 100644 --- a/usr.sbin/lpr/pac/Makefile +++ b/usr.sbin/lpr/pac/Makefile @@ -1,8 +1,8 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $Id: Makefile,v 1.4 1997/12/16 17:53:39 bde Exp $ +# $Id: Makefile,v 1.5 1998/03/07 09:48:14 bde Exp $ PROG= pac -CFLAGS+=-I${.CURDIR}/../common_source +CFLAGS+=-I${.CURDIR}/../common_source ${CWARNFLAGS} MAN8= pac.8 .PATH: ${.CURDIR}/../common_source DPADD= ${LIBLPR} diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c index bfb0f51..727c67f 100644 --- a/usr.sbin/lpr/pac/pac.c +++ b/usr.sbin/lpr/pac/pac.c @@ -43,7 +43,7 @@ static const char copyright[] = static char sccsid[] = "@(#)pac.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: pac.c,v 1.7 1997/09/24 06:48:24 charnier Exp $"; + "$Id: pac.c,v 1.8 1997/12/02 20:46:22 wollman Exp $"; #endif /* not lint */ /* @@ -56,9 +56,11 @@ static const char rcsid[] = #include <sys/param.h> #include <dirent.h> +#include <err.h> #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <unistd.h> #include "lp.h" #include "lp.local.h" @@ -94,6 +96,7 @@ struct hent { static struct hent *hashtab[HSHSIZE]; /* Hash table proper */ +int main __P((int, char **)); static void account __P((FILE *)); static int any __P((int, char [])); static int chkprinter __P((char *)); |