diff options
-rw-r--r-- | src/lib/libc/string/__strsignal.c | 11 | ||||
-rw-r--r-- | src/lib/libc/string/bcmp.c | 10 | ||||
-rw-r--r-- | src/lib/libc/string/bcopy.c | 17 | ||||
-rw-r--r-- | src/lib/libc/string/bm.c | 27 | ||||
-rw-r--r-- | src/lib/libc/string/memccpy.c | 16 | ||||
-rw-r--r-- | src/lib/libc/string/strlcat.c | 10 | ||||
-rw-r--r-- | src/lib/libc/string/strlcpy.c | 10 | ||||
-rw-r--r-- | src/lib/libc/string/swab.c | 8 |
8 files changed, 45 insertions, 64 deletions
diff --git a/src/lib/libc/string/__strsignal.c b/src/lib/libc/string/__strsignal.c index 5bab3cd0af..ebbf08d24a 100644 --- a/src/lib/libc/string/__strsignal.c +++ b/src/lib/libc/string/__strsignal.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char *rcsid = "$OpenBSD: __strsignal.c,v 1.8 2003/06/02 20:18:38 millert Exp $"; | 31 | static char *rcsid = "$OpenBSD: __strsignal.c,v 1.9 2005/03/30 20:13:52 otto Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #ifdef NLS | 34 | #ifdef NLS |
@@ -45,8 +45,7 @@ static char *rcsid = "$OpenBSD: __strsignal.c,v 1.8 2003/06/02 20:18:38 millert | |||
45 | #include <signal.h> | 45 | #include <signal.h> |
46 | #include <string.h> | 46 | #include <string.h> |
47 | 47 | ||
48 | static char *itoa(num) | 48 | static char *itoa(int num) |
49 | int num; | ||
50 | { | 49 | { |
51 | static char buffer[11]; | 50 | static char buffer[11]; |
52 | char *p; | 51 | char *p; |
@@ -61,12 +60,10 @@ static char *itoa(num) | |||
61 | } | 60 | } |
62 | 61 | ||
63 | char * | 62 | char * |
64 | __strsignal(num, buf) | 63 | __strsignal(int num, char *buf) |
65 | int num; | ||
66 | char *buf; | ||
67 | { | 64 | { |
68 | #define UPREFIX "Unknown signal: " | 65 | #define UPREFIX "Unknown signal: " |
69 | register unsigned int signum; | 66 | unsigned int signum; |
70 | 67 | ||
71 | #ifdef NLS | 68 | #ifdef NLS |
72 | nl_catd catd ; | 69 | nl_catd catd ; |
diff --git a/src/lib/libc/string/bcmp.c b/src/lib/libc/string/bcmp.c index 8dc8798f25..07d32ed043 100644 --- a/src/lib/libc/string/bcmp.c +++ b/src/lib/libc/string/bcmp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bcmp.c,v 1.6 2004/11/28 07:16:54 mickey Exp $ */ | 1 | /* $OpenBSD: bcmp.c,v 1.7 2005/03/30 20:13:52 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1987 Regents of the University of California. | 4 | * Copyright (c) 1987 Regents of the University of California. |
@@ -30,7 +30,7 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if defined(LIBC_SCCS) && !defined(lint) | 32 | #if defined(LIBC_SCCS) && !defined(lint) |
33 | static char *rcsid = "$OpenBSD: bcmp.c,v 1.6 2004/11/28 07:16:54 mickey Exp $"; | 33 | static char *rcsid = "$OpenBSD: bcmp.c,v 1.7 2005/03/30 20:13:52 otto Exp $"; |
34 | #endif /* LIBC_SCCS and not lint */ | 34 | #endif /* LIBC_SCCS and not lint */ |
35 | 35 | ||
36 | #if !defined(_KERNEL) && !defined(_STANDALONE) | 36 | #if !defined(_KERNEL) && !defined(_STANDALONE) |
@@ -43,11 +43,9 @@ static char *rcsid = "$OpenBSD: bcmp.c,v 1.6 2004/11/28 07:16:54 mickey Exp $"; | |||
43 | * bcmp -- vax cmpc3 instruction | 43 | * bcmp -- vax cmpc3 instruction |
44 | */ | 44 | */ |
45 | int | 45 | int |
46 | bcmp(b1, b2, length) | 46 | bcmp(const void *b1, const void *b2, size_t length) |
47 | const void *b1, *b2; | ||
48 | register size_t length; | ||
49 | { | 47 | { |
50 | register char *p1, *p2; | 48 | char *p1, *p2; |
51 | 49 | ||
52 | if (length == 0) | 50 | if (length == 0) |
53 | return(0); | 51 | return(0); |
diff --git a/src/lib/libc/string/bcopy.c b/src/lib/libc/string/bcopy.c index c48faa145e..7b30ab4abb 100644 --- a/src/lib/libc/string/bcopy.c +++ b/src/lib/libc/string/bcopy.c | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #if defined(LIBC_SCCS) && !defined(lint) | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | static char *rcsid = "$OpenBSD: bcopy.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; | 34 | static char *rcsid = "$OpenBSD: bcopy.c,v 1.4 2005/03/30 20:13:52 otto Exp $"; |
35 | #endif /* LIBC_SCCS and not lint */ | 35 | #endif /* LIBC_SCCS and not lint */ |
36 | 36 | ||
37 | #include <string.h> | 37 | #include <string.h> |
@@ -52,23 +52,20 @@ typedef long word; /* "word" used for optimal copy speed */ | |||
52 | */ | 52 | */ |
53 | #ifdef MEMCOPY | 53 | #ifdef MEMCOPY |
54 | void * | 54 | void * |
55 | memcpy(dst0, src0, length) | 55 | memcpy(void *dst0, const void *src0, size_t length) |
56 | #else | 56 | #else |
57 | #ifdef MEMMOVE | 57 | #ifdef MEMMOVE |
58 | void * | 58 | void * |
59 | memmove(dst0, src0, length) | 59 | memmove(void *dst0, const void *src0, size_t length) |
60 | #else | 60 | #else |
61 | void | 61 | void |
62 | bcopy(src0, dst0, length) | 62 | bcopy(const void *src0, void *dst0, size_t length) |
63 | #endif | 63 | #endif |
64 | #endif | 64 | #endif |
65 | void *dst0; | ||
66 | const void *src0; | ||
67 | register size_t length; | ||
68 | { | 65 | { |
69 | register char *dst = dst0; | 66 | char *dst = dst0; |
70 | register const char *src = src0; | 67 | const char *src = src0; |
71 | register size_t t; | 68 | size_t t; |
72 | 69 | ||
73 | if (length == 0 || dst == src) /* nothing to do */ | 70 | if (length == 0 || dst == src) /* nothing to do */ |
74 | goto done; | 71 | goto done; |
diff --git a/src/lib/libc/string/bm.c b/src/lib/libc/string/bm.c index 2c7f8fac32..6c8e4c3472 100644 --- a/src/lib/libc/string/bm.c +++ b/src/lib/libc/string/bm.c | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #if defined(LIBC_SCCS) && !defined(lint) | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | static char *rcsid = "$OpenBSD: bm.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; | 34 | static char *rcsid = "$OpenBSD: bm.c,v 1.5 2005/03/30 20:13:52 otto Exp $"; |
35 | #endif /* LIBC_SCCS and not lint */ | 35 | #endif /* LIBC_SCCS and not lint */ |
36 | 36 | ||
37 | #include <sys/types.h> | 37 | #include <sys/types.h> |
@@ -85,14 +85,11 @@ static u_char const freq_def[256] = { | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | bm_pat * | 87 | bm_pat * |
88 | bm_comp(pb, len, freq) | 88 | bm_comp(u_char const *pb, size_t len, u_char const *freq) |
89 | u_char const *pb; | ||
90 | size_t len; | ||
91 | u_char const *freq; | ||
92 | { | 89 | { |
93 | register u_char const *pe, *p; | 90 | u_char const *pe, *p; |
94 | register size_t *d, r; | 91 | size_t *d, r; |
95 | register int j; | 92 | int j; |
96 | int sv_errno; | 93 | int sv_errno; |
97 | bm_pat *pat; | 94 | bm_pat *pat; |
98 | 95 | ||
@@ -142,8 +139,7 @@ mem: sv_errno = errno; | |||
142 | } | 139 | } |
143 | 140 | ||
144 | void | 141 | void |
145 | bm_free(pat) | 142 | bm_free(bm_pat *pat) |
146 | bm_pat *pat; | ||
147 | { | 143 | { |
148 | if (pat->pat != NULL) | 144 | if (pat->pat != NULL) |
149 | free(pat->pat); | 145 | free(pat->pat); |
@@ -153,14 +149,11 @@ bm_free(pat) | |||
153 | } | 149 | } |
154 | 150 | ||
155 | u_char * | 151 | u_char * |
156 | bm_exec(pat, base, n) | 152 | bm_exec(bm_pat *pat, u_char *base, size_t n) |
157 | bm_pat *pat; | ||
158 | u_char *base; | ||
159 | size_t n; | ||
160 | { | 153 | { |
161 | register u_char *e, *ep, *p, *q, *s; | 154 | u_char *e, *ep, *p, *q, *s; |
162 | register size_t *d0, k, md2, n1, ro; | 155 | size_t *d0, k, md2, n1, ro; |
163 | register int rc; | 156 | int rc; |
164 | 157 | ||
165 | if (n == 0) | 158 | if (n == 0) |
166 | return (NULL); | 159 | return (NULL); |
diff --git a/src/lib/libc/string/memccpy.c b/src/lib/libc/string/memccpy.c index 37496d1c26..265570c5a4 100644 --- a/src/lib/libc/string/memccpy.c +++ b/src/lib/libc/string/memccpy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: memccpy.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */ | 1 | /* $OpenBSD: memccpy.c,v 1.5 2005/03/30 20:13:52 otto Exp $ */ |
2 | 2 | ||
3 | /*- | 3 | /*- |
4 | * Copyright (c) 1990, 1993 | 4 | * Copyright (c) 1990, 1993 |
@@ -33,24 +33,20 @@ | |||
33 | #if 0 | 33 | #if 0 |
34 | static char sccsid[] = "@(#)memccpy.c 8.1 (Berkeley) 6/4/93"; | 34 | static char sccsid[] = "@(#)memccpy.c 8.1 (Berkeley) 6/4/93"; |
35 | #else | 35 | #else |
36 | static char *rcsid = "$OpenBSD: memccpy.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; | 36 | static char *rcsid = "$OpenBSD: memccpy.c,v 1.5 2005/03/30 20:13:52 otto Exp $"; |
37 | #endif | 37 | #endif |
38 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ |
39 | 39 | ||
40 | #include <string.h> | 40 | #include <string.h> |
41 | 41 | ||
42 | void * | 42 | void * |
43 | memccpy(t, f, c, n) | 43 | memccpy(void *t, const void *f, int c, size_t n) |
44 | void *t; | ||
45 | const void *f; | ||
46 | int c; | ||
47 | register size_t n; | ||
48 | { | 44 | { |
49 | 45 | ||
50 | if (n) { | 46 | if (n) { |
51 | register unsigned char *tp = t; | 47 | unsigned char *tp = t; |
52 | register const unsigned char *fp = f; | 48 | const unsigned char *fp = f; |
53 | register unsigned char uc = c; | 49 | unsigned char uc = c; |
54 | do { | 50 | do { |
55 | if ((*tp++ = *fp++) == uc) | 51 | if ((*tp++ = *fp++) == uc) |
56 | return (tp); | 52 | return (tp); |
diff --git a/src/lib/libc/string/strlcat.c b/src/lib/libc/string/strlcat.c index 2b6f1adbb4..952eed1a79 100644 --- a/src/lib/libc/string/strlcat.c +++ b/src/lib/libc/string/strlcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ */ | 1 | /* $OpenBSD: strlcat.c,v 1.12 2005/03/30 20:13:52 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #if defined(LIBC_SCCS) && !defined(lint) | 19 | #if defined(LIBC_SCCS) && !defined(lint) |
20 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $"; | 20 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.12 2005/03/30 20:13:52 otto Exp $"; |
21 | #endif /* LIBC_SCCS and not lint */ | 21 | #endif /* LIBC_SCCS and not lint */ |
22 | 22 | ||
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
@@ -33,9 +33,9 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp | |||
33 | size_t | 33 | size_t |
34 | strlcat(char *dst, const char *src, size_t siz) | 34 | strlcat(char *dst, const char *src, size_t siz) |
35 | { | 35 | { |
36 | register char *d = dst; | 36 | char *d = dst; |
37 | register const char *s = src; | 37 | const char *s = src; |
38 | register size_t n = siz; | 38 | size_t n = siz; |
39 | size_t dlen; | 39 | size_t dlen; |
40 | 40 | ||
41 | /* Find the end of dst and adjust bytes left but don't go past end */ | 41 | /* Find the end of dst and adjust bytes left but don't go past end */ |
diff --git a/src/lib/libc/string/strlcpy.c b/src/lib/libc/string/strlcpy.c index 82cbfac016..09a9c2b360 100644 --- a/src/lib/libc/string/strlcpy.c +++ b/src/lib/libc/string/strlcpy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */ | 1 | /* $OpenBSD: strlcpy.c,v 1.9 2005/03/30 20:13:52 otto Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #if defined(LIBC_SCCS) && !defined(lint) | 19 | #if defined(LIBC_SCCS) && !defined(lint) |
20 | static char *rcsid = "$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $"; | 20 | static char *rcsid = "$OpenBSD: strlcpy.c,v 1.9 2005/03/30 20:13:52 otto Exp $"; |
21 | #endif /* LIBC_SCCS and not lint */ | 21 | #endif /* LIBC_SCCS and not lint */ |
22 | 22 | ||
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
@@ -31,9 +31,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp | |||
31 | size_t | 31 | size_t |
32 | strlcpy(char *dst, const char *src, size_t siz) | 32 | strlcpy(char *dst, const char *src, size_t siz) |
33 | { | 33 | { |
34 | register char *d = dst; | 34 | char *d = dst; |
35 | register const char *s = src; | 35 | const char *s = src; |
36 | register size_t n = siz; | 36 | size_t n = siz; |
37 | 37 | ||
38 | /* Copy as many bytes as will fit */ | 38 | /* Copy as many bytes as will fit */ |
39 | if (n != 0 && --n != 0) { | 39 | if (n != 0 && --n != 0) { |
diff --git a/src/lib/libc/string/swab.c b/src/lib/libc/string/swab.c index b928f21aa7..0129561aa3 100644 --- a/src/lib/libc/string/swab.c +++ b/src/lib/libc/string/swab.c | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #if defined(LIBC_SCCS) && !defined(lint) | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $"; | 34 | static char *rcsid = "$OpenBSD: swab.c,v 1.6 2005/03/30 20:13:52 otto Exp $"; |
35 | #endif /* LIBC_SCCS and not lint */ | 35 | #endif /* LIBC_SCCS and not lint */ |
36 | 36 | ||
37 | #include <unistd.h> | 37 | #include <unistd.h> |
@@ -39,9 +39,9 @@ static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $"; | |||
39 | void | 39 | void |
40 | swab(const void *from, void *to, size_t len) | 40 | swab(const void *from, void *to, size_t len) |
41 | { | 41 | { |
42 | register unsigned long temp; | 42 | unsigned long temp; |
43 | register int n; | 43 | int n; |
44 | register char *fp, *tp; | 44 | char *fp, *tp; |
45 | 45 | ||
46 | n = (len >> 1) + 1; | 46 | n = (len >> 1) + 1; |
47 | fp = (char *)from; | 47 | fp = (char *)from; |