diff options
Diffstat (limited to 'sys/lib/libkern')
54 files changed, 177 insertions, 252 deletions
diff --git a/sys/lib/libkern/adddi3.c b/sys/lib/libkern/adddi3.c index 28e0218eea0..f607fa53621 100644 --- a/sys/lib/libkern/adddi3.c +++ b/sys/lib/libkern/adddi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $ */ +/* $OpenBSD: adddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: adddi3.c,v 1.5 1995/10/07 09:26:14 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)adddi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: adddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: adddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -50,8 +50,7 @@ static char rcsid[] = "$OpenBSD: adddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp * either x or y (the choice to compare with x or y is arbitrary). */ quad_t -__adddi3(a, b) - quad_t a, b; +__adddi3(quad_t a, quad_t b) { union uu aa, bb, sum; diff --git a/sys/lib/libkern/anddi3.c b/sys/lib/libkern/anddi3.c index c614f479fa6..b27e2cda89e 100644 --- a/sys/lib/libkern/anddi3.c +++ b/sys/lib/libkern/anddi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: anddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $ */ +/* $OpenBSD: anddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: anddi3.c,v 1.5 1995/10/07 09:26:15 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)anddi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: anddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: anddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: anddi3.c,v 1.3 2003/06/02 23:28:07 millert Exp * Return a & b, in quad. */ quad_t -__anddi3(a, b) - quad_t a, b; +__anddi3(quad_t a, quad_t b) { union uu aa, bb; diff --git a/sys/lib/libkern/ashldi3.c b/sys/lib/libkern/ashldi3.c index 0c8b712527c..d767a377321 100644 --- a/sys/lib/libkern/ashldi3.c +++ b/sys/lib/libkern/ashldi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ashldi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $ */ +/* $OpenBSD: ashldi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: ashldi3.c,v 1.5 1995/10/07 09:26:17 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)ashldi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: ashldi3.c,v 1.3 2003/06/02 23:28:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: ashldi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,9 +49,7 @@ static char rcsid[] = "$OpenBSD: ashldi3.c,v 1.3 2003/06/02 23:28:07 millert Exp * This is the same as logical shift left! */ quad_t -__ashldi3(a, shift) - quad_t a; - qshift_t shift; +__ashldi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/lib/libkern/ashrdi3.c b/sys/lib/libkern/ashrdi3.c index 916d5951da4..b00d6174bab 100644 --- a/sys/lib/libkern/ashrdi3.c +++ b/sys/lib/libkern/ashrdi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ashrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: ashrdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: ashrdi3.c,v 1.5 1995/10/07 09:26:18 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)ashrdi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: ashrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: ashrdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,9 +48,7 @@ static char rcsid[] = "$OpenBSD: ashrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Shift a (signed) quad value right (arithmetic shift right). */ quad_t -__ashrdi3(a, shift) - quad_t a; - qshift_t shift; +__ashrdi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/lib/libkern/bcmp.c b/sys/lib/libkern/bcmp.c index 0714010ec0d..21092ef1089 100644 --- a/sys/lib/libkern/bcmp.c +++ b/sys/lib/libkern/bcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcmp.c,v 1.6 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: bcmp.c,v 1.7 2004/08/07 00:38:32 deraadt Exp $ */ /* * Copyright (c) 1987 Regents of the University of California. @@ -31,7 +31,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)bcmp.c 5.6 (Berkeley) 2/24/91";*/ -static char *rcsid = "$OpenBSD: bcmp.c,v 1.6 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: bcmp.c,v 1.7 2004/08/07 00:38:32 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -44,19 +44,19 @@ static char *rcsid = "$OpenBSD: bcmp.c,v 1.6 2003/06/02 23:28:08 millert Exp $"; * bcmp -- vax cmpc3 instruction */ int -bcmp(b1, b2, length) - const void *b1, *b2; - register size_t length; +bcmp(const void *b1, const void *b2, size_t length) { - register const char *p1, *p2; + const char *p1, *p2; if (length == 0) return(0); + p1 = (const char *)b1; p2 = (const char *)b2; do if (*p1++ != *p2++) break; - while (--length); + while (--length) + ; return(length); } diff --git a/sys/lib/libkern/bzero.c b/sys/lib/libkern/bzero.c index d4d110ab034..d3d83786d38 100644 --- a/sys/lib/libkern/bzero.c +++ b/sys/lib/libkern/bzero.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.c,v 1.4 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: bzero.c,v 1.5 2004/08/07 00:38:32 deraadt Exp $ */ /* * Copyright (c) 1987 Regents of the University of California. @@ -31,7 +31,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)bzero.c 5.7 (Berkeley) 2/24/91";*/ -static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: bzero.c,v 1.5 2004/08/07 00:38:32 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #ifndef _KERNEL @@ -44,11 +44,9 @@ static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 23:28:08 millert Exp $" * bzero -- vax movc5 instruction */ void -bzero(b, length) - void *b; - register size_t length; +bzero(void *b, size_t length) { - register char *p; + char *p; for (p = b; length--;) *p++ = '\0'; diff --git a/sys/lib/libkern/cmpdi2.c b/sys/lib/libkern/cmpdi2.c index 41f1af9776d..ac17eb2a6a2 100644 --- a/sys/lib/libkern/cmpdi2.c +++ b/sys/lib/libkern/cmpdi2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: cmpdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: cmpdi2.c,v 1.5 1995/10/07 09:26:22 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmpdi2.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: cmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmpdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -50,8 +50,7 @@ static char rcsid[] = "$OpenBSD: cmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp * signed. */ int -__cmpdi2(a, b) - quad_t a, b; +__cmpdi2(quad_t a, quad_t b) { union uu aa, bb; diff --git a/sys/lib/libkern/divdi3.c b/sys/lib/libkern/divdi3.c index 7cbbe39225e..70008be0fa1 100644 --- a/sys/lib/libkern/divdi3.c +++ b/sys/lib/libkern/divdi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: divdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: divdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: divdi3.c,v 1.5 1995/10/07 09:26:24 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)divdi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: divdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: divdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,8 +49,7 @@ static char rcsid[] = "$OpenBSD: divdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * ??? if -1/2 should produce -1 on this machine, this code is wrong */ quad_t -__divdi3(a, b) - quad_t a, b; +__divdi3(quad_t a, quad_t b) { u_quad_t ua, ub, uq; int neg; diff --git a/sys/lib/libkern/ffs.c b/sys/lib/libkern/ffs.c index 63b3cbfb950..a80bceedb09 100644 --- a/sys/lib/libkern/ffs.c +++ b/sys/lib/libkern/ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.c,v 1.5 2000/07/02 03:09:44 mickey Exp $ */ +/* $OpenBSD: ffs.c,v 1.6 2004/08/07 00:38:32 deraadt Exp $ */ /* * Public domain. @@ -6,7 +6,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:09:44 mickey Exp $"; +static char *rcsid = "$OpenBSD: ffs.c,v 1.6 2004/08/07 00:38:32 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -19,11 +19,10 @@ static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:09:44 mickey Exp $"; * ffs -- vax ffs instruction */ int -ffs(mask) - register int mask; +ffs(int mask) { - register int bit; - register unsigned int r = mask; + int bit; + unsigned int r = mask; static const signed char t[16] = { -28, 1, 2, 1, 3, 1, 2, 1, diff --git a/sys/lib/libkern/getsn.c b/sys/lib/libkern/getsn.c index 69fdc809fb5..42e9cf2f706 100644 --- a/sys/lib/libkern/getsn.c +++ b/sys/lib/libkern/getsn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getsn.c,v 1.3 2003/06/02 15:58:42 deraadt Exp $ */ +/* $OpenBSD: getsn.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* * Copyright (c) 1996 Theo de Raadt @@ -31,13 +31,10 @@ #include <dev/cons.h> int -getsn(cp, size) - char *cp; - int size; +getsn(char *cp, int size) { - register char *lp; - register int len; - register int c; + int len, c; + char *lp; lp = cp; len = 0; diff --git a/sys/lib/libkern/htonl.c b/sys/lib/libkern/htonl.c index 9ff932a1b1d..38faf1309f5 100644 --- a/sys/lib/libkern/htonl.c +++ b/sys/lib/libkern/htonl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: htonl.c,v 1.3 1996/11/27 19:51:39 niklas Exp $ */ +/* $OpenBSD: htonl.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: htonl.c,v 1.6.6.1 1996/05/29 23:47:55 cgd Exp $ */ /* @@ -16,8 +16,7 @@ static char *rcsid = "$NetBSD: htonl.c,v 1.6.6.1 1996/05/29 23:47:55 cgd Exp $"; #undef htonl u_int32_t -htonl(x) - u_int32_t x; +htonl(u_int32_t x) { u_int32_t y = x; diff --git a/sys/lib/libkern/htons.c b/sys/lib/libkern/htons.c index 0928801a8e2..916ecc685bc 100644 --- a/sys/lib/libkern/htons.c +++ b/sys/lib/libkern/htons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: htons.c,v 1.3 1996/11/27 19:51:40 niklas Exp $ */ +/* $OpenBSD: htons.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: htons.c,v 1.6.6.1 1996/05/29 23:48:02 cgd Exp $ */ /* @@ -16,8 +16,7 @@ static char *rcsid = "$NetBSD: htons.c,v 1.6.6.1 1996/05/29 23:48:02 cgd Exp $"; #undef htons u_int16_t -htons(x) - u_int16_t x; +htons(u_int16_t x) { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; diff --git a/sys/lib/libkern/imax.c b/sys/lib/libkern/imax.c index ea00a86b6de..57ec06d49d0 100644 --- a/sys/lib/libkern/imax.c +++ b/sys/lib/libkern/imax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imax.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: imax.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: imax.c,v 1.3 1996/03/14 18:52:06 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> int -imax(a, b) - int a, b; +imax(int a, int b) { return (a > b ? a : b); } diff --git a/sys/lib/libkern/imin.c b/sys/lib/libkern/imin.c index a1feba40623..b610363f3ab 100644 --- a/sys/lib/libkern/imin.c +++ b/sys/lib/libkern/imin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imin.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: imin.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: imin.c,v 1.3 1996/03/14 18:52:07 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> int -imin(a, b) - int a, b; +imin(int a, int b) { return (a < b ? a : b); } diff --git a/sys/lib/libkern/iordi3.c b/sys/lib/libkern/iordi3.c index d641ae8d5fa..0509824bc04 100644 --- a/sys/lib/libkern/iordi3.c +++ b/sys/lib/libkern/iordi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: iordi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: iordi3.c,v 1.5 1995/10/07 09:26:28 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)iordi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: iordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: iordi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: iordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Return a | b, in quad. */ quad_t -__iordi3(a, b) - quad_t a, b; +__iordi3(quad_t a, quad_t b) { union uu aa, bb; diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h index ef16334295b..c92e2ce5f38 100644 --- a/sys/lib/libkern/libkern.h +++ b/sys/lib/libkern/libkern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libkern.h,v 1.21 2004/06/21 22:55:04 itojun Exp $ */ +/* $OpenBSD: libkern.h,v 1.22 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: libkern.h,v 1.7 1996/03/14 18:52:08 christos Exp $ */ /*- @@ -151,13 +151,14 @@ abs(j) void __assert(const char *, const char *, int, const char *) __attribute__ ((__noreturn__)); int bcmp(const void *, const void *, size_t); +void bzero(void *, size_t); int ffs(int); int locc(int, char *, u_int); void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); u_long random(void); void srandom(u_long); -int scanc(u_int, const u_char *, const u_char *, int); +int scanc(u_int, const u_char *, const u_char [], int); int skpc(int, size_t, u_char *); size_t strlen(const char *); char *strncpy(char *, const char *, size_t) diff --git a/sys/lib/libkern/lmax.c b/sys/lib/libkern/lmax.c index 9e56289ba3e..97d34ba6086 100644 --- a/sys/lib/libkern/lmax.c +++ b/sys/lib/libkern/lmax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lmax.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: lmax.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: lmax.c,v 1.3 1996/03/14 18:52:09 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> long -lmax(a, b) - long a, b; +lmax(long a, long b) { return (a > b ? a : b); } diff --git a/sys/lib/libkern/lmin.c b/sys/lib/libkern/lmin.c index e80b9c92944..7a4d841bfdd 100644 --- a/sys/lib/libkern/lmin.c +++ b/sys/lib/libkern/lmin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lmin.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: lmin.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: lmin.c,v 1.3 1996/03/14 18:52:10 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> long -lmin(a, b) - long a, b; +lmin(long a, long b) { return (a < b ? a : b); } diff --git a/sys/lib/libkern/locc.c b/sys/lib/libkern/locc.c index 770506325d2..c879b7ea89f 100644 --- a/sys/lib/libkern/locc.c +++ b/sys/lib/libkern/locc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locc.c,v 1.4 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: locc.c,v 1.5 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: locc.c,v 1.2 1994/10/26 06:42:29 cgd Exp $ */ /* @@ -36,12 +36,9 @@ #include <lib/libkern/libkern.h> int -locc(mask, cp, size) - register int mask; - u_int size; - register char *cp; +locc(int mask, char *cp, u_int size) { - register char *end = &cp[size]; + char *end = &cp[size]; while (cp < end && *cp != mask) cp++; diff --git a/sys/lib/libkern/lshldi3.c b/sys/lib/libkern/lshldi3.c index 189e4510362..0b793aebfe4 100644 --- a/sys/lib/libkern/lshldi3.c +++ b/sys/lib/libkern/lshldi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lshldi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: lshldi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: lshldi3.c,v 1.5 1995/10/07 09:26:29 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lshldi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: lshldi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: lshldi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,9 +49,7 @@ static char rcsid[] = "$OpenBSD: lshldi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * This is the same as arithmetic shift left! */ quad_t -__lshldi3(a, shift) - quad_t a; - qshift_t shift; +__lshldi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/lib/libkern/lshrdi3.c b/sys/lib/libkern/lshrdi3.c index c4a5464df36..5fafc064967 100644 --- a/sys/lib/libkern/lshrdi3.c +++ b/sys/lib/libkern/lshrdi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lshrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: lshrdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: lshrdi3.c,v 1.5 1995/10/07 09:26:30 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lshrdi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: lshrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: lshrdi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,9 +48,7 @@ static char rcsid[] = "$OpenBSD: lshrdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Shift an (unsigned) quad value right (logical shift right). */ quad_t -__lshrdi3(a, shift) - quad_t a; - qshift_t shift; +__lshrdi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/lib/libkern/max.c b/sys/lib/libkern/max.c index 7a7222fe360..3472497c9ce 100644 --- a/sys/lib/libkern/max.c +++ b/sys/lib/libkern/max.c @@ -1,4 +1,4 @@ -/* $OpenBSD: max.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: max.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: max.c,v 1.3 1996/03/14 18:52:12 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> unsigned int -max(a, b) - unsigned int a, b; +max(unsigned int a, unsigned int b) { return (a > b ? a : b); } diff --git a/sys/lib/libkern/mcount.c b/sys/lib/libkern/mcount.c index 1fc897affe6..ce70fffb171 100644 --- a/sys/lib/libkern/mcount.c +++ b/sys/lib/libkern/mcount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mcount.c,v 1.7 2004/07/22 16:06:34 art Exp $ */ +/* $OpenBSD: mcount.c,v 1.8 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: mcount.c,v 1.3.6.1 1996/06/12 04:23:01 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: mcount.c,v 1.7 2004/07/22 16:06:34 art Exp $"; +static char rcsid[] = "$OpenBSD: mcount.c,v 1.8 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif @@ -61,8 +61,7 @@ static char rcsid[] = "$OpenBSD: mcount.c,v 1.7 2004/07/22 16:06:34 art Exp $"; * stubs. */ _MCOUNT_DECL(u_long frompc, u_long selfpc) __attribute__((unused)); -_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ - register u_long frompc, selfpc; +_MCOUNT_DECL(u_long frompc, u_long selfpc) /* _mcount; may be static, inline, etc */ { u_short *frompcindex; struct tostruct *top, *prevtop; diff --git a/sys/lib/libkern/memchr.c b/sys/lib/libkern/memchr.c index fe4a197b854..d5d1537ff1f 100644 --- a/sys/lib/libkern/memchr.c +++ b/sys/lib/libkern/memchr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memchr.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: memchr.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,16 +45,13 @@ static char *rcsid = "$NetBSD: memchr.c,v 1.2 1997/10/24 18:10:30 mjacob Exp $"; #endif void * -memchr(s, c, n) - const void *s; - register unsigned char c; - register size_t n; +memchr(const void *s, int c, size_t n) { if (n != 0) { - register const unsigned char *p = s; + const unsigned char *p = s; do { - if (*p++ == c) + if (*p++ == (unsigned char)c) return ((void *)(p - 1)); } while (--n != 0); } diff --git a/sys/lib/libkern/memcmp.c b/sys/lib/libkern/memcmp.c index 5fe351261f3..3a4bb91c18c 100644 --- a/sys/lib/libkern/memcmp.c +++ b/sys/lib/libkern/memcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memcmp.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: memcmp.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -33,7 +33,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: memcmp.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -46,12 +46,10 @@ static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 23:28:08 millert Exp $ * Compare memory regions. */ int -memcmp(s1, s2, n) - const void *s1, *s2; - size_t n; +memcmp(const void *s1, const void *s2, size_t n) { if (n != 0) { - register const unsigned char *p1 = s1, *p2 = s2; + const unsigned char *p1 = s1, *p2 = s2; do { if (*p1++ != *p2++) diff --git a/sys/lib/libkern/memset.c b/sys/lib/libkern/memset.c index 0de0397bc84..259d096629b 100644 --- a/sys/lib/libkern/memset.c +++ b/sys/lib/libkern/memset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memset.c,v 1.4 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: memset.c,v 1.5 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: memset.c,v 1.6 1998/03/27 05:35:47 cgd Exp $ */ /*- @@ -62,19 +62,14 @@ __RCSID("$NetBSD: memset.c,v 1.6 1998/03/27 05:35:47 cgd Exp $"); #define WIDEVAL 0 void -bzero(dst0, length) - void *dst0; - size_t length; +bzero(void *dst0, size_t length) #else #define RETURN return (dst0) #define VAL c0 #define WIDEVAL c void * -memset(dst0, c0, length) - void *dst0; - int c0; - size_t length; +memset(void *dst0, int c0, size_t length) #endif { size_t t; diff --git a/sys/lib/libkern/min.c b/sys/lib/libkern/min.c index e355eed3db6..5f75faddeb6 100644 --- a/sys/lib/libkern/min.c +++ b/sys/lib/libkern/min.c @@ -1,4 +1,4 @@ -/* $OpenBSD: min.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: min.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: min.c,v 1.3 1996/03/14 18:52:13 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> unsigned int -min(a, b) - unsigned int a, b; +min(unsigned int a, unsigned int b) { return (a < b ? a : b); } diff --git a/sys/lib/libkern/moddi3.c b/sys/lib/libkern/moddi3.c index f88434d5e20..948215fef41 100644 --- a/sys/lib/libkern/moddi3.c +++ b/sys/lib/libkern/moddi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: moddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: moddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: moddi3.c,v 1.5 1995/10/07 09:26:31 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)moddi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: moddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: moddi3.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -51,8 +51,7 @@ static char rcsid[] = "$OpenBSD: moddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * If -1/2 should produce -1 on this machine, this code is wrong. */ quad_t -__moddi3(a, b) - quad_t a, b; +__moddi3(quad_t a, quad_t b) { u_quad_t ua, ub, ur; int neg; diff --git a/sys/lib/libkern/muldi3.c b/sys/lib/libkern/muldi3.c index 9c7ab1b55ae..7fafbc10da5 100644 --- a/sys/lib/libkern/muldi3.c +++ b/sys/lib/libkern/muldi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: muldi3.c,v 1.5 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: muldi3.c,v 1.6 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: muldi3.c,v 1.5 1995/10/07 09:26:33 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)muldi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: muldi3.c,v 1.5 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: muldi3.c,v 1.6 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -104,12 +104,11 @@ static char rcsid[] = "$OpenBSD: muldi3.c,v 1.5 2003/06/02 23:28:08 millert Exp static quad_t __lmulq(u_long, u_long); quad_t -__muldi3(a, b) - quad_t a, b; +__muldi3(quad_t a, quad_t b) { union uu u, v, low, prod; - register u_long high, mid, udiff, vdiff; - register int negall, negmid; + u_long high, mid, udiff, vdiff; + int negall, negmid; #define u1 u.ul[H] #define u0 u.ul[L] #define v1 v.ul[H] diff --git a/sys/lib/libkern/negdi2.c b/sys/lib/libkern/negdi2.c index 9b74d96a494..29e91bdb1d5 100644 --- a/sys/lib/libkern/negdi2.c +++ b/sys/lib/libkern/negdi2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: negdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: negdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: negdi2.c,v 1.5 1995/10/07 09:26:34 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)negdi2.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: negdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: negdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: negdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp * Return -a (or, equivalently, 0 - a), in quad. See subdi3.c. */ quad_t -__negdi2(a) - quad_t a; +__negdi2(quad_t a) { union uu aa, res; diff --git a/sys/lib/libkern/notdi2.c b/sys/lib/libkern/notdi2.c index 248fc1ca6ab..8c2df01a8a0 100644 --- a/sys/lib/libkern/notdi2.c +++ b/sys/lib/libkern/notdi2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: notdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: notdi2.c,v 1.5 1995/10/07 09:26:36 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)notdi2.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: notdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: notdi2.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,8 +49,7 @@ static char rcsid[] = "$OpenBSD: notdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp * than `not'. */ quad_t -__one_cmpldi2(a) - quad_t a; +__one_cmpldi2(quad_t a) { union uu aa; diff --git a/sys/lib/libkern/ntohl.c b/sys/lib/libkern/ntohl.c index 5d5d97e3351..081b9d2858b 100644 --- a/sys/lib/libkern/ntohl.c +++ b/sys/lib/libkern/ntohl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntohl.c,v 1.3 1996/11/27 19:51:41 niklas Exp $ */ +/* $OpenBSD: ntohl.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: ntohl.c,v 1.6.6.1 1996/05/29 23:48:07 cgd Exp $ */ /* @@ -16,8 +16,7 @@ static char *rcsid = "$NetBSD: ntohl.c,v 1.6.6.1 1996/05/29 23:48:07 cgd Exp $"; #undef ntohl u_int32_t -ntohl(x) - u_int32_t x; +ntohl(u_int32_t x) { u_int32_t y = x; diff --git a/sys/lib/libkern/ntohs.c b/sys/lib/libkern/ntohs.c index a5f870b70a2..e677ed1ed89 100644 --- a/sys/lib/libkern/ntohs.c +++ b/sys/lib/libkern/ntohs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntohs.c,v 1.3 1996/11/27 19:51:42 niklas Exp $ */ +/* $OpenBSD: ntohs.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /* $NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:48:11 cgd Exp $ */ /* @@ -16,8 +16,7 @@ static char *rcsid = "$NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:48:11 cgd Exp $"; #undef ntohs u_int16_t -ntohs(x) - u_int16_t x; +ntohs(u_int16_t x) { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; diff --git a/sys/lib/libkern/qdivrem.c b/sys/lib/libkern/qdivrem.c index 537238a1534..64c46fe5e4b 100644 --- a/sys/lib/libkern/qdivrem.c +++ b/sys/lib/libkern/qdivrem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qdivrem.c,v 1.5 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: qdivrem.c,v 1.6 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: qdivrem.c,v 1.5 1995/10/07 09:26:40 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #ifdef notdef static char sccsid[] = "@(#)qdivrem.c 8.1 (Berkeley) 6/4/93"; #endif -static char rcsid[] = "$OpenBSD: qdivrem.c,v 1.5 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: qdivrem.c,v 1.6 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -71,12 +71,11 @@ static void shl(digit *p, int len, int sh); * leading zeros). */ u_quad_t -__qdivrem(uq, vq, arq) - u_quad_t uq, vq, *arq; +__qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) { union uu tmp; digit *u, *v, *q; - register digit v1, v2; + digit v1, v2; u_long qhat, rhat, t; int m, n, d, j, i; digit uspace[5], vspace[5], qspace[5]; @@ -186,7 +185,7 @@ __qdivrem(uq, vq, arq) v1 = v[1]; /* for D3 -- note that v[1..n] are constant */ v2 = v[2]; /* for D3 */ do { - register digit uj0, uj1, uj2; + digit uj0, uj1, uj2; /* * D3: Calculate qhat (\^q, in TeX notation). @@ -273,12 +272,9 @@ __qdivrem(uq, vq, arq) * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS. */ static void -shl(p, len, sh) - register digit *p; - register int len; - register int sh; +shl(digit *p, int len, int sh) { - register int i; + int i; for (i = 0; i < len; i++) p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh)); diff --git a/sys/lib/libkern/random.c b/sys/lib/libkern/random.c index 44f95b8c096..258a9df94fb 100644 --- a/sys/lib/libkern/random.c +++ b/sys/lib/libkern/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.6 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: random.c,v 1.7 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: random.c,v 1.2 1994/10/26 06:42:42 cgd Exp $ */ /*- @@ -44,9 +44,9 @@ u_long _randseed = 1; u_long -random() +random(void) { - register long x, hi, lo, t; + long x, hi, lo, t; /* * Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1). diff --git a/sys/lib/libkern/scanc.c b/sys/lib/libkern/scanc.c index 82b7e37cd30..0ebd9344333 100644 --- a/sys/lib/libkern/scanc.c +++ b/sys/lib/libkern/scanc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scanc.c,v 1.4 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: scanc.c,v 1.5 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: scanc.c,v 1.3 1996/03/14 18:52:16 christos Exp $ */ /* @@ -36,14 +36,11 @@ #include <lib/libkern/libkern.h> int -scanc(size, cp, table, mask) - u_int size; - register const u_char *cp, table[]; - register u_char mask; +scanc(u_int size, const u_char *cp, const u_char table[], int mask) { - register const u_char *end = &cp[size]; + const u_char *end = &cp[size]; - while (cp < end && (table[*cp] & mask) == 0) + while (cp < end && (table[*cp] & (u_char)mask) == 0) cp++; return (end - cp); } diff --git a/sys/lib/libkern/skpc.c b/sys/lib/libkern/skpc.c index a48e6ea9e62..b7274f2bee4 100644 --- a/sys/lib/libkern/skpc.c +++ b/sys/lib/libkern/skpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: skpc.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: skpc.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: skpc.c,v 1.3 1996/03/14 18:52:18 christos Exp $ */ /* @@ -36,12 +36,9 @@ #include <lib/libkern/libkern.h> int -skpc(mask, size, cp) - register int mask; - size_t size; - register u_char *cp; +skpc(int mask, size_t size, u_char *cp) { - register u_char *end = &cp[size]; + u_char *end = &cp[size]; while (cp < end && *cp == (u_char) mask) cp++; diff --git a/sys/lib/libkern/srandom.c b/sys/lib/libkern/srandom.c index b0864d37a26..33cab523e04 100644 --- a/sys/lib/libkern/srandom.c +++ b/sys/lib/libkern/srandom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: srandom.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: srandom.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -38,8 +38,7 @@ extern u_long _randseed; void -srandom(seed) - u_long seed; +srandom(u_long seed) { _randseed = seed; } diff --git a/sys/lib/libkern/strcat.c b/sys/lib/libkern/strcat.c index c09afa4ee48..88cfad0cfb7 100644 --- a/sys/lib/libkern/strcat.c +++ b/sys/lib/libkern/strcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcat.c,v 1.7 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strcat.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -31,7 +31,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strcat.c 5.6 (Berkeley) 2/24/91";*/ -static char *rcsid = "$OpenBSD: strcat.c,v 1.7 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strcat.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -43,13 +43,13 @@ static char *rcsid = "$OpenBSD: strcat.c,v 1.7 2003/06/02 23:28:08 millert Exp $ __warn_references(strcat, "warning: strcat() is often misused, please use strlcpy()"); char * -strcat(s, append) - register char *s; - register const char *append; +strcat(char *s, const char *append) { char *save = s; - for (; *s; ++s); - while ((*s++ = *append++) != '\0'); + for (; *s; ++s) + ; + while ((*s++ = *append++) != '\0') + ; return(save); } diff --git a/sys/lib/libkern/strcmp.c b/sys/lib/libkern/strcmp.c index 00606e91a67..c38e2e55301 100644 --- a/sys/lib/libkern/strcmp.c +++ b/sys/lib/libkern/strcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.c,v 1.7 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strcmp.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strcmp.c 5.5 (Berkeley) 1/26/91";*/ -static char *rcsid = "$OpenBSD: strcmp.c,v 1.7 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strcmp.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -48,8 +48,8 @@ static char *rcsid = "$OpenBSD: strcmp.c,v 1.7 2003/06/02 23:28:08 millert Exp $ * Compare strings. */ int -strcmp(s1, s2) - register const char *s1, *s2; +strcmp(const char *s1, const char *s2) + { while (*s1 == *s2++) if (*s1++ == 0) diff --git a/sys/lib/libkern/strcpy.c b/sys/lib/libkern/strcpy.c index c68859f4540..e7dc46ab90a 100644 --- a/sys/lib/libkern/strcpy.c +++ b/sys/lib/libkern/strcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcpy.c,v 1.7 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strcpy.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -31,7 +31,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strcpy.c 5.7 (Berkeley) 2/24/91";*/ -static char *rcsid = "$OpenBSD: strcpy.c,v 1.7 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strcpy.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -43,9 +43,7 @@ static char *rcsid = "$OpenBSD: strcpy.c,v 1.7 2003/06/02 23:28:08 millert Exp $ __warn_references(strcpy, "warning: strcpy() is often misused, please use strlcpy()"); char * -strcpy(to, from) - register char *to; - register const char *from; +strcpy(char *to, const char *from) { char *save = to; diff --git a/sys/lib/libkern/strlcat.c b/sys/lib/libkern/strlcat.c index 3d601bf2396..8a5d680b085 100644 --- a/sys/lib/libkern/strlcat.c +++ b/sys/lib/libkern/strlcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlcat.c,v 1.4 2003/06/17 21:56:25 millert Exp $ */ +/* $OpenBSD: strlcat.c,v 1.5 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcat.c,v 1.4 2003/06/17 21:56:25 millert Exp $"; +static char *rcsid = "$OpenBSD: strlcat.c,v 1.5 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -37,9 +37,9 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.4 2003/06/17 21:56:25 millert Exp size_t strlcat(char *dst, const char *src, size_t siz) { - register char *d = dst; - register const char *s = src; - register size_t n = siz; + char *d = dst; + const char *s = src; + size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ diff --git a/sys/lib/libkern/strlcpy.c b/sys/lib/libkern/strlcpy.c index 7355cdf1ad4..b5150b7a05a 100644 --- a/sys/lib/libkern/strlcpy.c +++ b/sys/lib/libkern/strlcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlcpy.c,v 1.4 2003/06/17 21:56:25 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.5 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 2003/06/17 21:56:25 millert Exp $"; +static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -35,9 +35,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 2003/06/17 21:56:25 millert Exp size_t strlcpy(char *dst, const char *src, size_t siz) { - register char *d = dst; - register const char *s = src; - register size_t n = siz; + char *d = dst; + const char *s = src; + size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { diff --git a/sys/lib/libkern/strlen.c b/sys/lib/libkern/strlen.c index 3991469d318..9b7fea786ed 100644 --- a/sys/lib/libkern/strlen.c +++ b/sys/lib/libkern/strlen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlen.c,v 1.6 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strlen.c,v 1.7 2004/08/07 00:38:33 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlen.c,v 1.6 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strlen.c,v 1.7 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -40,8 +40,7 @@ static char *rcsid = "$OpenBSD: strlen.c,v 1.6 2003/06/02 23:28:08 millert Exp $ #endif size_t -strlen(str) - const char *str; +strlen(const char *str) { const char *s; diff --git a/sys/lib/libkern/strncasecmp.c b/sys/lib/libkern/strncasecmp.c index a67f8fc54b1..d09e48006f9 100644 --- a/sys/lib/libkern/strncasecmp.c +++ b/sys/lib/libkern/strncasecmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strncasecmp.c,v 1.3 1998/06/27 01:21:09 mickey Exp $ */ +/* $OpenBSD: strncasecmp.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$Id: strncasecmp.c,v 1.3 1998/06/27 01:21:09 mickey Exp $"; +static char *rcsid = "$Id: strncasecmp.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -40,10 +40,7 @@ static char *rcsid = "$Id: strncasecmp.c,v 1.3 1998/06/27 01:21:09 mickey Exp $" #endif int -strncasecmp(s1, s2, n) - const char *s1; - const char *s2; - size_t n; +strncasecmp(const char *s1, const char *s2, size_t n) { if (n == 0) return 0; diff --git a/sys/lib/libkern/strncmp.c b/sys/lib/libkern/strncmp.c index 28a15e953ea..78462928dfd 100644 --- a/sys/lib/libkern/strncmp.c +++ b/sys/lib/libkern/strncmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strncmp.c,v 1.7 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strncmp.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -31,7 +31,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strncmp.c 5.6 (Berkeley) 1/26/91";*/ -static char *rcsid = "$OpenBSD: strncmp.c,v 1.7 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strncmp.c,v 1.8 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -42,9 +42,7 @@ static char *rcsid = "$OpenBSD: strncmp.c,v 1.7 2003/06/02 23:28:08 millert Exp #endif int -strncmp(s1, s2, n) - register const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) diff --git a/sys/lib/libkern/strncpy.c b/sys/lib/libkern/strncpy.c index f371a5703a3..97e778ef067 100644 --- a/sys/lib/libkern/strncpy.c +++ b/sys/lib/libkern/strncpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strncpy.c,v 1.5 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: strncpy.c,v 1.6 2004/08/07 00:38:33 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strncpy.c 5.6 (Berkeley) 1/26/91";*/ -static char *rcsid = "$OpenBSD: strncpy.c,v 1.5 2003/06/02 23:28:08 millert Exp $"; +static char *rcsid = "$OpenBSD: strncpy.c,v 1.6 2004/08/07 00:38:33 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -48,14 +48,11 @@ static char *rcsid = "$OpenBSD: strncpy.c,v 1.5 2003/06/02 23:28:08 millert Exp * Return dst. */ char * -strncpy(dst, src, n) - char *dst; - const char *src; - register size_t n; +strncpy(char *dst, const char *src, size_t n) { if (n != 0) { - register char *d = dst; - register const char *s = src; + char *d = dst; + const char *s = src; do { if ((*d++ = *s++) == 0) { diff --git a/sys/lib/libkern/subdi3.c b/sys/lib/libkern/subdi3.c index ac3fdb9296f..54353825448 100644 --- a/sys/lib/libkern/subdi3.c +++ b/sys/lib/libkern/subdi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: subdi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: subdi3.c,v 1.5 1995/10/07 09:26:52 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)subdi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: subdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: subdi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,8 +49,7 @@ static char rcsid[] = "$OpenBSD: subdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * from a single u_long difference x-y occurs if and only if (x-y) > x. */ quad_t -__subdi3(a, b) - quad_t a, b; +__subdi3(quad_t a, quad_t b) { union uu aa, bb, diff; diff --git a/sys/lib/libkern/ucmpdi2.c b/sys/lib/libkern/ucmpdi2.c index c100b656cb4..00e1b7aad7e 100644 --- a/sys/lib/libkern/ucmpdi2.c +++ b/sys/lib/libkern/ucmpdi2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: ucmpdi2.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: ucmpdi2.c,v 1.5 1995/10/07 09:26:53 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)ucmpdi2.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: ucmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: ucmpdi2.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -49,8 +49,7 @@ static char rcsid[] = "$OpenBSD: ucmpdi2.c,v 1.3 2003/06/02 23:28:08 millert Exp * Neither a nor b are considered signed. */ int -__ucmpdi2(a, b) - u_quad_t a, b; +__ucmpdi2(u_quad_t a, u_quad_t b) { union uu aa, bb; diff --git a/sys/lib/libkern/udivdi3.c b/sys/lib/libkern/udivdi3.c index 6267ec311aa..6f7e657c05e 100644 --- a/sys/lib/libkern/udivdi3.c +++ b/sys/lib/libkern/udivdi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udivdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: udivdi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: udivdi3.c,v 1.5 1995/10/07 09:26:54 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)udivdi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: udivdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: udivdi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: udivdi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Divide two unsigned quads. */ u_quad_t -__udivdi3(a, b) - u_quad_t a, b; +__udivdi3(u_quad_t a, u_quad_t b) { return (__qdivrem(a, b, (u_quad_t *)0)); diff --git a/sys/lib/libkern/ulmax.c b/sys/lib/libkern/ulmax.c index 31687d6cb36..e9940cfc31e 100644 --- a/sys/lib/libkern/ulmax.c +++ b/sys/lib/libkern/ulmax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulmax.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: ulmax.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: ulmax.c,v 1.3 1996/03/14 18:52:23 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> unsigned long -ulmax(a, b) - unsigned long a, b; +ulmax(unsigned long a, unsigned long b) { return (a > b ? a : b); } diff --git a/sys/lib/libkern/ulmin.c b/sys/lib/libkern/ulmin.c index 0589705b5d9..6e6c8b3393f 100644 --- a/sys/lib/libkern/ulmin.c +++ b/sys/lib/libkern/ulmin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulmin.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: ulmin.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: ulmin.c,v 1.3 1996/03/14 18:52:25 christos Exp $ */ /* @@ -36,8 +36,7 @@ #include <lib/libkern/libkern.h> unsigned long -ulmin(a, b) - unsigned long a, b; +ulmin(unsigned long a, unsigned long b) { return (a < b ? a : b); } diff --git a/sys/lib/libkern/umoddi3.c b/sys/lib/libkern/umoddi3.c index 26f6c787113..226b926e81c 100644 --- a/sys/lib/libkern/umoddi3.c +++ b/sys/lib/libkern/umoddi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umoddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: umoddi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: umoddi3.c,v 1.5 1995/10/07 09:26:55 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)umoddi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: umoddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: umoddi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: umoddi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Return remainder after dividing two unsigned quads. */ u_quad_t -__umoddi3(a, b) - u_quad_t a, b; +__umoddi3(u_quad_t a, u_quad_t b) { u_quad_t r; diff --git a/sys/lib/libkern/xordi3.c b/sys/lib/libkern/xordi3.c index ec33f2df2c4..cc0f1b11e09 100644 --- a/sys/lib/libkern/xordi3.c +++ b/sys/lib/libkern/xordi3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: xordi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $ */ /* $NetBSD: xordi3.c,v 1.5 1995/10/07 09:26:56 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)xordi3.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: xordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: xordi3.c,v 1.4 2004/08/07 00:38:33 deraadt Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: xordi3.c,v 1.3 2003/06/02 23:28:08 millert Exp * Return a ^ b, in quad. */ quad_t -__xordi3(a, b) - quad_t a, b; +__xordi3(quad_t a, quad_t b) { union uu aa, bb; |