summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2003-06-11 21:08:16 +0000
committerderaadt <>2003-06-11 21:08:16 +0000
commit05ebc6b11cf74e0e9e901f2e1c26d0d682c57842 (patch)
tree0ab503c1cf313bdf01aa32f8ffd0938a3d19c2a9
parent9b3b34e9713b6e433e3bb19fc1808375d5c69917 (diff)
downloadopenbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.tar.gz
openbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.tar.bz2
openbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.zip
ansification; pval ok
-rw-r--r--src/lib/libc/string/bzero.c8
-rw-r--r--src/lib/libc/string/ffs.c11
-rw-r--r--src/lib/libc/string/memchr.c7
-rw-r--r--src/lib/libc/string/memcmp.c8
-rw-r--r--src/lib/libc/string/memset.c9
-rw-r--r--src/lib/libc/string/rindex.c4
-rw-r--r--src/lib/libc/string/strcasecmp.c23
-rw-r--r--src/lib/libc/string/strcmp.c5
-rw-r--r--src/lib/libc/string/strcspn.c10
-rw-r--r--src/lib/libc/string/strdup.c7
-rw-r--r--src/lib/libc/string/strerror.c5
-rw-r--r--src/lib/libc/string/strlen.c7
-rw-r--r--src/lib/libc/string/strmode.c8
-rw-r--r--src/lib/libc/string/strncat.c11
-rw-r--r--src/lib/libc/string/strncmp.c6
-rw-r--r--src/lib/libc/string/strncpy.c11
-rw-r--r--src/lib/libc/string/strpbrk.c9
-rw-r--r--src/lib/libc/string/strsep.c14
-rw-r--r--src/lib/libc/string/strsignal.c6
-rw-r--r--src/lib/libc/string/strstr.c9
-rw-r--r--src/lib/libc/string/strtok.c15
-rw-r--r--src/lib/libc/string/strxfrm.c11
-rw-r--r--src/lib/libc/string/swab.c7
23 files changed, 84 insertions, 127 deletions
diff --git a/src/lib/libc/string/bzero.c b/src/lib/libc/string/bzero.c
index 20a6a53808..7e557ecd4a 100644
--- a/src/lib/libc/string/bzero.c
+++ b/src/lib/libc/string/bzero.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: bzero.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#ifndef _KERNEL 34#ifndef _KERNEL
@@ -41,11 +41,9 @@ static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 20:18:38 millert Exp $"
41 * bzero -- vax movc5 instruction 41 * bzero -- vax movc5 instruction
42 */ 42 */
43void 43void
44bzero(b, length) 44bzero(void *b, size_t length)
45 void *b;
46 register size_t length;
47{ 45{
48 register char *p; 46 char *p;
49 47
50 for (p = b; length--;) 48 for (p = b; length--;)
51 *p++ = '\0'; 49 *p++ = '\0';
diff --git a/src/lib/libc/string/ffs.c b/src/lib/libc/string/ffs.c
index 887ce437d4..f1d14096a2 100644
--- a/src/lib/libc/string/ffs.c
+++ b/src/lib/libc/string/ffs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $ */ 1/* $OpenBSD: ffs.c,v 1.6 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/* 3/*
4 * Public domain. 4 * Public domain.
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#if defined(LIBC_SCCS) && !defined(lint) 8#if defined(LIBC_SCCS) && !defined(lint)
9static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $"; 9static char *rcsid = "$OpenBSD: ffs.c,v 1.6 2003/06/11 21:08:16 deraadt Exp $";
10#endif /* LIBC_SCCS and not lint */ 10#endif /* LIBC_SCCS and not lint */
11 11
12#if !defined(_KERNEL) && !defined(_STANDALONE) 12#if !defined(_KERNEL) && !defined(_STANDALONE)
@@ -19,11 +19,10 @@ static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $";
19 * ffs -- vax ffs instruction 19 * ffs -- vax ffs instruction
20 */ 20 */
21int 21int
22ffs(mask) 22ffs(int mask)
23 register int mask;
24{ 23{
25 register int bit; 24 int bit;
26 register unsigned int r = mask; 25 unsigned int r = mask;
27 static const signed char t[16] = { 26 static const signed char t[16] = {
28 -28, 1, 2, 1, 27 -28, 1, 2, 1,
29 3, 1, 2, 1, 28 3, 1, 2, 1,
diff --git a/src/lib/libc/string/memchr.c b/src/lib/libc/string/memchr.c
index 9a294dff42..454abcbc17 100644
--- a/src/lib/libc/string/memchr.c
+++ b/src/lib/libc/string/memchr.c
@@ -31,16 +31,13 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: memchr.c,v 1.5 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: memchr.c,v 1.6 2003/06/11 21:08:16 deraadt 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>
38 38
39void * 39void *
40memchr(s, c, n) 40memchr(const void *s, int c, size_t n)
41 const void *s;
42 int c;
43 size_t n;
44{ 41{
45 if (n != 0) { 42 if (n != 0) {
46 const unsigned char *p = s; 43 const unsigned char *p = s;
diff --git a/src/lib/libc/string/memcmp.c b/src/lib/libc/string/memcmp.c
index 4897001e74..6c83208a7b 100644
--- a/src/lib/libc/string/memcmp.c
+++ b/src/lib/libc/string/memcmp.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: memcmp.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -40,12 +40,10 @@ static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 20:18:38 millert Exp $
40 * Compare memory regions. 40 * Compare memory regions.
41 */ 41 */
42int 42int
43memcmp(s1, s2, n) 43memcmp(const void *s1, const void *s2, size_t n)
44 const void *s1, *s2;
45 size_t n;
46{ 44{
47 if (n != 0) { 45 if (n != 0) {
48 register const unsigned char *p1 = s1, *p2 = s2; 46 const unsigned char *p1 = s1, *p2 = s2;
49 47
50 do { 48 do {
51 if (*p1++ != *p2++) 49 if (*p1++ != *p2++)
diff --git a/src/lib/libc/string/memset.c b/src/lib/libc/string/memset.c
index 161a499002..9bc0556faa 100644
--- a/src/lib/libc/string/memset.c
+++ b/src/lib/libc/string/memset.c
@@ -31,20 +31,17 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: memset.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: memset.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
38 38
39void * 39void *
40memset(dst, c, n) 40memset(void *dst, int c, size_t n)
41 void *dst;
42 register int c;
43 register size_t n;
44{ 41{
45 42
46 if (n != 0) { 43 if (n != 0) {
47 register char *d = dst; 44 char *d = dst;
48 45
49 do 46 do
50 *d++ = c; 47 *d++ = c;
diff --git a/src/lib/libc/string/rindex.c b/src/lib/libc/string/rindex.c
index 317962fdd6..b880d0eaeb 100644
--- a/src/lib/libc/string/rindex.c
+++ b/src/lib/libc/string/rindex.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: rindex.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: rindex.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <string.h> 34#include <string.h>
@@ -40,7 +40,7 @@ strrchr(const char *p, int ch)
40rindex(const char *p, int ch) 40rindex(const char *p, int ch)
41#endif 41#endif
42{ 42{
43 register char *save; 43 char *save;
44 44
45 for (save = NULL;; ++p) { 45 for (save = NULL;; ++p) {
46 if (*p == ch) 46 if (*p == ch)
diff --git a/src/lib/libc/string/strcasecmp.c b/src/lib/libc/string/strcasecmp.c
index f2ad06a726..62da063444 100644
--- a/src/lib/libc/string/strcasecmp.c
+++ b/src/lib/libc/string/strcasecmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */ 1/* $OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1987, 1993 4 * Copyright (c) 1987, 1993
@@ -35,7 +35,7 @@
35#if 0 35#if 0
36static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; 36static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
37#else 37#else
38static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 38static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
39#endif 39#endif
40#endif /* LIBC_SCCS and not lint */ 40#endif /* LIBC_SCCS and not lint */
41 41
@@ -82,12 +82,11 @@ static const u_char charmap[] = {
82}; 82};
83 83
84int 84int
85strcasecmp(s1, s2) 85strcasecmp(const char *s1, const char *s2)
86 const char *s1, *s2;
87{ 86{
88 register const u_char *cm = charmap, 87 const u_char *cm = charmap;
89 *us1 = (const u_char *)s1, 88 const u_char *us1 = (const u_char *)s1;
90 *us2 = (const u_char *)s2; 89 const u_char *us2 = (const u_char *)s2;
91 90
92 while (cm[*us1] == cm[*us2++]) 91 while (cm[*us1] == cm[*us2++])
93 if (*us1++ == '\0') 92 if (*us1++ == '\0')
@@ -96,14 +95,12 @@ strcasecmp(s1, s2)
96} 95}
97 96
98int 97int
99strncasecmp(s1, s2, n) 98strncasecmp(const char *s1, const char *s2, size_t n)
100 const char *s1, *s2;
101 register size_t n;
102{ 99{
103 if (n != 0) { 100 if (n != 0) {
104 register const u_char *cm = charmap, 101 const u_char *cm = charmap;
105 *us1 = (const u_char *)s1, 102 const u_char *us1 = (const u_char *)s1;
106 *us2 = (const u_char *)s2; 103 const u_char *us2 = (const u_char *)s2;
107 104
108 do { 105 do {
109 if (cm[*us1] != cm[*us2++]) 106 if (cm[*us1] != cm[*us2++])
diff --git a/src/lib/libc/string/strcmp.c b/src/lib/libc/string/strcmp.c
index 082561f7ff..9bda0a8d75 100644
--- a/src/lib/libc/string/strcmp.c
+++ b/src/lib/libc/string/strcmp.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strcmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strcmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
35#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
36 36
37#ifndef _KERNEL 37#ifndef _KERNEL
@@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: strcmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $
44 * Compare strings. 44 * Compare strings.
45 */ 45 */
46int 46int
47strcmp(s1, s2) 47strcmp(const char *s1, const char *s2)
48 register const char *s1, *s2;
49{ 48{
50 while (*s1 == *s2++) 49 while (*s1 == *s2++)
51 if (*s1++ == 0) 50 if (*s1++ == 0)
diff --git a/src/lib/libc/string/strcspn.c b/src/lib/libc/string/strcspn.c
index d6aa099423..f96f903809 100644
--- a/src/lib/libc/string/strcspn.c
+++ b/src/lib/libc/string/strcspn.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strcspn.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strcspn.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -40,12 +40,10 @@ static char *rcsid = "$OpenBSD: strcspn.c,v 1.3 2003/06/02 20:18:38 millert Exp
40 * Span the complement of string s2. 40 * Span the complement of string s2.
41 */ 41 */
42size_t 42size_t
43strcspn(s1, s2) 43strcspn(const char *s1, const char *s2)
44 const char *s1;
45 register const char *s2;
46{ 44{
47 register const char *p, *spanp; 45 const char *p, *spanp;
48 register char c, sc; 46 char c, sc;
49 47
50 /* 48 /*
51 * Stop as soon as we find any character from s2. Note that there 49 * Stop as soon as we find any character from s2. Note that there
diff --git a/src/lib/libc/string/strdup.c b/src/lib/libc/string/strdup.c
index 0d2e30a547..bbea59888c 100644
--- a/src/lib/libc/string/strdup.c
+++ b/src/lib/libc/string/strdup.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */ 1/* $OpenBSD: strdup.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988, 1993 4 * Copyright (c) 1988, 1993
@@ -33,7 +33,7 @@
33#if 0 33#if 0
34static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; 34static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
35#else 35#else
36static char *rcsid = "$OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 36static char *rcsid = "$OpenBSD: strdup.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
37#endif 37#endif
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
@@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $
44#include <string.h> 44#include <string.h>
45 45
46char * 46char *
47strdup(str) 47strdup(const char *str)
48 const char *str;
49{ 48{
50 size_t siz; 49 size_t siz;
51 char *copy; 50 char *copy;
diff --git a/src/lib/libc/string/strerror.c b/src/lib/libc/string/strerror.c
index 60591c6ee2..6496f50afd 100644
--- a/src/lib/libc/string/strerror.c
+++ b/src/lib/libc/string/strerror.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strerror.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strerror.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <string.h> 34#include <string.h>
@@ -43,8 +43,7 @@ static char *rcsid = "$OpenBSD: strerror.c,v 1.4 2003/06/02 20:18:38 millert Exp
43extern char *__strerror(int, char *); 43extern char *__strerror(int, char *);
44 44
45char * 45char *
46strerror(num) 46strerror(int num)
47 int num;
48{ 47{
49 static char buf[NL_TEXTMAX]; 48 static char buf[NL_TEXTMAX];
50 return __strerror(num, buf); 49 return __strerror(num, buf);
diff --git a/src/lib/libc/string/strlen.c b/src/lib/libc/string/strlen.c
index b9f3114cc0..298a9966a3 100644
--- a/src/lib/libc/string/strlen.c
+++ b/src/lib/libc/string/strlen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strlen.c,v 1.5 2003/06/02 20:18:38 millert Exp $ */ 1/* $OpenBSD: strlen.c,v 1.6 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990, 1993 4 * Copyright (c) 1990, 1993
@@ -30,7 +30,7 @@
30 */ 30 */
31 31
32#if defined(LIBC_SCCS) && !defined(lint) 32#if defined(LIBC_SCCS) && !defined(lint)
33static char *rcsid = "$OpenBSD: strlen.c,v 1.5 2003/06/02 20:18:38 millert Exp $"; 33static char *rcsid = "$OpenBSD: strlen.c,v 1.6 2003/06/11 21:08:16 deraadt 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)
@@ -40,8 +40,7 @@ static char *rcsid = "$OpenBSD: strlen.c,v 1.5 2003/06/02 20:18:38 millert Exp $
40#endif 40#endif
41 41
42size_t 42size_t
43strlen(str) 43strlen(const char *str)
44 const char *str;
45{ 44{
46 const char *s; 45 const char *s;
47 46
diff --git a/src/lib/libc/string/strmode.c b/src/lib/libc/string/strmode.c
index 0c2afb4d4c..bd78403cb2 100644
--- a/src/lib/libc/string/strmode.c
+++ b/src/lib/libc/string/strmode.c
@@ -28,17 +28,17 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strmode.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strmode.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/stat.h> 35#include <sys/stat.h>
36#include <string.h> 36#include <string.h>
37 37
38/* XXX mode should be mode_t */
39
38void 40void
39strmode(mode, p) 41strmode(int mode, char *p)
40 register mode_t mode;
41 register char *p;
42{ 42{
43 /* print type */ 43 /* print type */
44 switch (mode & S_IFMT) { 44 switch (mode & S_IFMT) {
diff --git a/src/lib/libc/string/strncat.c b/src/lib/libc/string/strncat.c
index fa839663ac..05d35e0900 100644
--- a/src/lib/libc/string/strncat.c
+++ b/src/lib/libc/string/strncat.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strncat.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strncat.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -41,14 +41,11 @@ static char *rcsid = "$OpenBSD: strncat.c,v 1.3 2003/06/02 20:18:38 millert Exp
41 * are written at dst (at most n+1 bytes being appended). Return dst. 41 * are written at dst (at most n+1 bytes being appended). Return dst.
42 */ 42 */
43char * 43char *
44strncat(dst, src, n) 44strncat(char *dst, const char *src, size_t n)
45 char *dst;
46 const char *src;
47 register size_t n;
48{ 45{
49 if (n != 0) { 46 if (n != 0) {
50 register char *d = dst; 47 char *d = dst;
51 register const char *s = src; 48 const char *s = src;
52 49
53 while (*d != 0) 50 while (*d != 0)
54 d++; 51 d++;
diff --git a/src/lib/libc/string/strncmp.c b/src/lib/libc/string/strncmp.c
index dad7198647..82420e215e 100644
--- a/src/lib/libc/string/strncmp.c
+++ b/src/lib/libc/string/strncmp.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strncmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strncmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#ifndef _KERNEL 34#ifndef _KERNEL
@@ -38,9 +38,7 @@ static char *rcsid = "$OpenBSD: strncmp.c,v 1.4 2003/06/02 20:18:38 millert Exp
38#endif 38#endif
39 39
40int 40int
41strncmp(s1, s2, n) 41strncmp(const char *s1, const char *s2, size_t n)
42 register const char *s1, *s2;
43 register size_t n;
44{ 42{
45 43
46 if (n == 0) 44 if (n == 0)
diff --git a/src/lib/libc/string/strncpy.c b/src/lib/libc/string/strncpy.c
index 20eb7383fe..00493f4f7f 100644
--- a/src/lib/libc/string/strncpy.c
+++ b/src/lib/libc/string/strncpy.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strncpy.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strncpy.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -41,14 +41,11 @@ static char *rcsid = "$OpenBSD: strncpy.c,v 1.3 2003/06/02 20:18:38 millert Exp
41 * Return dst. 41 * Return dst.
42 */ 42 */
43char * 43char *
44strncpy(dst, src, n) 44strncpy(char *dst, const char *src, size_t n)
45 char *dst;
46 const char *src;
47 register size_t n;
48{ 45{
49 if (n != 0) { 46 if (n != 0) {
50 register char *d = dst; 47 char *d = dst;
51 register const char *s = src; 48 const char *s = src;
52 49
53 do { 50 do {
54 if ((*d++ = *s++) == 0) { 51 if ((*d++ = *s++) == 0) {
diff --git a/src/lib/libc/string/strpbrk.c b/src/lib/libc/string/strpbrk.c
index 520e20de14..024c42bdc3 100644
--- a/src/lib/libc/string/strpbrk.c
+++ b/src/lib/libc/string/strpbrk.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strpbrk.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strpbrk.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <string.h> 34#include <string.h>
@@ -37,11 +37,10 @@ static char *rcsid = "$OpenBSD: strpbrk.c,v 1.3 2003/06/02 20:18:38 millert Exp
37 * Find the first occurrence in s1 of a character in s2 (excluding NUL). 37 * Find the first occurrence in s1 of a character in s2 (excluding NUL).
38 */ 38 */
39char * 39char *
40strpbrk(s1, s2) 40strpbrk(const char *s1, const char *s2)
41 register const char *s1, *s2;
42{ 41{
43 register const char *scanp; 42 const char *scanp;
44 register int c, sc; 43 int c, sc;
45 44
46 while ((c = *s1++) != 0) { 45 while ((c = *s1++) != 0) {
47 for (scanp = s2; (sc = *scanp++) != 0;) 46 for (scanp = s2; (sc = *scanp++) != 0;)
diff --git a/src/lib/libc/string/strsep.c b/src/lib/libc/string/strsep.c
index 2549707fbb..337d78e466 100644
--- a/src/lib/libc/string/strsep.c
+++ b/src/lib/libc/string/strsep.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */ 1/* $OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990, 1993 4 * Copyright (c) 1990, 1993
@@ -36,7 +36,7 @@
36#if 0 36#if 0
37static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; 37static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
38#else 38#else
39static char *rcsid = "$OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 39static char *rcsid = "$OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
40#endif 40#endif
41#endif /* LIBC_SCCS and not lint */ 41#endif /* LIBC_SCCS and not lint */
42 42
@@ -52,13 +52,11 @@ static char *rcsid = "$OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $
52 * If *stringp is NULL, strsep returns NULL. 52 * If *stringp is NULL, strsep returns NULL.
53 */ 53 */
54char * 54char *
55strsep(stringp, delim) 55strsep(char **stringp, const char *delim)
56 register char **stringp;
57 register const char *delim;
58{ 56{
59 register char *s; 57 char *s;
60 register const char *spanp; 58 const char *spanp;
61 register int c, sc; 59 int c, sc;
62 char *tok; 60 char *tok;
63 61
64 if ((s = *stringp) == NULL) 62 if ((s = *stringp) == NULL)
diff --git a/src/lib/libc/string/strsignal.c b/src/lib/libc/string/strsignal.c
index 3a9f5eb16b..afe0deb272 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)
31static char *rcsid = "$OpenBSD: strsignal.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strsignal.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <string.h> 34#include <string.h>
@@ -37,9 +37,9 @@ static char *rcsid = "$OpenBSD: strsignal.c,v 1.4 2003/06/02 20:18:38 millert Ex
37extern char *__strsignal(int, char *); 37extern char *__strsignal(int, char *);
38 38
39char * 39char *
40strsignal(sig) 40strsignal(int sig)
41 int sig;
42{ 41{
43 static char buf[NL_TEXTMAX]; 42 static char buf[NL_TEXTMAX];
43
44 return __strsignal(sig, buf); 44 return __strsignal(sig, buf);
45} 45}
diff --git a/src/lib/libc/string/strstr.c b/src/lib/libc/string/strstr.c
index 2e71af478c..e6a94c5ce6 100644
--- a/src/lib/libc/string/strstr.c
+++ b/src/lib/libc/string/strstr.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strstr.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strstr.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -40,11 +40,10 @@ static char *rcsid = "$OpenBSD: strstr.c,v 1.3 2003/06/02 20:18:38 millert Exp $
40 * Find the first occurrence of find in s. 40 * Find the first occurrence of find in s.
41 */ 41 */
42char * 42char *
43strstr(s, find) 43strstr(const char *s, const char *find)
44 register const char *s, *find;
45{ 44{
46 register char c, sc; 45 char c, sc;
47 register size_t len; 46 size_t len;
48 47
49 if ((c = *find++) != 0) { 48 if ((c = *find++) != 0) {
50 len = strlen(find); 49 len = strlen(find);
diff --git a/src/lib/libc/string/strtok.c b/src/lib/libc/string/strtok.c
index ff09630912..6498eac8cc 100644
--- a/src/lib/libc/string/strtok.c
+++ b/src/lib/libc/string/strtok.c
@@ -28,15 +28,13 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strtok.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strtok.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <string.h> 34#include <string.h>
35 35
36char * 36char *
37strtok(s, delim) 37strtok(char *s, const char *delim)
38 register char *s;
39 register const char *delim;
40{ 38{
41 static char *last; 39 static char *last;
42 40
@@ -44,13 +42,10 @@ strtok(s, delim)
44} 42}
45 43
46char * 44char *
47strtok_r(s, delim, last) 45strtok_r(char *s, const char *delim, char **last)
48 register char *s;
49 register const char *delim;
50 char **last;
51{ 46{
52 register char *spanp; 47 char *spanp;
53 register int c, sc; 48 int c, sc;
54 char *tok; 49 char *tok;
55 50
56 51
diff --git a/src/lib/libc/string/strxfrm.c b/src/lib/libc/string/strxfrm.c
index 9217ae069c..b7c8d4822d 100644
--- a/src/lib/libc/string/strxfrm.c
+++ b/src/lib/libc/string/strxfrm.c
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strxfrm.c,v 1.3 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: strxfrm.c,v 1.4 2003/06/11 21:08:16 deraadt 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>
@@ -42,13 +42,10 @@ static char *rcsid = "$OpenBSD: strxfrm.c,v 1.3 2003/06/02 20:18:38 millert Exp
42 * on the original untransformed strings would return. 42 * on the original untransformed strings would return.
43 */ 43 */
44size_t 44size_t
45strxfrm(dst, src, n) 45strxfrm(char *dst, const char *src, size_t n)
46 register char *dst;
47 register const char *src;
48 register size_t n;
49{ 46{
50 register size_t r = 0; 47 size_t r = 0;
51 register int c; 48 int c;
52 49
53 /* 50 /*
54 * Since locales are unimplemented, this is just a copy. 51 * Since locales are unimplemented, this is just a copy.
diff --git a/src/lib/libc/string/swab.c b/src/lib/libc/string/swab.c
index 0524914361..b928f21aa7 100644
--- a/src/lib/libc/string/swab.c
+++ b/src/lib/libc/string/swab.c
@@ -31,16 +31,13 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: swab.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 34static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt 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>
38 38
39void 39void
40swab(from, to, len) 40swab(const void *from, void *to, size_t len)
41 const void *from;
42 void *to;
43 size_t len;
44{ 41{
45 register unsigned long temp; 42 register unsigned long temp;
46 register int n; 43 register int n;