From b231cb39457c13eef87bc92db0a856bef9d3bfeb Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Fri, 1 Feb 2002 01:32:19 +0000 Subject: [PATCH] * Remove __P and convert to ANSI prototypes. * Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's. --- lib/libc/gen/disklabel.c | 18 ++++---- lib/libc/gen/fnmatch.c | 4 +- lib/libc/gen/fstab.c | 17 ++++---- lib/libc/gen/fts-compat.c | 84 ++++++++++++++++++------------------- lib/libc/gen/fts.c | 84 ++++++++++++++++++------------------- lib/libc/gen/getgrent.c | 29 ++++++------- lib/libc/gen/getpwent.c | 42 +++++++++---------- lib/libc/gen/getttyent.c | 24 +++++------ lib/libc/gen/getusershell.c | 13 +++--- lib/libc/gen/glob.c | 66 ++++++++++++++--------------- lib/libc/gen/nlist.c | 50 +++++++++++----------- lib/libc/gen/rand48.h | 4 +- lib/libc/gen/scandir.c | 12 +++--- lib/libc/gen/setmode.c | 36 ++++++++-------- lib/libc/gen/syslog.c | 20 ++++----- lib/libc/gen/ttyname.c | 6 +-- sys/libkern/fnmatch.c | 4 +- 17 files changed, 248 insertions(+), 265 deletions(-) diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c index 19c0d19525d0..ca48456aecc4 100644 --- a/lib/libc/gen/disklabel.c +++ b/lib/libc/gen/disklabel.c @@ -31,13 +31,11 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 +#if defined(LIBC_SCCS) && !defined(lint)$ static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 5/3/95"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#endif /* LIBC_SCCS and not lint */$ +#include +__FBSDID("$FreeBSD$"); #include #define DKTYPENAMES @@ -52,15 +50,15 @@ static const char rcsid[] = #include #include -static int gettype __P((char *, char **)); +static int gettype(char *, char **); struct disklabel * getdiskbyname(name) const char *name; { static struct disklabel disk; - register struct disklabel *dp = &disk; - register struct partition *pp; + struct disklabel *dp = &disk; + struct partition *pp; char *buf; char *db_array[2] = { _PATH_DISKTAB, 0 }; char *cp, *cq; /* can't be register */ @@ -165,7 +163,7 @@ gettype(t, names) char *t; char **names; { - register char **nm; + char **nm; for (nm = names; *nm; nm++) if (strcasecmp(t, *nm) == 0) diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index c3312b42110a..a07a2d06e7c9 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -37,6 +37,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); /* * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. @@ -56,7 +58,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #define RANGE_NOMATCH 0 #define RANGE_ERROR (-1) -static int rangematch __P((const char *, char, int, char **)); +static int rangematch(const char *, char, int, char **); int fnmatch(pattern, string, flags) diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 83db5ec1152a..dce191d6bc15 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -32,13 +32,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -#if 0 static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; -#else -static char rcsid[] = - "$FreeBSD$"; -#endif #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -58,9 +55,9 @@ static FILE *_fs_fp; static struct fstab _fs_fstab; static int LineNo = 0; -static void error __P((int)); -static void fixfsfile __P((void)); -static int fstabscan __P((void)); +static void error(int); +static void fixfsfile(void); +static int fstabscan(void); static void fixfsfile() @@ -201,7 +198,7 @@ getfsent() struct fstab * getfsspec(name) - register const char *name; + const char *name; { if (setfsent()) while (fstabscan()) @@ -212,7 +209,7 @@ getfsspec(name) struct fstab * getfsfile(name) - register const char *name; + const char *name; { if (setfsent()) while (fstabscan()) diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index b42ec5ad770e..6220dc6f130c 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -34,12 +34,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -#if 0 static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; -#else -static char rcsid[] = "$FreeBSD$"; -#endif #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -55,16 +53,16 @@ static char rcsid[] = "$FreeBSD$"; #include #include "un-namespace.h" -static FTSENT *fts_alloc __P((FTS *, char *, int)); -static FTSENT *fts_build __P((FTS *, int)); -static void fts_lfree __P((FTSENT *)); -static void fts_load __P((FTS *, FTSENT *)); -static size_t fts_maxarglen __P((char * const *)); -static void fts_padjust __P((FTS *, FTSENT *)); -static int fts_palloc __P((FTS *, size_t)); -static FTSENT *fts_sort __P((FTS *, FTSENT *, int)); -static u_short fts_stat __P((FTS *, FTSENT *, int)); -static int fts_safe_changedir __P((FTS *, FTSENT *, int, char *)); +static FTSENT *fts_alloc(FTS *, char *, int); +static FTSENT *fts_build(FTS *, int); +static void fts_lfree(FTSENT *); +static void fts_load(FTS *, FTSENT *); +static size_t fts_maxarglen(char * const *); +static void fts_padjust(FTS *, FTSENT *); +static int fts_palloc(FTS *, size_t); +static FTSENT *fts_sort(FTS *, FTSENT *, int); +static u_short fts_stat(FTS *, FTSENT *, int); +static int fts_safe_changedir(FTS *, FTSENT *, int, char *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) @@ -82,12 +80,12 @@ static int fts_safe_changedir __P((FTS *, FTSENT *, int, char *)); FTS * fts_open(argv, options, compar) char * const *argv; - register int options; - int (*compar) __P((const FTSENT **, const FTSENT **)); + int options; + int (*compar)(const FTSENT **, const FTSENT **); { - register FTS *sp; - register FTSENT *p, *root; - register int nitems; + FTS *sp; + FTSENT *p, *root; + int nitems; FTSENT *parent, *tmp; int len; @@ -193,10 +191,10 @@ mem1: free(sp); static void fts_load(sp, p) FTS *sp; - register FTSENT *p; + FTSENT *p; { - register int len; - register char *cp; + int len; + char *cp; /* * Load the stream structure for the next traversal. Since we don't @@ -220,7 +218,7 @@ int fts_close(sp) FTS *sp; { - register FTSENT *freep, *p; + FTSENT *freep, *p; int saved_errno; /* @@ -273,12 +271,12 @@ fts_close(sp) FTSENT * fts_read(sp) - register FTS *sp; + FTS *sp; { struct stat sb; - register FTSENT *p, *tmp; - register int instr; - register char *t; + FTSENT *p, *tmp; + int instr; + char *t; int saved_errno; /* If finished or unrecoverable error, return NULL. */ @@ -483,10 +481,10 @@ fts_set(sp, p, instr) FTSENT * fts_children(sp, instr) - register FTS *sp; + FTS *sp; int instr; { - register FTSENT *p; + FTSENT *p; int fd; if (instr != 0 && instr != FTS_NAMEONLY) { @@ -565,12 +563,12 @@ fts_children(sp, instr) */ static FTSENT * fts_build(sp, type) - register FTS *sp; + FTS *sp; int type; { - register struct dirent *dp; - register FTSENT *p, *head; - register int nitems; + struct dirent *dp; + FTSENT *p, *head; + int nitems; FTSENT *cur, *tail; DIR *dirp; void *oldaddr; @@ -829,12 +827,12 @@ mem1: saved_errno = errno; static u_short fts_stat(sp, p, follow) FTS *sp; - register FTSENT *p; + FTSENT *p; int follow; { - register FTSENT *t; - register dev_t dev; - register ino_t ino; + FTSENT *t; + dev_t dev; + ino_t ino; struct stat *sbp, sb; int saved_errno; @@ -913,9 +911,9 @@ static FTSENT * fts_sort(sp, head, nitems) FTS *sp; FTSENT *head; - register int nitems; + int nitems; { - register FTSENT **ap, *p; + FTSENT **ap, *p; /* * Construct an array of pointers to the structures and call qsort(3). @@ -945,9 +943,9 @@ static FTSENT * fts_alloc(sp, name, namelen) FTS *sp; char *name; - register int namelen; + int namelen; { - register FTSENT *p; + FTSENT *p; size_t len; /* @@ -982,9 +980,9 @@ fts_alloc(sp, name, namelen) static void fts_lfree(head) - register FTSENT *head; + FTSENT *head; { - register FTSENT *p; + FTSENT *p; /* Free a linked list of structures. */ while ((p = head)) { diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index b42ec5ad770e..6220dc6f130c 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -34,12 +34,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -#if 0 static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; -#else -static char rcsid[] = "$FreeBSD$"; -#endif #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -55,16 +53,16 @@ static char rcsid[] = "$FreeBSD$"; #include #include "un-namespace.h" -static FTSENT *fts_alloc __P((FTS *, char *, int)); -static FTSENT *fts_build __P((FTS *, int)); -static void fts_lfree __P((FTSENT *)); -static void fts_load __P((FTS *, FTSENT *)); -static size_t fts_maxarglen __P((char * const *)); -static void fts_padjust __P((FTS *, FTSENT *)); -static int fts_palloc __P((FTS *, size_t)); -static FTSENT *fts_sort __P((FTS *, FTSENT *, int)); -static u_short fts_stat __P((FTS *, FTSENT *, int)); -static int fts_safe_changedir __P((FTS *, FTSENT *, int, char *)); +static FTSENT *fts_alloc(FTS *, char *, int); +static FTSENT *fts_build(FTS *, int); +static void fts_lfree(FTSENT *); +static void fts_load(FTS *, FTSENT *); +static size_t fts_maxarglen(char * const *); +static void fts_padjust(FTS *, FTSENT *); +static int fts_palloc(FTS *, size_t); +static FTSENT *fts_sort(FTS *, FTSENT *, int); +static u_short fts_stat(FTS *, FTSENT *, int); +static int fts_safe_changedir(FTS *, FTSENT *, int, char *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) @@ -82,12 +80,12 @@ static int fts_safe_changedir __P((FTS *, FTSENT *, int, char *)); FTS * fts_open(argv, options, compar) char * const *argv; - register int options; - int (*compar) __P((const FTSENT **, const FTSENT **)); + int options; + int (*compar)(const FTSENT **, const FTSENT **); { - register FTS *sp; - register FTSENT *p, *root; - register int nitems; + FTS *sp; + FTSENT *p, *root; + int nitems; FTSENT *parent, *tmp; int len; @@ -193,10 +191,10 @@ mem1: free(sp); static void fts_load(sp, p) FTS *sp; - register FTSENT *p; + FTSENT *p; { - register int len; - register char *cp; + int len; + char *cp; /* * Load the stream structure for the next traversal. Since we don't @@ -220,7 +218,7 @@ int fts_close(sp) FTS *sp; { - register FTSENT *freep, *p; + FTSENT *freep, *p; int saved_errno; /* @@ -273,12 +271,12 @@ fts_close(sp) FTSENT * fts_read(sp) - register FTS *sp; + FTS *sp; { struct stat sb; - register FTSENT *p, *tmp; - register int instr; - register char *t; + FTSENT *p, *tmp; + int instr; + char *t; int saved_errno; /* If finished or unrecoverable error, return NULL. */ @@ -483,10 +481,10 @@ fts_set(sp, p, instr) FTSENT * fts_children(sp, instr) - register FTS *sp; + FTS *sp; int instr; { - register FTSENT *p; + FTSENT *p; int fd; if (instr != 0 && instr != FTS_NAMEONLY) { @@ -565,12 +563,12 @@ fts_children(sp, instr) */ static FTSENT * fts_build(sp, type) - register FTS *sp; + FTS *sp; int type; { - register struct dirent *dp; - register FTSENT *p, *head; - register int nitems; + struct dirent *dp; + FTSENT *p, *head; + int nitems; FTSENT *cur, *tail; DIR *dirp; void *oldaddr; @@ -829,12 +827,12 @@ mem1: saved_errno = errno; static u_short fts_stat(sp, p, follow) FTS *sp; - register FTSENT *p; + FTSENT *p; int follow; { - register FTSENT *t; - register dev_t dev; - register ino_t ino; + FTSENT *t; + dev_t dev; + ino_t ino; struct stat *sbp, sb; int saved_errno; @@ -913,9 +911,9 @@ static FTSENT * fts_sort(sp, head, nitems) FTS *sp; FTSENT *head; - register int nitems; + int nitems; { - register FTSENT **ap, *p; + FTSENT **ap, *p; /* * Construct an array of pointers to the structures and call qsort(3). @@ -945,9 +943,9 @@ static FTSENT * fts_alloc(sp, name, namelen) FTS *sp; char *name; - register int namelen; + int namelen; { - register FTSENT *p; + FTSENT *p; size_t len; /* @@ -982,9 +980,9 @@ fts_alloc(sp, name, namelen) static void fts_lfree(head) - register FTSENT *head; + FTSENT *head; { - register FTSENT *p; + FTSENT *p; /* Free a linked list of structures. */ while ((p = head)) { diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index ca4b64c5408f..52efd8d11da6 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1,4 +1,3 @@ -/* $NetBSD: getgrent.c,v 1.34.2.1 1999/04/27 14:10:58 perry Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -33,12 +32,10 @@ * SUCH DAMAGE. */ -#if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrent.c 8.2 (Berkeley) 3/21/94"; #endif /* LIBC_SCCS and not lint */ -#endif - +/* $NetBSD: getgrent.c,v 1.34.2.1 1999/04/27 14:10:58 perry Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -72,12 +69,12 @@ static struct group _gr_group; static int _gr_stayopen; static int _gr_filesdone; -static void grcleanup __P((void)); -static int grscan __P((int, gid_t, const char *)); -static char *getline __P((void)); -static int copyline __P((const char*)); -static int matchline __P((int, gid_t, const char *)); -static int start_gr __P((void)); +static void grcleanup(void); +static int grscan(int, gid_t, const char *); +static char *getline(void); +static int copyline(const char*); +static int matchline(int, gid_t, const char *); +static int start_gr(void); @@ -222,7 +219,7 @@ endgrent() } -static int _local_grscan __P((void *, void *, va_list)); +static int _local_grscan(void *, void *, va_list); /*ARGSUSED*/ static int @@ -250,7 +247,7 @@ _local_grscan(rv, cb_data, ap) } #ifdef HESIOD -static int _dns_grscan __P((void *, void *, va_list)); +static int _dns_grscan(void *, void *, va_list); /*ARGSUSED*/ static int @@ -314,7 +311,7 @@ _dns_grscan(rv, cb_data, ap) #endif #ifdef YP -static int _nis_grscan __P((void *, void *, va_list)); +static int _nis_grscan(void *, void *, va_list); /*ARGSUSED*/ static int @@ -429,7 +426,7 @@ _nis_grscan(rv, cb_data, ap) /* * log an error if "files" or "compat" is specified in group_compat database */ -static int _bad_grscan __P((void *, void *, va_list)); +static int _bad_grscan(void *, void *, va_list); /*ARGSUSED*/ static int @@ -455,7 +452,7 @@ _bad_grscan(rv, cb_data, ap) * sense to lookup compat names from 'files' or 'compat' */ -static int __grscancompat __P((int, gid_t, const char *)); +static int __grscancompat(int, gid_t, const char *); static int __grscancompat(search, gid, name) @@ -481,7 +478,7 @@ __grscancompat(search, gid, name) #endif -static int _compat_grscan __P((void *, void *, va_list)); +static int _compat_grscan(void *, void *, va_list); /*ARGSUSED*/ static int diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 41a943822996..d68050bbddda 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -1,5 +1,3 @@ -/* $NetBSD: getpwent.c,v 1.40.2.2 1999/04/27 22:09:45 perry Exp $ */ - /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -34,12 +32,10 @@ * SUCH DAMAGE. */ -#if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpwent.c 8.2 (Berkeley) 4/27/95"; #endif /* LIBC_SCCS and not lint */ -#endif - +/* $NetBSD: getpwent.c,v 1.40.2.2 1999/04/27 22:09:45 perry Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -68,9 +64,9 @@ __FBSDID("$FreeBSD$"); #endif #include "un-namespace.h" -extern void setnetgrent __P((char *)); -extern int getnetgrent __P((char **, char **, char **)); -extern int innetgr __P((const char *, const char *, const char *, const char *)); +extern void setnetgrent(char *); +extern int getnetgrent(char **, char **, char **); +extern int innetgr(const char *, const char *, const char *, const char *); #include "pw_scan.h" @@ -88,8 +84,8 @@ static DB *_pw_db; /* password database */ static int _pw_keynum; /* key counter. no more records if -1 */ static int _pw_stayopen; /* keep fd's open */ -static int __hashpw __P((DBT *)); -static int __initdb __P((void)); +static int __hashpw(DBT *); +static int __initdb(void); static const ns_src compatsrc[] = { { NSSRC_COMPAT, NS_SUCCESS }, @@ -118,11 +114,11 @@ static char line[1024]; static long prbuf[1024 / sizeof(long)]; static DB *__pwexclude = (DB *)NULL; -static int __pwexclude_add __P((const char *)); -static int __pwexclude_is __P((const char *)); -static void __pwproto_set __P((void)); -static int __ypmaptype __P((void)); -static int __pwparse __P((struct passwd *, char *)); +static int __pwexclude_add(const char *); +static int __pwexclude_is(const char *); +static void __pwproto_set(void); +static int __ypmaptype(void); +static int __pwparse(struct passwd *, char *); /* macros for deciding which YP maps to use. */ #define PASSWD_BYNAME (__ypmaptype() == YPMAP_MASTER \ @@ -358,7 +354,7 @@ __pwparse(pw, s) * local files implementation of getpw*() * varargs: type, [ uid (type == _PW_KEYBYUID) | name (type == _PW_KEYBYNAME) ] */ -static int _local_getpw __P((void *, void *, va_list)); +static int _local_getpw(void *, void *, va_list); /*ARGSUSED*/ static int @@ -420,7 +416,7 @@ _local_getpw(rv, cb_data, ap) * hesiod implementation of getpw*() * varargs: type, [ uid (type == _PW_KEYBYUID) | name (type == _PW_KEYBYNAME) ] */ -static int _dns_getpw __P((void *, void *, va_list)); +static int _dns_getpw(void *, void *, va_list); /*ARGSUSED*/ static int @@ -498,7 +494,7 @@ _dns_getpw(rv, cb_data, ap) * nis implementation of getpw*() * varargs: type, [ uid (type == _PW_KEYBYUID) | name (type == _PW_KEYBYNAME) ] */ -static int _nis_getpw __P((void *, void *, va_list)); +static int _nis_getpw(void *, void *, va_list); /*ARGSUSED*/ static int @@ -605,7 +601,7 @@ _nis_getpw(rv, cb_data, ap) * See if the compat token is in the database. Only works if pwd_mkdb knows * about the token. */ -static int __has_compatpw __P((void)); +static int __has_compatpw(void); static int __has_compatpw() @@ -634,7 +630,7 @@ __has_compatpw() /* * log an error if "files" or "compat" is specified in passwd_compat database */ -static int _bad_getpw __P((void *, void *, va_list)); +static int _bad_getpw(void *, void *, va_list); /*ARGSUSED*/ static int @@ -659,7 +655,7 @@ _bad_getpw(rv, cb_data, ap) * only Hesiod and NIS is supported - it doesn't make sense to lookup * compat names from 'files' or 'compat'. */ -static int __getpwcompat __P((int, uid_t, const char *)); +static int __getpwcompat(int, uid_t, const char *); static int __getpwcompat(type, uid, name) @@ -701,7 +697,7 @@ __getpwcompat(type, uid, name) * varargs (ignored): * type, [ uid (type == _PW_KEYBYUID) | name (type == _PW_KEYBYNAME) ] */ -static int _compat_getpwent __P((void *, void *, va_list)); +static int _compat_getpwent(void *, void *, va_list); /*ARGSUSED*/ static int @@ -832,7 +828,7 @@ _compat_getpwent(rv, cb_data, ap) * compat implementation of getpwnam() and getpwuid() * varargs: type, [ uid (type == _PW_KEYBYUID) | name (type == _PW_KEYBYNAME) ] */ -static int _compat_getpw __P((void *, void *, va_list)); +static int _compat_getpw(void *, void *, va_list); static int _compat_getpw(rv, cb_data, ap) diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index bfbe833106b0..e4eadc46af1e 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -29,13 +29,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -50,14 +50,14 @@ static char *line; #define MALLOCCHUNK 100 -static char *skip __P((char *)); -static char *value __P((char *)); +static char *skip(char *); +static char *value(char *); struct ttyent * getttynam(tty) const char *tty; { - register struct ttyent *t; + struct ttyent *t; if (strncmp(tty, "/dev/", 5) == 0) tty += 5; @@ -73,8 +73,8 @@ struct ttyent * getttyent() { static struct ttyent tty; - register char *p; - register int c; + char *p; + int c; size_t i; if (!tf && !setttyent()) @@ -165,10 +165,10 @@ getttyent() */ static char * skip(p) - register char *p; + char *p; { - register char *t; - register int c, q; + char *t; + int c, q; for (q = 0, t = p; (c = *p) != '\0'; p++) { if (c == '"') { @@ -199,7 +199,7 @@ skip(p) static char * value(p) - register char *p; + char *p; { return ((p = index(p, '=')) ? ++p : NULL); @@ -244,7 +244,7 @@ isttystat(tty, flag) const char *tty; int flag; { - register struct ttyent *t; + struct ttyent *t; return ((t = getttynam(tty)) == NULL) ? 0 : !!(t->ty_status & flag); } diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c index cff58f10e636..2372ec67ed08 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -1,5 +1,3 @@ -/* $NetBSD: getusershell.c,v 1.17 1999/01/25 01:09:34 lukem Exp $ */ - /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,11 +31,10 @@ * SUCH DAMAGE. */ -#if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#endif +/* $NetBSD: getusershell.c,v 1.17 1999/01/25 01:09:34 lukem Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -72,7 +69,7 @@ static const char *const okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL }; static const char *const *curshell; static StringList *sl; -static const char *const *initshells __P((void)); +static const char *const *initshells(void); /* * Get a list of shells from "shells" nsswitch database @@ -108,7 +105,7 @@ setusershell(void) } -static int _local_initshells __P((void *, void *, va_list)); +static int _local_initshells(void *, void *, va_list); /*ARGSUSED*/ static int @@ -145,7 +142,7 @@ _local_initshells(rv, cb_data, ap) } #ifdef HESIOD -static int _dns_initshells __P((void *, void *, va_list)); +static int _dns_initshells(void *, void *, va_list); /*ARGSUSED*/ static int @@ -189,7 +186,7 @@ _dns_initshells(rv, cb_data, ap) #endif /* HESIOD */ #ifdef YP -static int _nis_initshells __P((void *, void *, va_list)); +static int _nis_initshells(void *, void *, va_list); /*ARGSUSED*/ static int diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 58f8b97f953b..e50c11d3d717 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -32,13 +32,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); /* * glob(3) -- a superset of the one defined in POSIX 1003.2. @@ -130,33 +130,33 @@ typedef char Char; #define ismeta(c) (((c)&M_QUOTE) != 0) -static int compare __P((const void *, const void *)); -static int g_Ctoc __P((const Char *, char *, u_int)); -static int g_lstat __P((Char *, struct stat *, glob_t *)); -static DIR *g_opendir __P((Char *, glob_t *)); -static Char *g_strchr __P((Char *, int)); +static int compare(const void *, const void *); +static int g_Ctoc(const Char *, char *, u_int); +static int g_lstat(Char *, struct stat *, glob_t *); +static DIR *g_opendir(Char *, glob_t *); +static Char *g_strchr(Char *, int); #ifdef notdef -static Char *g_strcat __P((Char *, const Char *)); +static Char *g_strcat(Char *, const Char *); #endif -static int g_stat __P((Char *, struct stat *, glob_t *)); -static int glob0 __P((const Char *, glob_t *, int *)); -static int glob1 __P((Char *, glob_t *, int *)); -static int glob2 __P((Char *, Char *, Char *, Char *, glob_t *, int *)); -static int glob3 __P((Char *, Char *, Char *, Char *, Char *, glob_t *, int *)); -static int globextend __P((const Char *, glob_t *, int *)); +static int g_stat(Char *, struct stat *, glob_t *); +static int glob0(const Char *, glob_t *, int *); +static int glob1(Char *, glob_t *, int *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, int *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, int *); +static int globextend(const Char *, glob_t *, int *); static const Char * - globtilde __P((const Char *, Char *, size_t, glob_t *)); -static int globexp1 __P((const Char *, glob_t *, int *)); -static int globexp2 __P((const Char *, const Char *, glob_t *, int *, int *)); -static int match __P((Char *, Char *, Char *)); + globtilde(const Char *, Char *, size_t, glob_t *); +static int globexp1(const Char *, glob_t *, int *); +static int globexp2(const Char *, const Char *, glob_t *, int *, int *); +static int match(Char *, Char *, Char *); #ifdef DEBUG -static void qprintf __P((const char *, Char *)); +static void qprintf(const char *, Char *); #endif int glob(pattern, flags, errfunc, pglob) const char *pattern; - int flags, (*errfunc) __P((const char *, int)); + int flags, (*errfunc)(const char *, int); glob_t *pglob; { const u_char *patnext; @@ -597,7 +597,7 @@ glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit) glob_t *pglob; int *limit; { - register struct dirent *dp; + struct dirent *dp; DIR *dirp; int err; char buf[MAXPATHLEN]; @@ -635,8 +635,8 @@ glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit) else readdirfunc = readdir; while ((dp = (*readdirfunc)(dirp))) { - register u_char *sc; - register Char *dc; + u_char *sc; + Char *dc; /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) @@ -683,8 +683,8 @@ globextend(path, pglob, limit) glob_t *pglob; int *limit; { - register char **pathv; - register int i; + char **pathv; + int i; u_int newsize, len; char *copy; const Char *p; @@ -734,7 +734,7 @@ globextend(path, pglob, limit) */ static int match(name, pat, patend) - register Char *name, *pat, *patend; + Char *name, *pat, *patend; { int ok, negate_range; Char c, k; @@ -788,8 +788,8 @@ void globfree(pglob) glob_t *pglob; { - register int i; - register char **pp; + int i; + char **pp; if (pglob->gl_pathv != NULL) { pp = pglob->gl_pathv + pglob->gl_offs; @@ -803,7 +803,7 @@ globfree(pglob) static DIR * g_opendir(str, pglob) - register Char *str; + Char *str; glob_t *pglob; { char buf[MAXPATHLEN]; @@ -823,7 +823,7 @@ g_opendir(str, pglob) static int g_lstat(fn, sb, pglob) - register Char *fn; + Char *fn; struct stat *sb; glob_t *pglob; { @@ -840,7 +840,7 @@ g_lstat(fn, sb, pglob) static int g_stat(fn, sb, pglob) - register Char *fn; + Char *fn; struct stat *sb; glob_t *pglob; { @@ -885,9 +885,9 @@ g_Ctoc(str, buf, len) static void qprintf(str, s) const char *str; - register Char *s; + Char *s; { - register Char *p; + Char *p; (void)printf("%s:\n", str); for (p = s; *p; p++) diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 2e35e3682d65..8464ac30fa1b 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -29,13 +29,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -58,9 +58,9 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; #include #endif -int __fdnlist __P((int, struct nlist *)); -int __aout_fdnlist __P((int, struct nlist *)); -int __elf_fdnlist __P((int, struct nlist *)); +int __fdnlist(int, struct nlist *); +int __aout_fdnlist(int, struct nlist *); +int __elf_fdnlist(int, struct nlist *); int nlist(name, list) @@ -78,7 +78,7 @@ nlist(name, list) } static struct nlist_handlers { - int (*fn) __P((int fd, struct nlist *list)); + int (*fn)(int fd, struct nlist *list); } nlist_fn[] = { #ifdef _NLIST_DO_AOUT { __aout_fdnlist }, @@ -90,8 +90,8 @@ static struct nlist_handlers { int __fdnlist(fd, list) - register int fd; - register struct nlist *list; + int fd; + struct nlist *list; { int n = -1, i; @@ -108,14 +108,14 @@ __fdnlist(fd, list) #ifdef _NLIST_DO_AOUT int __aout_fdnlist(fd, list) - register int fd; - register struct nlist *list; + int fd; + struct nlist *list; { - register struct nlist *p, *symtab; - register caddr_t strtab, a_out_mmap; - register off_t stroff, symoff; - register u_long symsize; - register int nent; + struct nlist *p, *symtab; + caddr_t strtab, a_out_mmap; + off_t stroff, symoff; + u_long symsize; + int nent; struct exec * exec; struct stat st; @@ -178,7 +178,7 @@ __aout_fdnlist(fd, list) } while (symsize > 0) { - register int soff; + int soff; symsize-= sizeof(struct nlist); soff = symtab->n_un.n_strx; @@ -202,7 +202,7 @@ __aout_fdnlist(fd, list) #endif #ifdef _NLIST_DO_ELF -static void elf_sym_to_nlist __P((struct nlist *, Elf_Sym *, Elf_Shdr *, int)); +static void elf_sym_to_nlist(struct nlist *, Elf_Sym *, Elf_Shdr *, int); /* * __elf_is_okay__ - Determine if ehdr really @@ -213,9 +213,9 @@ static void elf_sym_to_nlist __P((struct nlist *, Elf_Sym *, Elf_Shdr *, int)); */ int __elf_is_okay__(ehdr) - register Elf_Ehdr *ehdr; + Elf_Ehdr *ehdr; { - register int retval = 0; + int retval = 0; /* * We need to check magic, class size, endianess, * and version before we look at the rest of the @@ -237,13 +237,13 @@ __elf_is_okay__(ehdr) int __elf_fdnlist(fd, list) - register int fd; - register struct nlist *list; + int fd; + struct nlist *list; { - register struct nlist *p; - register Elf_Off symoff = 0, symstroff = 0; - register Elf_Word symsize = 0, symstrsize = 0; - register Elf_Sword cc, i; + struct nlist *p; + Elf_Off symoff = 0, symstroff = 0; + Elf_Word symsize = 0, symstrsize = 0; + Elf_Sword cc, i; int nent = -1; int errsave; Elf_Sym sbuf[1024]; diff --git a/lib/libc/gen/rand48.h b/lib/libc/gen/rand48.h index 5b9f87d176e4..b6602dc5a9f7 100644 --- a/lib/libc/gen/rand48.h +++ b/lib/libc/gen/rand48.h @@ -9,6 +9,8 @@ * This software is provided ``as is'', and comes with no warranties * of any kind. I shall in no event be liable for anything that happens * to anyone/anything when using this software. + * + * $FreeBSD$ */ #ifndef _RAND48_H_ @@ -17,7 +19,7 @@ #include #include -void _dorand48 __P((unsigned short[3])); +void _dorand48(unsigned short[3]); #define RAND48_SEED_0 (0x330e) #define RAND48_SEED_1 (0xabcd) diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 59128c8dbf52..6c7259fa79b7 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -29,13 +29,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)scandir.c 8.3 (Berkeley) 1/2/94"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); /* * Scan the directory dirname calling select to make a list of selected @@ -67,11 +67,11 @@ int scandir(dirname, namelist, select, dcomp) const char *dirname; struct dirent ***namelist; - int (*select) __P((struct dirent *)); - int (*dcomp) __P((const void *, const void *)); + int (*select)(struct dirent *); + int (*dcomp)(const void *, const void *); { - register struct dirent *d, *p, **names = NULL; - register size_t nitems = 0; + struct dirent *d, *p, **names = NULL; + size_t nitems = 0; struct stat stb; long arraysz; DIR *dirp; diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index f05607f46e51..de8dd2993b1c 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -35,12 +35,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -#if 0 static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; -#endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -71,10 +69,10 @@ typedef struct bitcmd { #define CMD2_OBITS 0x08 #define CMD2_UBITS 0x10 -static BITCMD *addcmd __P((BITCMD *, int, int, int, u_int)); -static void compress_mode __P((BITCMD *)); +static BITCMD *addcmd(BITCMD *, int, int, int, u_int); +static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG -static void dumpmode __P((BITCMD *)); +static void dumpmode(BITCMD *); #endif /* @@ -88,8 +86,8 @@ getmode(bbox, omode) void *bbox; mode_t omode; { - register BITCMD *set; - register mode_t clrval, newmode, value; + BITCMD *set; + mode_t clrval, newmode, value; set = (BITCMD *)bbox; newmode = omode; @@ -155,7 +153,7 @@ common: if (set->cmd2 & CMD2_CLR) { #define ADDCMD(a, b, c, d) \ if (set >= endset) { \ - register BITCMD *newset; \ + BITCMD *newset; \ setlen += SET_LEN_INCR; \ newset = realloc(saveset, sizeof(BITCMD) * setlen); \ if (!saveset) \ @@ -170,10 +168,10 @@ common: if (set->cmd2 & CMD2_CLR) { void * setmode(p) - register char *p; + char *p; { - register int perm, who; - register char op; + int perm, who; + char op; BITCMD *set, *saveset, *endset; sigset_t sigset, sigoset; mode_t mask; @@ -341,8 +339,8 @@ apply: if (!*p) static BITCMD * addcmd(set, op, who, oparg, mask) BITCMD *set; - register int oparg, who; - register int op; + int oparg, who; + int op; u_int mask; { switch (op) { @@ -388,7 +386,7 @@ addcmd(set, op, who, oparg, mask) #ifdef SETMODE_DEBUG static void dumpmode(set) - register BITCMD *set; + BITCMD *set; { for (; set->cmd; ++set) (void)printf("cmd: '%c' bits %04o%s%s%s%s%s%s\n", @@ -409,10 +407,10 @@ dumpmode(set) */ static void compress_mode(set) - register BITCMD *set; + BITCMD *set; { - register BITCMD *nset; - register int setbits, clrbits, Xbits, op; + BITCMD *nset; + int setbits, clrbits, Xbits, op; for (nset = set;;) { /* Copy over any 'u', 'g' and 'o' commands. */ diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index b6eab59cd271..90fd9042cc0d 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -32,12 +32,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -/* static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95"; -*/ -static const char rcsid[] = - "$FreeBSD$"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -71,8 +69,8 @@ static int LogFacility = LOG_USER; /* default facility code */ static int LogMask = 0xff; /* mask of priorities to be logged */ extern char *__progname; /* Program name, from crt0. */ -static void disconnectlog __P((void)); /* disconnect from syslogd */ -static void connectlog __P((void)); /* (re)connect to syslogd */ +static void disconnectlog(void); /* disconnect from syslogd */ +static void connectlog(void); /* (re)connect to syslogd */ /* * Format of the magic cookie passed through the stdio hook @@ -136,11 +134,11 @@ syslog(pri, fmt, va_alist) void vsyslog(pri, fmt, ap) int pri; - register const char *fmt; + const char *fmt; va_list ap; { - register int cnt; - register char ch, *p; + int cnt; + char ch, *p; time_t now; int fd, saved_errno; char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26]; @@ -230,7 +228,7 @@ vsyslog(pri, fmt, ap) /* Output to stderr if requested. */ if (LogStat & LOG_PERROR) { struct iovec iov[2]; - register struct iovec *v = iov; + struct iovec *v = iov; v->iov_base = stdp; v->iov_len = cnt - (stdp - tbuf); @@ -264,7 +262,7 @@ vsyslog(pri, fmt, ap) if (LogStat & LOG_CONS && (fd = _open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) { struct iovec iov[2]; - register struct iovec *v = iov; + struct iovec *v = iov; p = strchr(tbuf, '>') + 1; v->iov_base = p; diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c index 55fc91867223..f6fd9379dd48 100644 --- a/lib/libc/gen/ttyname.c +++ b/lib/libc/gen/ttyname.c @@ -29,13 +29,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ttyname.c 8.2 (Berkeley) 1/27/94"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); #include "namespace.h" #include @@ -54,7 +54,7 @@ static char sccsid[] = "@(#)ttyname.c 8.2 (Berkeley) 1/27/94"; #include "libc_private.h" static char buf[sizeof(_PATH_DEV) + MAXNAMLEN] = _PATH_DEV; -static char *oldttyname __P((int, struct stat *)); +static char *oldttyname(int, struct stat *); static char *ttyname_threaded(int fd); static char *ttyname_unthreaded(int fd); diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c index c3312b42110a..a07a2d06e7c9 100644 --- a/sys/libkern/fnmatch.c +++ b/sys/libkern/fnmatch.c @@ -37,6 +37,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #endif /* LIBC_SCCS and not lint */ +#include +__FBSDID("$FreeBSD$"); /* * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. @@ -56,7 +58,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #define RANGE_NOMATCH 0 #define RANGE_ERROR (-1) -static int rangematch __P((const char *, char, int, char **)); +static int rangematch(const char *, char, int, char **); int fnmatch(pattern, string, flags)