diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-09-28 18:12:45 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-09-28 18:12:45 +0000 |
commit | 1b01d32bc8fc3e400f0de578f43f9a5b67acb19b (patch) | |
tree | aaae6ac5e4e1a1d4f6f30d3f0fe454ad507fd8ed /lib | |
parent | 3f71210b7773e81240667f31ce200b664bb5ee7b (diff) |
deregister + ansify, no change in object code. ok deraadt@ millert@
Diffstat (limited to 'lib')
61 files changed, 227 insertions, 385 deletions
diff --git a/lib/libc/stdio/clrerr.c b/lib/libc/stdio/clrerr.c index f04bad7f879..df1555c53d6 100644 --- a/lib/libc/stdio/clrerr.c +++ b/lib/libc/stdio/clrerr.c @@ -31,15 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: clrerr.c,v 1.4 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: clrerr.c,v 1.5 2004/09/28 18:12:43 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #undef clearerr void -clearerr(fp) - FILE *fp; +clearerr(FILE *fp) { flockfile(fp); __sclearerr(fp); diff --git a/lib/libc/stdio/fclose.c b/lib/libc/stdio/fclose.c index 4d315d76b50..604ca412b4a 100644 --- a/lib/libc/stdio/fclose.c +++ b/lib/libc/stdio/fclose.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fclose.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: fclose.c,v 1.4 2004/09/28 18:12:43 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -40,10 +40,9 @@ static char rcsid[] = "$OpenBSD: fclose.c,v 1.3 2003/06/02 20:18:36 millert Exp #include "local.h" int -fclose(fp) - register FILE *fp; +fclose(FILE *fp) { - register int r; + int r; if (fp->_flags == 0) { /* not open! */ errno = EBADF; diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index 9be277b4058..a5b5fc4852e 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fdopen.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: fdopen.c,v 1.4 2004/09/28 18:12:43 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -42,11 +42,9 @@ static char rcsid[] = "$OpenBSD: fdopen.c,v 1.3 2003/06/02 20:18:36 millert Exp #include "local.h" FILE * -fdopen(fd, mode) - int fd; - const char *mode; +fdopen(int fd, const char *mode) { - register FILE *fp; + FILE *fp; int flags, oflags, fdflags, tmp; if ((flags = __sflags(mode, &oflags)) == 0) diff --git a/lib/libc/stdio/feof.c b/lib/libc/stdio/feof.c index 756edfa0635..34d36d53caa 100644 --- a/lib/libc/stdio/feof.c +++ b/lib/libc/stdio/feof.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: feof.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: feof.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,8 +42,7 @@ static char rcsid[] = "$OpenBSD: feof.c,v 1.3 2003/06/02 20:18:36 millert Exp $" #undef feof int -feof(fp) - FILE *fp; +feof(FILE *fp) { return (__sfeof(fp)); } diff --git a/lib/libc/stdio/ferror.c b/lib/libc/stdio/ferror.c index 0dda864fc5d..0057c284721 100644 --- a/lib/libc/stdio/ferror.c +++ b/lib/libc/stdio/ferror.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ferror.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: ferror.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,8 +42,7 @@ static char rcsid[] = "$OpenBSD: ferror.c,v 1.3 2003/06/02 20:18:36 millert Exp #undef ferror int -ferror(fp) - FILE *fp; +ferror(FILE *fp) { return (__sferror(fp)); } diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c index 1b1d8d0c6e2..f6f5c1fdf6d 100644 --- a/lib/libc/stdio/fflush.c +++ b/lib/libc/stdio/fflush.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fflush.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: fflush.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -40,8 +40,7 @@ static char rcsid[] = "$OpenBSD: fflush.c,v 1.3 2003/06/02 20:18:36 millert Exp /* Flush a single file, or (if fp is NULL) all files. */ int -fflush(fp) - register FILE *fp; +fflush(FILE *fp) { if (fp == NULL) @@ -54,11 +53,10 @@ fflush(fp) } int -__sflush(fp) - register FILE *fp; +__sflush(FILE *fp) { - register unsigned char *p; - register int n, t; + unsigned char *p; + int n, t; t = fp->_flags; if ((t & __SWR) == 0) diff --git a/lib/libc/stdio/fgetc.c b/lib/libc/stdio/fgetc.c index 1636b85e640..09d11735728 100644 --- a/lib/libc/stdio/fgetc.c +++ b/lib/libc/stdio/fgetc.c @@ -31,14 +31,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fgetc.c,v 1.3 2003/06/02 20:18:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: fgetc.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> int -fgetc(fp) - FILE *fp; +fgetc(FILE *fp) { return (__sgetc(fp)); } diff --git a/lib/libc/stdio/fgetln.c b/lib/libc/stdio/fgetln.c index 72a26c6280a..bea90932f44 100644 --- a/lib/libc/stdio/fgetln.c +++ b/lib/libc/stdio/fgetln.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fgetln.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char *rcsid = "$OpenBSD: fgetln.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -47,9 +47,7 @@ static char *rcsid = "$OpenBSD: fgetln.c,v 1.4 2003/06/02 20:18:37 millert Exp $ #endif */ int -__slbexpand(fp, newsize) - FILE *fp; - size_t newsize; +__slbexpand(FILE *fp, size_t newsize) { void *p; @@ -73,12 +71,10 @@ __slbexpand(fp, newsize) * it if they wish. Thus, we set __SMOD in case the caller does. */ char * -fgetln(fp, lenp) - register FILE *fp; - size_t *lenp; +fgetln(FILE *fp, size_t *lenp) { - register unsigned char *p; - register size_t len; + unsigned char *p; + size_t len; size_t off; /* make sure there is input */ @@ -89,7 +85,7 @@ fgetln(fp, lenp) /* look for a newline in the input */ if ((p = memchr((void *)fp->_p, '\n', fp->_r)) != NULL) { - register char *ret; + char *ret; /* * Found one. Flag buffer as modified to keep fseek from @@ -116,7 +112,7 @@ fgetln(fp, lenp) #define OPTIMISTIC 80 for (len = fp->_r, off = 0;; len += fp->_r) { - register size_t diff; + size_t diff; /* * Make sure there is room for more bytes. Copy data from diff --git a/lib/libc/stdio/fgetpos.c b/lib/libc/stdio/fgetpos.c index 53996ca95d5..ace447a31da 100644 --- a/lib/libc/stdio/fgetpos.c +++ b/lib/libc/stdio/fgetpos.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fgetpos.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fgetpos.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -40,9 +40,7 @@ static char rcsid[] = "$OpenBSD: fgetpos.c,v 1.4 2003/06/02 20:18:37 millert Exp * fgetpos: like ftello. */ int -fgetpos(fp, pos) - FILE *fp; - fpos_t *pos; +fgetpos(FILE *fp, fpos_t *pos) { return((*pos = ftello(fp)) == (fpos_t)-1); } diff --git a/lib/libc/stdio/fgets.c b/lib/libc/stdio/fgets.c index 8c17df66f71..8c2267421c2 100644 --- a/lib/libc/stdio/fgets.c +++ b/lib/libc/stdio/fgets.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fgets.c,v 1.6 2003/10/08 10:29:55 avsm Exp $"; +static char rcsid[] = "$OpenBSD: fgets.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -45,10 +45,7 @@ static char rcsid[] = "$OpenBSD: fgets.c,v 1.6 2003/10/08 10:29:55 avsm Exp $"; * Do not return NULL if n == 1. */ char * -fgets(buf, n, fp) - char *buf; - register int n; - register FILE *fp; +fgets(char *buf, int n, FILE *fp) { size_t len; char *s; diff --git a/lib/libc/stdio/fileno.c b/lib/libc/stdio/fileno.c index d3204edb688..04e757f3119 100644 --- a/lib/libc/stdio/fileno.c +++ b/lib/libc/stdio/fileno.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fileno.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fileno.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,8 +42,7 @@ static char rcsid[] = "$OpenBSD: fileno.c,v 1.3 2003/06/02 20:18:37 millert Exp #undef fileno int -fileno(fp) - FILE *fp; +fileno(FILE *fp) { return (__sfileno(fp)); } diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index 0a7fd623770..733872f43ee 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: findfp.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: findfp.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -63,11 +63,10 @@ FILE __sF[3] = { struct glue __sglue = { &uglue, 3, __sF }; static struct glue * -moreglue(n) - register int n; +moreglue(int n) { - register struct glue *g; - register FILE *p; + struct glue *g; + FILE *p; static FILE empty; g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE)); @@ -86,11 +85,11 @@ moreglue(n) * Find a free FILE for fopen et al. */ FILE * -__sfp() +__sfp(void) { - register FILE *fp; - register int n; - register struct glue *g; + FILE *fp; + int n; + struct glue *g; if (!__sdidinit) __sinit(); @@ -124,9 +123,9 @@ found: * but documented historically for certain applications. Bad applications. */ void -f_prealloc() +f_prealloc(void) { - register struct glue *g; + struct glue *g; int n; n = getdtablesize() - FOPEN_MAX + 20; /* 20 for slop. */ @@ -145,7 +144,7 @@ f_prealloc() * The name `_cleanup' is, alas, fairly well known outside stdio. */ void -_cleanup() +_cleanup(void) { /* (void) _fwalk(fclose); */ (void) _fwalk(__sflush); /* `cheating' */ @@ -155,7 +154,7 @@ _cleanup() * __sinit() is called whenever stdio's internal variables must be set up. */ void -__sinit() +__sinit(void) { /* make sure we clean up on exit */ __atexit_register_cleanup(_cleanup); /* conservative */ diff --git a/lib/libc/stdio/flags.c b/lib/libc/stdio/flags.c index b557cc9727c..d00fe737767 100644 --- a/lib/libc/stdio/flags.c +++ b/lib/libc/stdio/flags.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: flags.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: flags.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -45,11 +45,9 @@ static char rcsid[] = "$OpenBSD: flags.c,v 1.4 2003/06/02 20:18:37 millert Exp $ * Return 0 on error. */ int -__sflags(mode, optr) - register const char *mode; - int *optr; +__sflags(const char *mode, int *optr) { - register int ret, m, o; + int ret, m, o; switch (*mode++) { diff --git a/lib/libc/stdio/flockfile.c b/lib/libc/stdio/flockfile.c index 35cadb38284..c75e050d4f3 100644 --- a/lib/libc/stdio/flockfile.c +++ b/lib/libc/stdio/flockfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: flockfile.c,v 1.6 2004/06/07 21:11:23 marc Exp $ */ +/* $OpenBSD: flockfile.c,v 1.7 2004/09/28 18:12:44 otto Exp $ */ #include <sys/time.h> #include <stdio.h> @@ -23,22 +23,19 @@ WEAK_ALIAS(ftrylockfile); WEAK_ALIAS(funlockfile); void -WEAK_NAME(flockfile)(fp) - FILE * fp; +WEAK_NAME(flockfile)(FILE * fp) { } int -WEAK_NAME(ftrylockfile)(fp) - FILE * fp; +WEAK_NAME(ftrylockfile)(FILE *fp) { return 0; } void -WEAK_NAME(funlockfile)(fp) - FILE * fp; +WEAK_NAME(funlockfile)(FILE * fp) { } diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c index cf7a3848724..1b49db2bf50 100644 --- a/lib/libc/stdio/fopen.c +++ b/lib/libc/stdio/fopen.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fopen.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fopen.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -42,12 +42,10 @@ static char rcsid[] = "$OpenBSD: fopen.c,v 1.3 2003/06/02 20:18:37 millert Exp $ #include "local.h" FILE * -fopen(file, mode) - const char *file; - const char *mode; +fopen(const char *file, const char *mode) { - register FILE *fp; - register int f; + FILE *fp; + int f; int flags, oflags; if ((flags = __sflags(mode, &oflags)) == 0) diff --git a/lib/libc/stdio/fpurge.c b/lib/libc/stdio/fpurge.c index 72470e9c377..1891bb9b491 100644 --- a/lib/libc/stdio/fpurge.c +++ b/lib/libc/stdio/fpurge.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpurge.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fpurge.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -44,8 +44,7 @@ static char rcsid[] = "$OpenBSD: fpurge.c,v 1.3 2003/06/02 20:18:37 millert Exp * given FILE's buffer empty. */ int -fpurge(fp) - register FILE *fp; +fpurge(FILE *fp) { if (!fp->_flags) { errno = EBADF; diff --git a/lib/libc/stdio/fputc.c b/lib/libc/stdio/fputc.c index 20656282dcf..f64dfd4d60a 100644 --- a/lib/libc/stdio/fputc.c +++ b/lib/libc/stdio/fputc.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fputc.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fputc.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -39,9 +39,7 @@ static char rcsid[] = "$OpenBSD: fputc.c,v 1.5 2003/06/02 20:18:37 millert Exp $ #include "local.h" int -fputc(c, fp) - int c; - register FILE *fp; +fputc(int c, FILE *fp) { if (cantwrite(fp)) { errno = EBADF; diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c index 1a0a5a56591..99194a68ee6 100644 --- a/lib/libc/stdio/fputs.c +++ b/lib/libc/stdio/fputs.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fputs.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fputs.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,9 +42,7 @@ static char rcsid[] = "$OpenBSD: fputs.c,v 1.4 2003/06/02 20:18:37 millert Exp $ * Write the given string to the given file. */ int -fputs(s, fp) - const char *s; - FILE *fp; +fputs(const char *s, FILE *fp) { struct __suio uio; struct __siov iov; diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c index 5ccc7a6b05c..d4b118514ac 100644 --- a/lib/libc/stdio/fread.c +++ b/lib/libc/stdio/fread.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fread.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fread.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -39,14 +39,11 @@ static char rcsid[] = "$OpenBSD: fread.c,v 1.4 2003/06/02 20:18:37 millert Exp $ #include "local.h" size_t -fread(buf, size, count, fp) - void *buf; - size_t size, count; - register FILE *fp; +fread(void *buf, size_t size, size_t count, FILE *fp) { - register size_t resid; - register char *p; - register int r; + size_t resid; + char *p; + int r; size_t total; /* diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 7fcbe1d419a..9267d4421a7 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: freopen.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: freopen.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -49,11 +49,9 @@ static char rcsid[] = "$OpenBSD: freopen.c,v 1.5 2003/06/02 20:18:37 millert Exp * all possible, no matter what. */ FILE * -freopen(file, mode, fp) - const char *file, *mode; - register FILE *fp; +freopen(const char *file, const char *mode, FILE *fp) { - register int f; + int f; int flags, isopen, oflags, sverrno, wantfd; if ((flags = __sflags(mode, &oflags)) == 0) { diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index 22273b013a0..af9463a2cbb 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fseek.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fseek.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -49,12 +49,9 @@ static char rcsid[] = "$OpenBSD: fseek.c,v 1.5 2003/06/02 20:18:37 millert Exp $ * `Whence' must be one of the three SEEK_* macros. */ int -fseeko(fp, offset, whence) - register FILE *fp; - off_t offset; - int whence; +fseeko(FILE *fp, off_t offset, int whence) { - register fpos_t (*seekfn)(void *, fpos_t, int); + fpos_t (*seekfn)(void *, fpos_t, int); fpos_t target, curoff; size_t n; struct stat st; @@ -188,7 +185,7 @@ fseeko(fp, offset, whence) */ if ((fp->_flags & __SMOD) == 0 && target >= curoff && target < curoff + n) { - register int o = target - curoff; + int o = target - curoff; fp->_p = fp->_bf._base + o; fp->_r = n - o; @@ -249,10 +246,7 @@ dumb: __indr_reference(fseeko, fseek); #else int -fseek(fp, offset, whence) - register FILE *fp; - long offset; - int whence; +fseek(FILE *fp, long offset, int whence) { off_t off = offset; diff --git a/lib/libc/stdio/fsetpos.c b/lib/libc/stdio/fsetpos.c index 04f1bdc8002..ccf349d3024 100644 --- a/lib/libc/stdio/fsetpos.c +++ b/lib/libc/stdio/fsetpos.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fsetpos.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fsetpos.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -40,9 +40,7 @@ static char rcsid[] = "$OpenBSD: fsetpos.c,v 1.4 2003/06/02 20:18:37 millert Exp * fsetpos: like fseeko. */ int -fsetpos(iop, pos) - FILE *iop; - const fpos_t *pos; +fsetpos(FILE *iop, const fpos_t *pos) { return (fseeko(iop, (off_t)*pos, SEEK_SET)); } diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c index 0d35db45cb1..c511706bb78 100644 --- a/lib/libc/stdio/ftell.c +++ b/lib/libc/stdio/ftell.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ftell.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: ftell.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,10 +42,9 @@ static char rcsid[] = "$OpenBSD: ftell.c,v 1.4 2003/06/02 20:18:37 millert Exp $ * ftello: return current offset. */ off_t -ftello(fp) - register FILE *fp; +ftello(FILE *fp) { - register fpos_t pos; + fpos_t pos; if (fp->_seek == NULL) { errno = ESPIPE; /* historic practice */ @@ -91,8 +90,7 @@ ftello(fp) __indr_reference(ftello, ftell); #else long -ftell(fp) - register FILE *fp; +ftell(FILE *fp) { long pos; diff --git a/lib/libc/stdio/funopen.c b/lib/libc/stdio/funopen.c index 0f720994dc5..fd0496c43da 100644 --- a/lib/libc/stdio/funopen.c +++ b/lib/libc/stdio/funopen.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: funopen.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static const char rcsid[] = "$OpenBSD: funopen.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -43,7 +43,7 @@ funopen(const void *cookie, int (*readfn)(void *, char *, int), int (*writefn)(void *, const char *, int), fpos_t (*seekfn)(void *, fpos_t, int), int (*closefn)(void *)) { - register FILE *fp; + FILE *fp; int flags; if (readfn == NULL) { diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c index 80df7032f9a..474bea8e299 100644 --- a/lib/libc/stdio/fvwrite.c +++ b/lib/libc/stdio/fvwrite.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.12 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.13 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -48,14 +48,12 @@ static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.12 2003/06/02 20:18:37 millert Ex * to the three different kinds of output buffering is handled here. */ int -__sfvwrite(fp, uio) - register FILE *fp; - register struct __suio *uio; +__sfvwrite(FILE *fp, struct __suio *uio) { - register size_t len; - register char *p; - register struct __siov *iov; - register int w, s; + size_t len; + char *p; + struct __siov *iov; + int w, s; char *nl; int nlknown, nldist; diff --git a/lib/libc/stdio/fwalk.c b/lib/libc/stdio/fwalk.c index 741c1c98766..b1b86c1aca2 100644 --- a/lib/libc/stdio/fwalk.c +++ b/lib/libc/stdio/fwalk.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fwalk.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fwalk.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -40,12 +40,11 @@ static char rcsid[] = "$OpenBSD: fwalk.c,v 1.4 2003/06/02 20:18:37 millert Exp $ #include "glue.h" int -_fwalk(function) - register int (*function)(); +_fwalk(int (*function)()) { - register FILE *fp; - register int n, ret; - register struct glue *g; + FILE *fp; + int n, ret; + struct glue *g; ret = 0; for (g = &__sglue; g != NULL; g = g->next) diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c index e58b9350071..83574b47156 100644 --- a/lib/libc/stdio/fwrite.c +++ b/lib/libc/stdio/fwrite.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fwrite.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: fwrite.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -43,10 +43,7 @@ static char rcsid[] = "$OpenBSD: fwrite.c,v 1.3 2003/06/02 20:18:37 millert Exp * Return the number of whole objects written. */ size_t -fwrite(buf, size, count, fp) - const void *buf; - size_t size, count; - FILE *fp; +fwrite(const void *buf, size_t size, size_t count, FILE *fp) { size_t n; struct __suio uio; diff --git a/lib/libc/stdio/getc.c b/lib/libc/stdio/getc.c index a8257f90a6c..391c5dc6a2a 100644 --- a/lib/libc/stdio/getc.c +++ b/lib/libc/stdio/getc.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getc.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: getc.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,8 +42,7 @@ static char rcsid[] = "$OpenBSD: getc.c,v 1.4 2003/06/02 20:18:37 millert Exp $" #undef getc_unlocked int -getc_unlocked(fp) - FILE *fp; +getc_unlocked(FILE *fp) { return (__sgetc(fp)); } @@ -54,8 +53,7 @@ getc_unlocked(fp) #undef getc int -getc(fp) - register FILE *fp; +getc(FILE *fp) { int c; diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c index f1719bcc4b0..e5a72d7a74e 100644 --- a/lib/libc/stdio/getchar.c +++ b/lib/libc/stdio/getchar.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getchar.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: getchar.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,7 +42,7 @@ static char rcsid[] = "$OpenBSD: getchar.c,v 1.5 2003/06/02 20:18:37 millert Exp #undef getchar_unlocked int -getchar_unlocked() +getchar_unlocked(void) { return (getc_unlocked(stdin)); } @@ -55,7 +55,7 @@ getchar_unlocked() #undef getchar int -getchar() +getchar(void) { return (getc(stdin)); } diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c index 30f1c95f99c..4d6a83d0b12 100644 --- a/lib/libc/stdio/gets.c +++ b/lib/libc/stdio/gets.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gets.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: gets.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -40,11 +40,10 @@ __warn_references(gets, "warning: gets() is very unsafe; consider using fgets()"); char * -gets(buf) - char *buf; +gets(char *buf) { - register int c; - register char *s; + int c; + char *s; for (s = buf; (c = getchar()) != '\n';) if (c == EOF) diff --git a/lib/libc/stdio/getw.c b/lib/libc/stdio/getw.c index e6a6d971950..2872c3c4df4 100644 --- a/lib/libc/stdio/getw.c +++ b/lib/libc/stdio/getw.c @@ -31,14 +31,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getw.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: getw.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> int -getw(fp) - FILE *fp; +getw(FILE *fp) { int x; diff --git a/lib/libc/stdio/makebuf.c b/lib/libc/stdio/makebuf.c index 847dda91864..fd06606b634 100644 --- a/lib/libc/stdio/makebuf.c +++ b/lib/libc/stdio/makebuf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: makebuf.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: makebuf.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -49,11 +49,10 @@ static char rcsid[] = "$OpenBSD: makebuf.c,v 1.5 2003/06/02 20:18:37 millert Exp * optimisation) right after the fstat() that finds the buffer size. */ void -__smakebuf(fp) - register FILE *fp; +__smakebuf(FILE *fp) { - register void *p; - register int flags; + void *p; + int flags; size_t size; int couldbetty; @@ -82,10 +81,7 @@ __smakebuf(fp) * Internal routine to determine `proper' buffering for a file. */ int -__swhatbuf(fp, bufsize, couldbetty) - register FILE *fp; - size_t *bufsize; - int *couldbetty; +__swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) { struct stat st; diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 91e825bb158..b3ad9af7fcd 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: mktemp.c,v 1.17 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: mktemp.c,v 1.18 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -43,9 +43,7 @@ static char rcsid[] = "$OpenBSD: mktemp.c,v 1.17 2003/06/02 20:18:37 millert Exp static int _gettemp(char *, int *, int, int); int -mkstemps(path, slen) - char *path; - int slen; +mkstemps(char *path, int slen) { int fd; @@ -53,8 +51,7 @@ mkstemps(path, slen) } int -mkstemp(path) - char *path; +mkstemp(char *path) { int fd; @@ -62,8 +59,7 @@ mkstemp(path) } char * -mkdtemp(path) - char *path; +mkdtemp(char *path) { return(_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL); } @@ -71,8 +67,7 @@ mkdtemp(path) char *_mktemp(char *); char * -_mktemp(path) - char *path; +_mktemp(char *path) { return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL); } @@ -81,21 +76,16 @@ __warn_references(mktemp, "warning: mktemp() possibly used unsafely; consider using mkstemp()"); char * -mktemp(path) - char *path; +mktemp(char *path) { return(_mktemp(path)); } static int -_gettemp(path, doopen, domkdir, slen) - char *path; - register int *doopen; - int domkdir; - int slen; +_gettemp(char *path, int *doopen, int domkdir, int slen) { - register char *start, *trv, *suffp; + char *start, *trv, *suffp; struct stat sbuf; int rval; pid_t pid; diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c index b5e855014a6..e341805482e 100644 --- a/lib/libc/stdio/perror.c +++ b/lib/libc/stdio/perror.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: perror.c,v 1.6 2004/05/03 05:07:34 espie Exp $"; +static char rcsid[] = "$OpenBSD: perror.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -40,10 +40,9 @@ static char rcsid[] = "$OpenBSD: perror.c,v 1.6 2004/05/03 05:07:34 espie Exp $" #include <limits.h> void -perror(s) - const char *s; +perror(const char *s) { - register struct iovec *v; + struct iovec *v; struct iovec iov[4]; char buf[NL_TEXTMAX]; diff --git a/lib/libc/stdio/putc.c b/lib/libc/stdio/putc.c index a5fb50ecebe..afeac63789f 100644 --- a/lib/libc/stdio/putc.c +++ b/lib/libc/stdio/putc.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: putc.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: putc.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -44,9 +44,7 @@ static char rcsid[] = "$OpenBSD: putc.c,v 1.5 2003/06/02 20:18:37 millert Exp $" #undef putc_unlocked int -putc_unlocked(c, fp) - int c; - register FILE *fp; +putc_unlocked(int c, FILE *fp) { if (cantwrite(fp)) { errno = EBADF; @@ -61,9 +59,7 @@ putc_unlocked(c, fp) #undef putc int -putc(c, fp) - int c; - FILE *fp; +putc(int c, FILE *fp) { int ret; diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c index aa6236d0db3..109ad19c622 100644 --- a/lib/libc/stdio/putchar.c +++ b/lib/libc/stdio/putchar.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: putchar.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: putchar.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -41,8 +41,7 @@ static char rcsid[] = "$OpenBSD: putchar.c,v 1.5 2003/06/02 20:18:37 millert Exp * A subrouting version of the macro putchar_unlocked */ int -putchar_unlocked(c) - int c; +putchar_unlocked(int c) { FILE *so = stdout; @@ -55,8 +54,7 @@ putchar_unlocked(c) * A subroutine version of the macro putchar */ int -putchar(c) - int c; +putchar(int c) { FILE *so = stdout; diff --git a/lib/libc/stdio/puts.c b/lib/libc/stdio/puts.c index 7d8ed98a125..c1e35d628e6 100644 --- a/lib/libc/stdio/puts.c +++ b/lib/libc/stdio/puts.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: puts.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: puts.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -42,8 +42,7 @@ static char rcsid[] = "$OpenBSD: puts.c,v 1.4 2003/06/02 20:18:37 millert Exp $" * Write the given string to stdout, appending a newline. */ int -puts(s) - char const *s; +puts(char const *s) { size_t c = strlen(s); struct __suio uio; diff --git a/lib/libc/stdio/putw.c b/lib/libc/stdio/putw.c index 97f6e17c604..8bea9b55abd 100644 --- a/lib/libc/stdio/putw.c +++ b/lib/libc/stdio/putw.c @@ -31,16 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: putw.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: putw.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #include "fvwrite.h" int -putw(w, fp) - int w; - FILE *fp; +putw(int w, FILE *fp) { struct __suio uio; struct __siov iov; diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c index ca1a2f05d3e..d94bb17e9c1 100644 --- a/lib/libc/stdio/refill.c +++ b/lib/libc/stdio/refill.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: refill.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: refill.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -40,8 +40,7 @@ static char rcsid[] = "$OpenBSD: refill.c,v 1.6 2003/06/02 20:18:37 millert Exp #include "local.h" static int -lflush(fp) - FILE *fp; +lflush(FILE *fp) { if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) @@ -54,8 +53,7 @@ lflush(fp) * Return EOF on eof or error, 0 otherwise. */ int -__srefill(fp) - register FILE *fp; +__srefill(FILE *fp) { /* make sure stdio is set up */ diff --git a/lib/libc/stdio/remove.c b/lib/libc/stdio/remove.c index 56eace1f857..10c004930bd 100644 --- a/lib/libc/stdio/remove.c +++ b/lib/libc/stdio/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.5 2003/06/02 20:18:37 millert Exp $ */ +/* $OpenBSD: remove.c,v 1.6 2004/09/28 18:12:44 otto Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)remove.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: remove.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: remove.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -45,8 +45,7 @@ static char rcsid[] = "$OpenBSD: remove.c,v 1.5 2003/06/02 20:18:37 millert Exp #include <sys/stat.h> int -remove(file) - const char *file; +remove(const char *file) { struct stat st; diff --git a/lib/libc/stdio/rewind.c b/lib/libc/stdio/rewind.c index ab813ccf3c8..3713c5dfdc3 100644 --- a/lib/libc/stdio/rewind.c +++ b/lib/libc/stdio/rewind.c @@ -31,15 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: rewind.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: rewind.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> #include <stdio.h> void -rewind(fp) - register FILE *fp; +rewind(FILE *fp) { (void) fseek(fp, 0L, SEEK_SET); clearerr(fp); diff --git a/lib/libc/stdio/rget.c b/lib/libc/stdio/rget.c index fdda193b5b8..cc258ba6ca0 100644 --- a/lib/libc/stdio/rget.c +++ b/lib/libc/stdio/rget.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: rget.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: rget.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -43,8 +43,7 @@ static char rcsid[] = "$OpenBSD: rget.c,v 1.4 2003/06/02 20:18:37 millert Exp $" * in the newly-filled buffer. */ int -__srget(fp) - register FILE *fp; +__srget(FILE *fp) { if (__srefill(fp) == 0) { fp->_r--; diff --git a/lib/libc/stdio/setbuf.c b/lib/libc/stdio/setbuf.c index 2534fa2cf13..a1b1630a5b2 100644 --- a/lib/libc/stdio/setbuf.c +++ b/lib/libc/stdio/setbuf.c @@ -31,16 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: setbuf.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: setbuf.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #include "local.h" void -setbuf(fp, buf) - FILE *fp; - char *buf; +setbuf(FILE *fp, char *buf) { (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); } diff --git a/lib/libc/stdio/setbuffer.c b/lib/libc/stdio/setbuffer.c index 400511bb8be..3135b0ff73c 100644 --- a/lib/libc/stdio/setbuffer.c +++ b/lib/libc/stdio/setbuffer.c @@ -31,16 +31,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: setbuffer.c,v 1.3 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: setbuffer.c,v 1.4 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> void -setbuffer(fp, buf, size) - register FILE *fp; - char *buf; - int size; +setbuffer(FILE *fp, char *buf, int size) { (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size); @@ -50,8 +47,7 @@ setbuffer(fp, buf, size) * set line buffering */ int -setlinebuf(fp) - FILE *fp; +setlinebuf(FILE *fp) { return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0)); diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c index 8ab63516022..34ab32dcf67 100644 --- a/lib/libc/stdio/setvbuf.c +++ b/lib/libc/stdio/setvbuf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -43,13 +43,9 @@ static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.5 2003/06/02 20:18:37 millert Exp * a buffer. */ int -setvbuf(fp, buf, mode, size) - register FILE *fp; - char *buf; - register int mode; - register size_t size; +setvbuf(FILE *fp, char *buf, int mode, size_t size) { - register int ret, flags; + int ret, flags; size_t iosize; int ttyflag; diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c index 85887f71a93..3115b297d02 100644 --- a/lib/libc/stdio/sscanf.c +++ b/lib/libc/stdio/sscanf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: sscanf.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: sscanf.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -41,10 +41,7 @@ static char rcsid[] = "$OpenBSD: sscanf.c,v 1.6 2003/06/02 20:18:37 millert Exp /* ARGSUSED */ static int -eofread(cookie, buf, len) - void *cookie; - char *buf; - int len; +eofread(void *cookie, char *buf, int len) { return (0); diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index c2c2271ed50..b0605e45057 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: stdio.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: stdio.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <fcntl.h> @@ -44,13 +44,10 @@ static char rcsid[] = "$OpenBSD: stdio.c,v 1.5 2003/06/02 20:18:37 millert Exp $ * These maintain the `known seek offset' for seek optimisation. */ int -__sread(cookie, buf, n) - void *cookie; - char *buf; - int n; +__sread(void *cookie, char *buf, int n) { - register FILE *fp = cookie; - register int ret; + FILE *fp = cookie; + int ret; ret = read(fp->_file, buf, n); /* if the read succeeded, update the current offset */ @@ -62,12 +59,9 @@ __sread(cookie, buf, n) } int -__swrite(cookie, buf, n) - void *cookie; - char const *buf; - int n; +__swrite(void *cookie, char const *buf, int n) { - register FILE *fp = cookie; + FILE *fp = cookie; if (fp->_flags & __SAPP) (void) lseek(fp->_file, (off_t)0, SEEK_END); @@ -76,13 +70,10 @@ __swrite(cookie, buf, n) } fpos_t -__sseek(cookie, offset, whence) - void *cookie; - fpos_t offset; - int whence; +__sseek(void *cookie, fpos_t offset, int whence) { - register FILE *fp = cookie; - register off_t ret; + FILE *fp = cookie; + off_t ret; ret = lseek(fp->_file, (off_t)offset, whence); if (ret == (off_t)-1) diff --git a/lib/libc/stdio/tempnam.c b/lib/libc/stdio/tempnam.c index 6f211eaa765..2c71e73b070 100644 --- a/lib/libc/stdio/tempnam.c +++ b/lib/libc/stdio/tempnam.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: tempnam.c,v 1.12 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: tempnam.c,v 1.13 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -45,8 +45,7 @@ __warn_references(tempnam, extern char *_mktemp(char *); char * -tempnam(dir, pfx) - const char *dir, *pfx; +tempnam(const char *dir, const char *pfx) { int sverrno; char *f, *name; diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c index f60411e8294..93459ec735a 100644 --- a/lib/libc/stdio/tmpfile.c +++ b/lib/libc/stdio/tmpfile.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: tmpfile.c,v 1.7 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: tmpfile.c,v 1.8 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -44,7 +44,7 @@ static char rcsid[] = "$OpenBSD: tmpfile.c,v 1.7 2003/06/02 20:18:37 millert Exp #include <paths.h> FILE * -tmpfile() +tmpfile(void) { sigset_t set, oset; FILE *fp; diff --git a/lib/libc/stdio/tmpnam.c b/lib/libc/stdio/tmpnam.c index 7029eed3777..a2f17dfe5ae 100644 --- a/lib/libc/stdio/tmpnam.c +++ b/lib/libc/stdio/tmpnam.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: tmpnam.c,v 1.8 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: tmpnam.c,v 1.9 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -45,8 +45,7 @@ __warn_references(tmpnam, extern char *_mktemp(char *); char * -tmpnam(s) - char *s; +tmpnam(char *s) { static u_long tmpcount; static char buf[L_tmpnam]; diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c index 268f89a63ab..3407aecb324 100644 --- a/lib/libc/stdio/ungetc.c +++ b/lib/libc/stdio/ungetc.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ungetc.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: ungetc.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -47,11 +47,10 @@ static int __submore(FILE *); * are all at the end (stack-style). */ static int -__submore(fp) - FILE *fp; +__submore(FILE *fp) { - register int i; - register unsigned char *p; + int i; + unsigned char *p; if (fp->_ub._base == fp->_ubuf) { /* @@ -80,9 +79,7 @@ __submore(fp) } int -ungetc(c, fp) - int c; - register FILE *fp; +ungetc(int c, FILE *fp) { if (c == EOF) return (EOF); diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index b1b37678931..ee7f584efa2 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vasprintf.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */ +/* $OpenBSD: vasprintf.c,v 1.9 2004/09/28 18:12:44 otto Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vasprintf.c,v 1.8 2003/06/17 21:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: vasprintf.c,v 1.9 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -25,10 +25,7 @@ static char rcsid[] = "$OpenBSD: vasprintf.c,v 1.8 2003/06/17 21:56:24 millert E #include <errno.h> int -vasprintf(str, fmt, ap) - char **str; - const char *fmt; - _BSD_VA_LIST_ ap; +vasprintf(char **str, const char *fmt, _BSD_VA_LIST_ ap) { int ret; FILE f; diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 60445e7549e..d0dbcdc0709 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: vfprintf.c,v 1.27 2004/09/25 06:35:50 brad Exp $"; +static char *rcsid = "$OpenBSD: vfprintf.c,v 1.28 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -62,11 +62,9 @@ static int __grow_type_table(unsigned char **typetable, int *tablesize); * then reset it so that it can be reused. */ static int -__sprint(fp, uio) - FILE *fp; - register struct __suio *uio; +__sprint(FILE *fp, struct __suio *uio) { - register int err; + int err; if (uio->uio_resid == 0) { uio->uio_iovcnt = 0; @@ -84,10 +82,7 @@ __sprint(fp, uio) * worries about ungetc buffers and so forth. */ static int -__sbprintf(fp, fmt, ap) - register FILE *fp; - const char *fmt; - va_list ap; +__sbprintf(FILE *fp, const char *fmt, va_list ap) { int ret; FILE fake; @@ -155,17 +150,14 @@ static int exponent(char *, int, int); #define SIZEINT 0x400 /* (signed) size_t */ int -vfprintf(fp, fmt0, ap) - FILE *fp; - const char *fmt0; - _BSD_VA_LIST_ ap; +vfprintf(FILE *fp, const char *fmt0, _BSD_VA_LIST_ ap) { - register char *fmt; /* format string */ - register int ch; /* character from fmt */ - register int n, m, n2; /* handy integers (short term usage) */ - register char *cp; /* handy char pointer (short term usage) */ - register struct __siov *iovp;/* for PRINT macro */ - register int flags; /* flags as above */ + char *fmt; /* format string */ + int ch; /* character from fmt */ + int n, m, n2; /* handy integers (short term usage) */ + char *cp; /* handy char pointer (short term usage) */ + struct __siov *iovp;/* for PRINT macro */ + int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format (%.3d), or -1 */ @@ -817,17 +809,14 @@ error: * problematic since we have nested functions..) */ static void -__find_arguments(fmt0, ap, argtable, argtablesiz) - const char *fmt0; - va_list ap; - va_list **argtable; - size_t *argtablesiz; +__find_arguments(const char *fmt0, va_list ap, va_list **argtable, + size_t *argtablesiz) { - register char *fmt; /* format string */ - register int ch; /* character from fmt */ - register int n, n2; /* handy integer (short term usage) */ - register char *cp; /* handy char pointer (short term usage) */ - register int flags; /* flags as above */ + char *fmt; /* format string */ + int ch; /* character from fmt */ + int n, n2; /* handy integer (short term usage) */ + char *cp; /* handy char pointer (short term usage) */ + int flags; /* flags as above */ unsigned char *typetable; /* table of types */ unsigned char stattypetable[STATIC_ARG_TBL_SIZE]; int tablesize; /* current size of type table */ @@ -1128,9 +1117,7 @@ done: * Increase the size of the type table. */ static int -__grow_type_table(typetable, tablesize) - unsigned char **typetable; - int *tablesize; +__grow_type_table(unsigned char **typetable, int *tablesize) { unsigned char *oldtable = *typetable; int newsize = *tablesize * 2; @@ -1162,10 +1149,8 @@ __grow_type_table(typetable, tablesize) extern char *__dtoa(double, int, int, int *, int *, char **); static char * -cvt(value, ndigits, flags, sign, decpt, ch, length) - double value; - int ndigits, flags, *decpt, ch, *length; - char *sign; +cvt(double value, int ndigits, int flags, char *sign, int *decpt, int ch, + int *length) { int mode, dsgn; char *digits, *bp, *rve; @@ -1206,11 +1191,9 @@ cvt(value, ndigits, flags, sign, decpt, ch, length) } static int -exponent(p0, exp, fmtch) - char *p0; - int exp, fmtch; +exponent(char *p0, int exp, int fmtch) { - register char *p, *t; + char *p, *t; char expbuf[MAXEXP]; p = p0; diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index c066e6a6d84..2bf5161a989 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.9 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.10 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -83,24 +83,21 @@ static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.9 2003/06/02 20:18:37 millert Exp #define u_char unsigned char #define u_long unsigned long -static u_char *__sccl(); +static u_char *__sccl(char *, u_char *); /* * vfscanf */ int -__svfscanf(fp, fmt0, ap) - register FILE *fp; - char const *fmt0; - _BSD_VA_LIST_ ap; +__svfscanf(FILE *fp, char const *fmt0, _BSD_VA_LIST_ ap) { - register u_char *fmt = (u_char *)fmt0; - register int c; /* character from format, or conversion */ - register size_t width; /* field width, or 0 */ - register char *p; /* points into all kinds of strings */ - register int n; /* handy integer */ - register int flags; /* flags as defined above */ - register char *p0; /* saves original value of p when necessary */ + u_char *fmt = (u_char *)fmt0; + int c; /* character from format, or conversion */ + size_t width; /* field width, or 0 */ + char *p; /* points into all kinds of strings */ + int n; /* handy integer */ + int flags; /* flags as defined above */ + char *p0; /* saves original value of p when necessary */ int nassigned; /* number of fields assigned */ int nread; /* number of characters consumed from fp */ int base; /* base argument to strtoq/strtouq */ @@ -658,11 +655,9 @@ match_failure: * considered part of the scanset. */ static u_char * -__sccl(tab, fmt) - register char *tab; - register u_char *fmt; +__sccl(char *tab, u_char *fmt) { - register int c, n, v; + int c, n, v; /* first `clear' the whole table */ c = *fmt++; /* first char hat => negated scanset */ diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c index 48d22592662..e72af0fd2ab 100644 --- a/lib/libc/stdio/vprintf.c +++ b/lib/libc/stdio/vprintf.c @@ -31,15 +31,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vprintf.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: vprintf.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> int -vprintf(fmt, ap) - char const *fmt; - _BSD_VA_LIST_ ap; +vprintf(char const *fmt, _BSD_VA_LIST_ ap) { return (vfprintf(stdout, fmt, ap)); } diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c index f0c15e0903f..5c8b5379cbe 100644 --- a/lib/libc/stdio/vscanf.c +++ b/lib/libc/stdio/vscanf.c @@ -31,15 +31,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vscanf.c,v 1.4 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: vscanf.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> int -vscanf(fmt, ap) - const char *fmt; - _BSD_VA_LIST_ ap; +vscanf(const char *fmt, _BSD_VA_LIST_ ap) { return (__svfscanf(stdin, fmt, ap)); diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 7a50ece624b..9454f7621fa 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -31,18 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsnprintf.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: vsnprintf.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <limits.h> #include <stdio.h> int -vsnprintf(str, n, fmt, ap) - char *str; - size_t n; - const char *fmt; - _BSD_VA_LIST_ ap; +vsnprintf(char *str, size_t n, const char *fmt, _BSD_VA_LIST_ ap) { int ret; char dummy; diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index e024a2fb880..8e4b6809127 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.8 2003/07/24 01:15:42 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.9 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -43,10 +43,7 @@ __warn_references(vsprintf, #endif int -vsprintf(str, fmt, ap) - char *str; - const char *fmt; - _BSD_VA_LIST_ ap; +vsprintf(char *str, const char *fmt, _BSD_VA_LIST_ ap) { int ret; FILE f; diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c index fd87cbcc168..a2c4da98626 100644 --- a/lib/libc/stdio/vsscanf.c +++ b/lib/libc/stdio/vsscanf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -39,20 +39,14 @@ static char rcsid[] = "$OpenBSD: vsscanf.c,v 1.5 2003/06/02 20:18:37 millert Exp /* ARGSUSED */ static int -eofread(cookie, buf, len) - void *cookie; - char *buf; - int len; +eofread(void *cookie, char *buf, int len) { return (0); } int -vsscanf(str, fmt, ap) - const char *str; - const char *fmt; - _BSD_VA_LIST_ ap; +vsscanf(const char *str, const char *fmt, _BSD_VA_LIST_ ap) { FILE f; diff --git a/lib/libc/stdio/wbuf.c b/lib/libc/stdio/wbuf.c index a2e8730f413..e099b3d89c6 100644 --- a/lib/libc/stdio/wbuf.c +++ b/lib/libc/stdio/wbuf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: wbuf.c,v 1.6 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: wbuf.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -44,11 +44,9 @@ static char rcsid[] = "$OpenBSD: wbuf.c,v 1.6 2003/06/02 20:18:37 millert Exp $" * or if c=='\n' and the file is line buffered. */ int -__swbuf(c, fp) - register int c; - register FILE *fp; +__swbuf(int c, FILE *fp) { - register int n; + int n; /* * In case we cannot write, or longjmp takes us out early, diff --git a/lib/libc/stdio/wsetup.c b/lib/libc/stdio/wsetup.c index 90735ab69b1..efc7655f92f 100644 --- a/lib/libc/stdio/wsetup.c +++ b/lib/libc/stdio/wsetup.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: wsetup.c,v 1.5 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: wsetup.c,v 1.6 2004/09/28 18:12:44 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -44,8 +44,7 @@ static char rcsid[] = "$OpenBSD: wsetup.c,v 1.5 2003/06/02 20:18:37 millert Exp * _wsetup returns 0 if OK to write, nonzero otherwise. */ int -__swsetup(fp) - register FILE *fp; +__swsetup(FILE *fp) { /* make sure stdio is set up */ if (!__sdidinit) |