summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-08-30 17:38:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-08-30 17:38:14 +0000
commit7bf7e5116096ca874919597af7c068271601588a (patch)
tree4490d098e5e1e2d7e69d5748ed57929a89b9c586 /usr.sbin
parentdd5f144f85e5df88ab4a14a99cc83dc9a0b67b2e (diff)
o kill register
o add const to rcsid and copyright strings o placate -Wall
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/common_source/common.c20
-rw-r--r--usr.sbin/lpr/common_source/displayq.c24
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c20
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c8
-rw-r--r--usr.sbin/lpr/filters/lpf.c16
-rw-r--r--usr.sbin/lpr/lpc/cmds.c78
-rw-r--r--usr.sbin/lpr/lpc/cmdtab.c6
-rw-r--r--usr.sbin/lpr/lpc/lpc.c36
-rw-r--r--usr.sbin/lpr/lpd/key.c6
-rw-r--r--usr.sbin/lpr/lpd/lpd.c21
-rw-r--r--usr.sbin/lpr/lpd/lpdchar.c6
-rw-r--r--usr.sbin/lpr/lpd/modes.c6
-rw-r--r--usr.sbin/lpr/lpd/printjob.c49
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c18
-rw-r--r--usr.sbin/lpr/lpd/ttcompat.c62
-rw-r--r--usr.sbin/lpr/lpq/lpq.c14
-rw-r--r--usr.sbin/lpr/lpr/lpr.c44
-rw-r--r--usr.sbin/lpr/lprm/lprm.c10
-rw-r--r--usr.sbin/lpr/lptest/lptest.c10
-rw-r--r--usr.sbin/lpr/pac/pac.c52
20 files changed, 253 insertions, 253 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index 8711f9fc031..e0164cd5fae 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.11 2001/04/05 16:59:49 deraadt Exp $ */
+/* $OpenBSD: common.c,v 1.12 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -40,9 +40,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: common.c,v 1.11 2001/04/05 16:59:49 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: common.c,v 1.12 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -202,9 +202,9 @@ int
getline(cfp)
FILE *cfp;
{
- register int linel = 0;
- register char *lp = line;
- register c;
+ int linel = 0;
+ char *lp = line;
+ int c;
while ((c = getc(cfp)) != '\n' && linel+1<sizeof(line)) {
if (c == EOF)
@@ -232,9 +232,9 @@ int
getq(namelist)
struct queue *(*namelist[]);
{
- register struct dirent *d;
- register struct queue *q, **queue;
- register int nitems;
+ struct dirent *d;
+ struct queue *q, **queue;
+ int nitems;
struct stat stbuf;
DIR *dirp;
int arraysz;
@@ -318,7 +318,7 @@ char *
checkremote()
{
char name[MAXHOSTNAMELEN];
- register struct hostent *hp;
+ struct hostent *hp;
static char errbuf[128];
char *rp, *rp_b;
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index b1056f69e16..a9f24390c96 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: displayq.c,v 1.13 2001/08/30 17:23:59 millert Exp $ */
+/* $OpenBSD: displayq.c,v 1.14 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: displayq.c,v 1.13 2001/08/30 17:23:59 millert Exp $";
+static const char rcsid[] = "$OpenBSD: displayq.c,v 1.14 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -93,9 +93,9 @@ void
displayq(format)
int format;
{
- register struct queue *q;
- register int i, nitems, fd, ret, len;
- register char *cp, *ecp;
+ struct queue *q;
+ int i, nitems, fd, ret, len;
+ char *cp, *ecp;
struct queue **queue;
struct stat statb;
FILE *fp;
@@ -303,7 +303,7 @@ void
inform(cf)
char *cf;
{
- register int j;
+ int j;
FILE *cfp;
/*
@@ -368,8 +368,8 @@ int
inlist(name, file)
char *name, *file;
{
- register int *r, n;
- register char **u, *cp;
+ int *r, n;
+ char **u, *cp;
if (users == 0 && requests == 0)
return(1);
@@ -392,7 +392,7 @@ inlist(name, file)
void
show(nfile, file, copies)
- register char *nfile, *file;
+ char *nfile, *file;
int copies;
{
if (strcmp(nfile, " ") == 0)
@@ -408,7 +408,7 @@ show(nfile, file, copies)
*/
void
blankfill(n)
- register int n;
+ int n;
{
while (col++ < n)
putchar(' ');
@@ -422,7 +422,7 @@ dump(nfile, file, copies)
char *nfile, *file;
int copies;
{
- register short n, fill;
+ short n, fill;
struct stat lbuf;
/*
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index 4a121b23fc1..279d06c35c5 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmjob.c,v 1.10 2001/08/30 17:25:35 millert Exp $ */
+/* $OpenBSD: rmjob.c,v 1.11 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: rmjob.c,v 1.10 2001/08/30 17:25:35 millert Exp $";
+static const char rcsid[] = "$OpenBSD: rmjob.c,v 1.11 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -80,7 +80,7 @@ static void do_unlink __P((char *));
void
rmjob()
{
- register int i, nitems;
+ int i, nitems;
int assasinated = 0;
struct dirent **files;
char *cp;
@@ -166,8 +166,8 @@ int
lockchk(s)
char *s;
{
- register FILE *fp;
- register int i, n;
+ FILE *fp;
+ int i, n;
seteuid(euid);
if ((fp = fopen(s, "r")) == NULL) {
@@ -246,8 +246,8 @@ int
chk(file)
char *file;
{
- register int *r, n;
- register char **u, *cp;
+ int *r, n;
+ char **u, *cp;
FILE *cfp;
/*
@@ -320,8 +320,8 @@ isowner(owner, file)
void
rmremote()
{
- register char *cp;
- register int i, rem;
+ char *cp;
+ int i, rem;
char buf[BUFSIZ];
if (!remote)
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c
index d75c27b1e00..da8c5d0950b 100644
--- a/usr.sbin/lpr/common_source/startdaemon.c
+++ b/usr.sbin/lpr/common_source/startdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: startdaemon.c,v 1.3 1997/01/17 16:11:38 millert Exp $ */
+/* $OpenBSD: startdaemon.c,v 1.4 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993, 1994
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94";
+static const char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94";
#else
-static char rcsid[] = "$OpenBSD: startdaemon.c,v 1.3 1997/01/17 16:11:38 millert Exp $";
+static const char rcsid[] = "$OpenBSD: startdaemon.c,v 1.4 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -67,7 +67,7 @@ startdaemon(printer)
char *printer;
{
struct sockaddr_un un;
- register int s, n;
+ int s, n;
char buf[BUFSIZ];
s = socket(AF_UNIX, SOCK_STREAM, 0);
diff --git a/usr.sbin/lpr/filters/lpf.c b/usr.sbin/lpr/filters/lpf.c
index 7dae02418f3..85e918fdac1 100644
--- a/usr.sbin/lpr/filters/lpf.c
+++ b/usr.sbin/lpr/filters/lpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpf.c,v 1.4 1997/07/19 07:11:42 deraadt Exp $ */
+/* $OpenBSD: lpf.c,v 1.5 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,16 +34,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpf.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)lpf.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lpf.c,v 1.4 1997/07/19 07:11:42 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: lpf.c,v 1.5 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -52,8 +52,6 @@ static char rcsid[] = "$OpenBSD: lpf.c,v 1.4 1997/07/19 07:11:42 deraadt Exp $";
* with ^H's to overwritten lines. Thus this works like 'ul'
* but is much better: it can handle more than 2 overwrites
* and it is written with some style.
- * modified by kls to use register references instead of arrays
- * to try to gain a little speed.
*/
#include <signal.h>
@@ -82,9 +80,9 @@ main(argc, argv)
int argc;
char *argv[];
{
- register FILE *p = stdin, *o = stdout;
- register int i, col;
- register char *cp;
+ FILE *p = stdin, *o = stdout;
+ int i, col;
+ char *cp;
int done, linedone, maxrep;
char ch, *limit;
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c
index f4ca28b422a..206d8e435ad 100644
--- a/usr.sbin/lpr/lpc/cmds.c
+++ b/usr.sbin/lpr/lpc/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.13 2001/06/25 04:47:13 pjanzen Exp $ */
+/* $OpenBSD: cmds.c,v 1.14 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: cmds.c,v 1.13 2001/06/25 04:47:13 pjanzen Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.14 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -97,8 +97,8 @@ doabort(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -136,7 +136,7 @@ void
abortpr(dis)
int dis;
{
- register FILE *fp;
+ FILE *fp;
struct stat stbuf;
int pid, fd;
@@ -205,7 +205,7 @@ void
upstat(msg)
char *msg;
{
- register int fd;
+ int fd;
char statfile[MAXPATHLEN];
if (cgetstr(bp, "st", &ST) == -1)
@@ -233,8 +233,8 @@ clean(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -312,8 +312,8 @@ sortq(a, b)
void
cleanpr()
{
- register int i, n;
- register char *cp, *cp1, *lp;
+ int i, n;
+ char *cp, *cp1, *lp;
struct dirent **queue;
int nitems;
@@ -392,8 +392,8 @@ enable(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -461,8 +461,8 @@ disable(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -500,7 +500,7 @@ disable(argc, argv)
void
disablepr()
{
- register int fd;
+ int fd;
struct stat stbuf;
if (cgetstr(bp, "sd", &SD) == -1)
@@ -539,8 +539,8 @@ down(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -578,8 +578,8 @@ putmsg(argc, argv)
int argc;
char **argv;
{
- register int fd;
- register char *cp1, *cp2;
+ int fd;
+ char *cp1, *cp2;
char buf[1024];
struct stat stbuf;
@@ -661,8 +661,8 @@ restart(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -707,8 +707,8 @@ startcmd(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -781,11 +781,11 @@ status(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
- if (argc == 1 || argc == 2 && !strcmp(argv[1], "all")) {
+ if (argc == 1 || (argc == 2 && !strcmp(argv[1], "all"))) {
printer = prbuf;
while (cgetnext(&bp, printcapdb) > 0) {
cp1 = prbuf;
@@ -820,8 +820,8 @@ void
prstat()
{
struct stat stbuf;
- register int fd, i;
- register struct dirent *dp;
+ int fd, i;
+ struct dirent *dp;
DIR *dirp;
if (cgetstr(bp, "sd", &SD) == -1)
@@ -884,8 +884,8 @@ stop(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
@@ -923,7 +923,7 @@ stop(argc, argv)
void
stoppr()
{
- register int fd;
+ int fd;
struct stat stbuf;
if (cgetstr(bp, "sd", &SD) == -1)
@@ -969,7 +969,7 @@ topq(argc, argv)
int argc;
char *argv[];
{
- register int i;
+ int i;
struct stat stbuf;
int status, changed;
@@ -1060,9 +1060,9 @@ int
doarg(job)
char *job;
{
- register struct queue **qq;
- register int jobnum, n;
- register char *cp, *machine;
+ struct queue **qq;
+ int jobnum, n;
+ char *cp, *machine;
int cnt = 0;
FILE *fp;
@@ -1133,8 +1133,8 @@ up(argc, argv)
int argc;
char *argv[];
{
- register int c, status;
- register char *cp1, *cp2;
+ int c, status;
+ char *cp1, *cp2;
char prbuf[100];
if (argc == 1) {
diff --git a/usr.sbin/lpr/lpc/cmdtab.c b/usr.sbin/lpr/lpc/cmdtab.c
index 6b5a02ad4f0..c5eed18d597 100644
--- a/usr.sbin/lpr/lpc/cmdtab.c
+++ b/usr.sbin/lpr/lpc/cmdtab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmdtab.c,v 1.2 1997/01/17 16:12:35 millert Exp $ */
+/* $OpenBSD: cmdtab.c,v 1.3 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.2 1997/01/17 16:12:35 millert Exp $";
+static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.3 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index afd179e6384..8a7cbcb3fb3 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpc.c,v 1.8 2000/11/21 07:22:53 deraadt Exp $ */
+/* $OpenBSD: lpc.c,v 1.9 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: lpc.c,v 1.8 2000/11/21 07:22:53 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: lpc.c,v 1.9 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -96,7 +96,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- register struct cmd *c;
+ struct cmd *c;
euid = geteuid();
uid = getuid();
@@ -147,7 +147,7 @@ void
cmdscanner(top)
int top;
{
- register struct cmd *c;
+ struct cmd *c;
if (!top)
putchar('\n');
@@ -181,11 +181,11 @@ cmdscanner(top)
struct cmd *
getcmd(name)
- register char *name;
+ char *name;
{
- register char *p, *q;
- register struct cmd *c, *found;
- register int nmatches, longest;
+ char *p, *q;
+ struct cmd *c, *found;
+ int nmatches, longest;
longest = 0;
nmatches = 0;
@@ -214,9 +214,9 @@ getcmd(name)
void
makeargv()
{
- register char *cp;
- register char **argp = margv;
- register int n = 0;
+ char *cp;
+ char **argp = margv;
+ int n = 0;
margc = 0;
for (cp = cmdline; *cp && (cp - cmdline) < sizeof(cmdline) &&
@@ -246,10 +246,10 @@ help(argc, argv)
int argc;
char *argv[];
{
- register struct cmd *c;
+ struct cmd *c;
if (argc == 1) {
- register int i, j, w;
+ int i, j, w;
int columns, width = 0, lines;
extern int NCMDS;
@@ -284,7 +284,7 @@ help(argc, argv)
return;
}
while (--argc > 0) {
- register char *arg;
+ char *arg;
arg = *++argv;
c = getcmd(arg);
if (c == (struct cmd *)-1)
@@ -304,10 +304,10 @@ int
ingroup(grname)
char *grname;
{
+ gid_t gid;
+ int i;
static struct group *gptr = NULL;
static gid_t groups[NGROUPS];
- register gid_t gid;
- register int i;
static int maxgroups;
if (gptr == NULL) {
diff --git a/usr.sbin/lpr/lpd/key.c b/usr.sbin/lpr/lpd/key.c
index d024bd72cb1..a4f8df16149 100644
--- a/usr.sbin/lpr/lpd/key.c
+++ b/usr.sbin/lpr/lpd/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.2 1997/01/17 16:12:40 millert Exp $ */
+/* $OpenBSD: key.c,v 1.3 2001/08/30 17:38:13 millert Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)key.c 8.3 (Berkeley) 4/2/94";
+static const char sccsid[] = "@(#)key.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: key.c,v 1.2 1997/01/17 16:12:40 millert Exp $";
+static const char rcsid[] = "$OpenBSD: key.c,v 1.3 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index e7e22ef26ef..a41d85c6f17 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpd.c,v 1.17 2001/06/22 15:27:20 lebel Exp $ */
+/* $OpenBSD: lpd.c,v 1.18 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: lpd.c,v 1.7 1996/04/24 14:54:06 mrg Exp $ */
/*
@@ -36,16 +36,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95";
+static const char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95";
#else
-static char rcsid[] = "$OpenBSD: lpd.c,v 1.17 2001/06/22 15:27:20 lebel Exp $";
+static const char rcsid[] = "$OpenBSD: lpd.c,v 1.18 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -86,6 +86,7 @@ static char rcsid[] = "$OpenBSD: lpd.c,v 1.17 2001/06/22 15:27:20 lebel Exp $";
#include <sys/stat.h>
#include <sys/file.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
@@ -346,8 +347,8 @@ char *cmdnames[] = {
static void
doit()
{
- register char *cp;
- register int n;
+ char *cp;
+ int n;
for (;;) {
cp = cbuf;
@@ -455,7 +456,7 @@ static void
startup()
{
char *buf;
- register char *cp;
+ char *cp;
int pid;
/*
@@ -494,7 +495,7 @@ static int
ckqueue(cap)
char *cap;
{
- register struct dirent *d;
+ struct dirent *d;
DIR *dirp;
char *spooldir;
@@ -521,8 +522,8 @@ static void
chkhost(f)
struct sockaddr_in *f;
{
- register struct hostent *hp;
- register FILE *hostf;
+ struct hostent *hp;
+ FILE *hostf;
int first = 1;
int good = 0;
diff --git a/usr.sbin/lpr/lpd/lpdchar.c b/usr.sbin/lpr/lpd/lpdchar.c
index 52d43c955a3..2035c70e8f1 100644
--- a/usr.sbin/lpr/lpd/lpdchar.c
+++ b/usr.sbin/lpr/lpd/lpdchar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpdchar.c,v 1.2 1997/01/17 16:12:41 millert Exp $ */
+/* $OpenBSD: lpdchar.c,v 1.3 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,9 +35,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpdchar.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)lpdchar.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lpdchar.c,v 1.2 1997/01/17 16:12:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: lpdchar.c,v 1.3 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
diff --git a/usr.sbin/lpr/lpd/modes.c b/usr.sbin/lpr/lpd/modes.c
index fc47cd9a115..786bc524493 100644
--- a/usr.sbin/lpr/lpd/modes.c
+++ b/usr.sbin/lpr/lpd/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.3 1997/01/17 16:12:42 millert Exp $ */
+/* $OpenBSD: modes.c,v 1.4 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: modes.c,v 1.1 1995/10/03 15:02:45 hpeyerl Exp $ */
/*-
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94";
+static const char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: modes.c,v 1.3 1997/01/17 16:12:42 millert Exp $";
+static const char rcsid[] = "$OpenBSD: modes.c,v 1.4 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index a6bc7475f09..afc65886deb 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.24 2001/08/30 17:25:35 millert Exp $ */
+/* $OpenBSD: printjob.c,v 1.25 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: printjob.c,v 1.9.4.3 1996/07/12 22:31:39 jtc Exp $ */
/*
@@ -36,13 +36,13 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
+static const char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
#endif /* not lint */
@@ -70,6 +70,7 @@ static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <ctype.h>
#include "lp.h"
#include "lp.local.h"
#include "pathnames.h"
@@ -138,9 +139,9 @@ void
printjob()
{
struct stat stb;
- register struct queue *q, **qp;
+ struct queue *q, **qp;
struct queue **queue;
- register int i, nitems;
+ int i, nitems;
off_t pidoff;
int errcnt, count = 0;
@@ -315,7 +316,7 @@ static int
printit(file)
char *file;
{
- register int i;
+ int i;
char *cp;
int bombed = OK;
@@ -515,8 +516,8 @@ print(format, file)
int format;
char *file;
{
- register int n;
- register char *prog;
+ int n;
+ char *prog;
int fi, fo;
FILE *fp;
char *av[15], buf[BUFSIZ];
@@ -746,7 +747,7 @@ static int
sendit(file)
char *file;
{
- register int i, err = OK;
+ int i, err = OK;
char *cp, last[BUFSIZ];
/*
@@ -833,7 +834,7 @@ sendfile(type, file)
int type;
char *file;
{
- register int f, i, amt;
+ int f, i, amt;
struct stat stb;
char buf[BUFSIZ];
int sizerr, resp;
@@ -955,11 +956,11 @@ banner(name1, name2)
static char *
scnline(key, p, c)
- register int key;
- register char *p;
+ int key;
+ char *p;
int c;
{
- register scnwidth;
+ int scnwidth;
for (scnwidth = WIDTH; --scnwidth;) {
key <<= 1;
@@ -975,8 +976,8 @@ scan_out(scfd, scsp, dlm)
int scfd, dlm;
char *scsp;
{
- register char *strp;
- register nchrs, j;
+ char *strp;
+ int nchrs, j;
char outbuf[LINELEN+1], *sp, c, cc;
int d, scnhgt;
extern char scnkey[][HEIGHT]; /* in lpdchar.c */
@@ -1034,9 +1035,9 @@ sendmail(user, bombed)
char *user;
int bombed;
{
- register int i, nofile;
+ int i, nofile;
int p[2], s;
- register char *cp = NULL;
+ char *cp = NULL;
struct stat stb;
FILE *fp;
@@ -1113,7 +1114,7 @@ static int
dofork(action)
int action;
{
- register int i, pid;
+ int i, pid;
struct passwd *pw;
for (i = 0; i < 20; i++) {
@@ -1254,7 +1255,7 @@ init()
static void
openpr()
{
- register int i, nofile;
+ int i, nofile;
char *cp;
if (!remote && *LP) {
@@ -1308,7 +1309,7 @@ static void
opennet(cp)
char *cp;
{
- register int i;
+ int i;
int resp, port;
char save_ch;
@@ -1352,7 +1353,7 @@ opennet(cp)
static void
opentty()
{
- register int i;
+ int i;
for (i = 1; ; i = i < 32 ? i << 1 : i) {
pfd = open(LP, RW ? O_RDWR : O_WRONLY);
@@ -1380,7 +1381,7 @@ opentty()
static void
openrem()
{
- register int i, n;
+ int i, n;
int resp;
for (i = 1; ; i = i < 256 ? i << 1 : i) {
@@ -1456,7 +1457,7 @@ setty()
#if defined(__NetBSD__) || defined(__OpenBSD__)
cfsetspeed(&i.t, BR);
#else
- register struct bauds *bp;
+ struct bauds *bp;
for (bp = bauds; bp->baud; bp++)
if (BR == bp->baud)
break;
@@ -1542,7 +1543,7 @@ pstatus(msg, va_alist)
va_dcl
#endif
{
- register int fd;
+ int fd;
char buf[BUFSIZ];
va_list ap;
#ifdef __STDC__
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 11739e3029d..5c5f093c23c 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.14 2001/06/22 15:27:20 lebel Exp $ */
+/* $OpenBSD: recvjob.c,v 1.15 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
+static const char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: recvjob.c,v 1.14 2001/06/22 15:27:20 lebel Exp $";
+static const char rcsid[] = "$OpenBSD: recvjob.c,v 1.15 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -139,8 +139,8 @@ recvjob()
static int
readjob()
{
- register int size, nfiles;
- register char *cp;
+ int size, nfiles;
+ char *cp;
ack();
nfiles = 0;
@@ -228,9 +228,9 @@ readfile(file, size)
char *file;
int size;
{
- register char *cp;
+ char *cp;
char buf[BUFSIZ];
- register int i, j, amt;
+ int i, j, amt;
int fd, err;
fd = open(file, O_CREAT|O_EXCL|O_WRONLY, FILMOD);
@@ -309,7 +309,7 @@ read_number(fn)
char *fn;
{
char lin[80];
- register FILE *fp;
+ FILE *fp;
if ((fp = fopen(fn, "r")) == NULL)
return (0);
diff --git a/usr.sbin/lpr/lpd/ttcompat.c b/usr.sbin/lpr/lpd/ttcompat.c
index 8d8763b2a42..83e2cd9ac40 100644
--- a/usr.sbin/lpr/lpd/ttcompat.c
+++ b/usr.sbin/lpr/lpd/ttcompat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttcompat.c,v 1.3 1997/01/17 16:12:43 millert Exp $ */
+/* $OpenBSD: ttcompat.c,v 1.4 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1995
@@ -40,7 +40,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: ttcompat.c,v 1.3 1997/01/17 16:12:43 millert Exp $";
+static const char rcsid[] = "$OpenBSD: ttcompat.c,v 1.4 2001/08/30 17:38:13 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -67,11 +67,11 @@ static int
sttygetoflags(tp)
struct termios *tp;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t cflag = tp->c_cflag;
- register int flags = 0;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t cflag = tp->c_cflag;
+ int flags = 0;
if (ISSET(cflag, PARENB)) {
if (ISSET(iflag, INPCK)) {
@@ -108,10 +108,10 @@ sttysetoflags(tp, flags)
struct termios *tp;
int flags;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t cflag = tp->c_cflag;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t cflag = tp->c_cflag;
if (ISSET(flags, RAW)) {
iflag &= IXOFF;
@@ -176,11 +176,11 @@ sttyclearflags(tp, flags)
struct termios *tp;
int flags;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t cflag = tp->c_cflag;
- register int oflags = sttygetoflags(tp) & ~flags;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t cflag = tp->c_cflag;
+ int oflags = sttygetoflags(tp) & ~flags;
if (ISSET(flags, TANDEM))
CLR(iflag, IXOFF);
@@ -212,11 +212,11 @@ sttysetflags(tp, flags)
struct termios *tp;
int flags;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t cflag = tp->c_cflag;
- register int oflags = sttygetoflags(tp) | flags;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t cflag = tp->c_cflag;
+ int oflags = sttygetoflags(tp) | flags;
if (ISSET(flags, TANDEM))
SET(iflag, IXOFF);
@@ -247,11 +247,11 @@ sttyclearlflags(tp, flags)
struct termios *tp;
int flags;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t cflag = tp->c_cflag;
- register int oflags = sttygetoflags(tp) & ~flags;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t cflag = tp->c_cflag;
+ int oflags = sttygetoflags(tp) & ~flags;
/* Nothing we can do with CRTBS. */
if (ISSET(flags, PRTERA))
@@ -284,11 +284,11 @@ sttysetlflags(tp, flags)
struct termios *tp;
int flags;
{
- register tcflag_t iflag = tp->c_iflag;
- register tcflag_t oflag = tp->c_oflag;
- register tcflag_t lflag = tp->c_lflag;
- register tcflag_t cflag = tp->c_cflag;
- register int oflags = sttygetoflags(tp) | flags;
+ tcflag_t iflag = tp->c_iflag;
+ tcflag_t oflag = tp->c_oflag;
+ tcflag_t lflag = tp->c_lflag;
+ tcflag_t cflag = tp->c_cflag;
+ int oflags = sttygetoflags(tp) | flags;
/* Nothing we can do with CRTBS. */
if (ISSET(flags, PRTERA))
diff --git a/usr.sbin/lpr/lpq/lpq.c b/usr.sbin/lpr/lpq/lpq.c
index 62eeb72dc06..0b7b09cf550 100644
--- a/usr.sbin/lpr/lpq/lpq.c
+++ b/usr.sbin/lpr/lpq/lpq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpq.c,v 1.7 1997/01/17 16:12:44 millert Exp $ */
+/* $OpenBSD: lpq.c,v 1.8 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpq.c 8.3 (Berkeley) 5/10/95";
+static const char sccsid[] = "@(#)lpq.c 8.3 (Berkeley) 5/10/95";
#else
-static char rcsid[] = "$OpenBSD: lpq.c,v 1.7 1997/01/17 16:12:44 millert Exp $";
+static const char rcsid[] = "$OpenBSD: lpq.c,v 1.8 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -82,8 +82,8 @@ void usage __P((void));
int
main(argc, argv)
- register int argc;
- register char **argv;
+ int argc;
+ char **argv;
{
extern char *optarg;
extern int optind;
@@ -163,7 +163,7 @@ static int
ckqueue(cap)
char *cap;
{
- register struct dirent *d;
+ struct dirent *d;
DIR *dirp;
char *spooldir;
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index 7ace3904c97..d2d6bf42559 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpr.c,v 1.19 1997/07/25 20:12:13 mickey Exp $ */
+/* $OpenBSD: lpr.c,v 1.20 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: lpr.c,v 1.10 1996/03/21 18:12:25 jtc Exp $ */
/*
@@ -41,16 +41,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lpr.c 8.4 (Berkeley) 4/28/95";
+static const char sccsid[] = "@(#)lpr.c 8.4 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: lpr.c,v 1.19 1997/07/25 20:12:13 mickey Exp $";
+static const char rcsid[] = "$OpenBSD: lpr.c,v 1.20 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ main(argc, argv)
{
struct passwd *pw;
struct group *gptr;
- register char *arg, *cp;
+ char *arg, *cp;
char buf[BUFSIZ];
int i, f;
struct stat stb;
@@ -422,7 +422,7 @@ copy(f, n)
int f;
char n[];
{
- register int fd, i, nr, nc;
+ int fd, i, nr, nc;
char buf[BUFSIZ];
if (format == 'p')
@@ -462,11 +462,11 @@ copy(f, n)
*/
static char *
linked(file)
- register char *file;
+ char *file;
{
- register char *cp;
+ char *cp;
static char nfile[MAXPATHLEN];
- register int ret;
+ int ret;
if (*file != '/') {
if (getcwd(nfile, sizeof(nfile)) == NULL)
@@ -502,12 +502,12 @@ linked(file)
*/
static void
card(c, p2)
- register int c;
- register char *p2;
+ int c;
+ char *p2;
{
char buf[BUFSIZ];
- register char *p1 = buf;
- register int len = 2;
+ char *p1 = buf;
+ int len = 2;
*p1++ = c;
while ((c = *p2++) != '\0' && len < sizeof(buf)) {
@@ -525,7 +525,7 @@ static int
nfile(n)
char *n;
{
- register int f;
+ int f;
int oldumask = umask(0); /* should block signals */
seteuid(euid);
@@ -558,7 +558,7 @@ static void
cleanup(signo)
int signo;
{
- register i;
+ int i;
signal(SIGHUP, SIG_IGN);
signal(SIGINT, SIG_IGN);
@@ -594,8 +594,8 @@ test(file)
char *file;
{
struct exec execb;
- register int fd;
- register char *cp;
+ int fd;
+ char *cp;
if ((fd = open(file, O_RDONLY)) < 0) {
printf("%s: cannot open %s\n", name, file);
@@ -648,10 +648,10 @@ bad:
*/
static char *
itoa(i)
- register int i;
+ int i;
{
static char b[10] = "########";
- register char *p;
+ char *p;
p = &b[8];
do
@@ -693,8 +693,8 @@ chkprinter(s)
static void
mktemps()
{
- register int len, fd, n;
- register char *cp;
+ int len, fd, n;
+ char *cp;
char buf[BUFSIZ];
char *lmktemp();
@@ -737,7 +737,7 @@ lmktemp(id, num, len)
char *id;
int num, len;
{
- register char *s;
+ char *s;
if ((s = malloc(len)) == NULL)
fatal2("out of memory");
diff --git a/usr.sbin/lpr/lprm/lprm.c b/usr.sbin/lpr/lprm/lprm.c
index 0242948456a..b9ad446c5e4 100644
--- a/usr.sbin/lpr/lprm/lprm.c
+++ b/usr.sbin/lpr/lprm/lprm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lprm.c,v 1.6 2001/02/15 05:20:35 deraadt Exp $ */
+/* $OpenBSD: lprm.c,v 1.7 2001/08/30 17:38:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lprm.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)lprm.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lprm.c,v 1.6 2001/02/15 05:20:35 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: lprm.c,v 1.7 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -91,7 +91,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- register char *arg;
+ char *arg;
struct passwd *p;
uid = getuid();
diff --git a/usr.sbin/lpr/lptest/lptest.c b/usr.sbin/lpr/lptest/lptest.c
index d8264dce6bb..5ac3477c0f6 100644
--- a/usr.sbin/lpr/lptest/lptest.c
+++ b/usr.sbin/lpr/lptest/lptest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lptest.c,v 1.3 1997/01/17 16:12:48 millert Exp $ */
+/* $OpenBSD: lptest.c,v 1.4 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: lptest.c,v 1.5 1996/03/21 18:13:20 jtc Exp $ */
/*
@@ -36,16 +36,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)lptest.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)lptest.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lptest.c,v 1.3 1997/01/17 16:12:48 millert Exp $";
+static const char rcsid[] = "$OpenBSD: lptest.c,v 1.4 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -61,7 +61,7 @@ main(argc, argv)
char **argv;
{
int len, count;
- register i, j, fc, nc;
+ int i, j, fc, nc;
char outbuf[BUFSIZ];
setbuf(stdout, outbuf);
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index 86baedc0d50..9899a5fc1e5 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pac.c,v 1.9 1997/07/17 09:08:43 deraadt Exp $ */
+/* $OpenBSD: pac.c,v 1.10 2001/08/30 17:38:13 millert Exp $ */
/* $NetBSD: pac.c,v 1.7 1996/03/21 18:21:20 jtc Exp $ */
/*
@@ -36,16 +36,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)pac.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)pac.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: pac.c,v 1.9 1997/07/17 09:08:43 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: pac.c,v 1.10 2001/08/30 17:38:13 millert Exp $";
#endif
#endif /* not lint */
@@ -113,8 +113,8 @@ main(argc, argv)
int argc;
char **argv;
{
- register FILE *acct;
- register char *cp;
+ FILE *acct;
+ char *cp;
euid = geteuid(); /* these aren't used in pac(1) */
uid = getuid();
@@ -213,13 +213,13 @@ fprintf(stderr,
*/
static void
account(acct)
- register FILE *acct;
+ FILE *acct;
{
char linebuf[BUFSIZ];
double t;
- register char *cp, *cp2;
- register struct hent *hp;
- register int ic;
+ char *cp, *cp2;
+ struct hent *hp;
+ int ic;
while (fgets(linebuf, BUFSIZ, acct) != NULL) {
cp = linebuf;
@@ -258,8 +258,8 @@ static void
dumpit()
{
struct hent **base;
- register struct hent *hp, **ap;
- register int hno, c, runs;
+ struct hent *hp, **ap;
+ int hno, c, runs;
float feet;
hp = hashtab[0];
@@ -295,9 +295,9 @@ dumpit()
static void
rewrite()
{
- register struct hent *hp;
- register int i;
- register FILE *acctf;
+ struct hent *hp;
+ int i;
+ FILE *acctf;
if ((acctf = fopen(sumfile, "w")) == NULL) {
perror(sumfile);
@@ -336,8 +336,8 @@ static struct hent *
enter(name)
char name[];
{
- register struct hent *hp;
- register int h;
+ struct hent *hp;
+ int h;
if ((hp = lookup(name)) != NULL)
return(hp);
@@ -362,8 +362,8 @@ static struct hent *
lookup(name)
char name[];
{
- register int h;
- register struct hent *hp;
+ int h;
+ struct hent *hp;
h = hash(name);
for (hp = hashtab[h]; hp != NULL; hp = hp->h_link)
@@ -380,8 +380,8 @@ static int
hash(name)
char name[];
{
- register int h;
- register char *cp;
+ int h;
+ char *cp;
for (cp = name, h = 0; *cp; h = (h << 2) + *cp++)
;
@@ -396,8 +396,8 @@ any(ch, str)
int ch;
char str[];
{
- register int c = ch;
- register char *cp = str;
+ int c = ch;
+ char *cp = str;
while (*cp)
if (*cp++ == c)
@@ -414,8 +414,8 @@ static int
qucmp(a, b)
const void *a, *b;
{
- register struct hent *h1, *h2;
- register int r;
+ struct hent *h1, *h2;
+ int r;
h1 = *(struct hent **)a;
h2 = *(struct hent **)b;
@@ -432,7 +432,7 @@ qucmp(a, b)
*/
static int
chkprinter(s)
- register char *s;
+ char *s;
{
int stat;