Browse Source

ansification; pval ok

OPENBSD_3_4
deraadt 21 years ago
parent
commit
fc6dd72c26
23 changed files with 84 additions and 127 deletions
  1. +3
    -5
      src/lib/libc/string/bzero.c
  2. +5
    -6
      src/lib/libc/string/ffs.c
  3. +2
    -5
      src/lib/libc/string/memchr.c
  4. +3
    -5
      src/lib/libc/string/memcmp.c
  5. +3
    -6
      src/lib/libc/string/memset.c
  6. +2
    -2
      src/lib/libc/string/rindex.c
  7. +10
    -13
      src/lib/libc/string/strcasecmp.c
  8. +2
    -3
      src/lib/libc/string/strcmp.c
  9. +4
    -6
      src/lib/libc/string/strcspn.c
  10. +3
    -4
      src/lib/libc/string/strdup.c
  11. +2
    -3
      src/lib/libc/string/strerror.c
  12. +3
    -4
      src/lib/libc/string/strlen.c
  13. +4
    -4
      src/lib/libc/string/strmode.c
  14. +4
    -7
      src/lib/libc/string/strncat.c
  15. +2
    -4
      src/lib/libc/string/strncmp.c
  16. +4
    -7
      src/lib/libc/string/strncpy.c
  17. +4
    -5
      src/lib/libc/string/strpbrk.c
  18. +6
    -8
      src/lib/libc/string/strsep.c
  19. +3
    -3
      src/lib/libc/string/strsignal.c
  20. +4
    -5
      src/lib/libc/string/strstr.c
  21. +5
    -10
      src/lib/libc/string/strtok.c
  22. +4
    -7
      src/lib/libc/string/strxfrm.c
  23. +2
    -5
      src/lib/libc/string/swab.c

+ 3
- 5
src/lib/libc/string/bzero.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: bzero.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
@ -41,11 +41,9 @@ static char *rcsid = "$OpenBSD: bzero.c,v 1.4 2003/06/02 20:18:38 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';


+ 5
- 6
src/lib/libc/string/ffs.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $ */
/* $OpenBSD: ffs.c,v 1.6 2003/06/11 21:08:16 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:10:38 mickey Exp $";
static char *rcsid = "$OpenBSD: ffs.c,v 1.6 2003/06/11 21:08:16 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:10:38 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,


+ 2
- 5
src/lib/libc/string/memchr.c View File

@ -31,16 +31,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: memchr.c,v 1.5 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: memchr.c,v 1.6 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
void *
memchr(s, c, n)
const void *s;
int c;
size_t n;
memchr(const void *s, int c, size_t n)
{
if (n != 0) {
const unsigned char *p = s;


+ 3
- 5
src/lib/libc/string/memcmp.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: memcmp.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -40,12 +40,10 @@ static char *rcsid = "$OpenBSD: memcmp.c,v 1.3 2003/06/02 20:18:38 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++)


+ 3
- 6
src/lib/libc/string/memset.c View File

@ -31,20 +31,17 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: memset.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: memset.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
void *
memset(dst, c, n)
void *dst;
register int c;
register size_t n;
memset(void *dst, int c, size_t n)
{
if (n != 0) {
register char *d = dst;
char *d = dst;
do
*d++ = c;


+ 2
- 2
src/lib/libc/string/rindex.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: rindex.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: rindex.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -40,7 +40,7 @@ strrchr(const char *p, int ch)
rindex(const char *p, int ch)
#endif
{
register char *save;
char *save;
for (save = NULL;; ++p) {
if (*p == ch)


+ 10
- 13
src/lib/libc/string/strcasecmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */
/* $OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993
@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
#else
static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@ -82,12 +82,11 @@ static const u_char charmap[] = {
};
int
strcasecmp(s1, s2)
const char *s1, *s2;
strcasecmp(const char *s1, const char *s2)
{
register const u_char *cm = charmap,
*us1 = (const u_char *)s1,
*us2 = (const u_char *)s2;
const u_char *cm = charmap;
const u_char *us1 = (const u_char *)s1;
const u_char *us2 = (const u_char *)s2;
while (cm[*us1] == cm[*us2++])
if (*us1++ == '\0')
@ -96,14 +95,12 @@ strcasecmp(s1, s2)
}
int
strncasecmp(s1, s2, n)
const char *s1, *s2;
register size_t n;
strncasecmp(const char *s1, const char *s2, size_t n)
{
if (n != 0) {
register const u_char *cm = charmap,
*us1 = (const u_char *)s1,
*us2 = (const u_char *)s2;
const u_char *cm = charmap;
const u_char *us1 = (const u_char *)s1;
const u_char *us2 = (const u_char *)s2;
do {
if (cm[*us1] != cm[*us2++])


+ 2
- 3
src/lib/libc/string/strcmp.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strcmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strcmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: strcmp.c,v 1.4 2003/06/02 20:18:38 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)


+ 4
- 6
src/lib/libc/string/strcspn.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strcspn.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strcspn.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -40,12 +40,10 @@ static char *rcsid = "$OpenBSD: strcspn.c,v 1.3 2003/06/02 20:18:38 millert Exp
* Span the complement of string s2.
*/
size_t
strcspn(s1, s2)
const char *s1;
register const char *s2;
strcspn(const char *s1, const char *s2)
{
register const char *p, *spanp;
register char c, sc;
const char *p, *spanp;
char c, sc;
/*
* Stop as soon as we find any character from s2. Note that there


+ 3
- 4
src/lib/libc/string/strdup.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */
/* $OpenBSD: strdup.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
/*
* Copyright (c) 1988, 1993
@ -33,7 +33,7 @@
#if 0
static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
#else
static char *rcsid = "$OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strdup.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: strdup.c,v 1.4 2003/06/02 20:18:38 millert Exp $
#include <string.h>
char *
strdup(str)
const char *str;
strdup(const char *str)
{
size_t siz;
char *copy;


+ 2
- 3
src/lib/libc/string/strerror.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strerror.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strerror.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -43,8 +43,7 @@ static char *rcsid = "$OpenBSD: strerror.c,v 1.4 2003/06/02 20:18:38 millert Exp
extern char *__strerror(int, char *);
char *
strerror(num)
int num;
strerror(int num)
{
static char buf[NL_TEXTMAX];
return __strerror(num, buf);


+ 3
- 4
src/lib/libc/string/strlen.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlen.c,v 1.5 2003/06/02 20:18:38 millert Exp $ */
/* $OpenBSD: strlen.c,v 1.6 2003/06/11 21:08:16 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -30,7 +30,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlen.c,v 1.5 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strlen.c,v 1.6 2003/06/11 21:08:16 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.5 2003/06/02 20:18:38 millert Exp $
#endif
size_t
strlen(str)
const char *str;
strlen(const char *str)
{
const char *s;


+ 4
- 4
src/lib/libc/string/strmode.c View File

@ -28,17 +28,17 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strmode.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strmode.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
/* XXX mode should be mode_t */
void
strmode(mode, p)
register mode_t mode;
register char *p;
strmode(int mode, char *p)
{
/* print type */
switch (mode & S_IFMT) {


+ 4
- 7
src/lib/libc/string/strncat.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strncat.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strncat.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -41,14 +41,11 @@ static char *rcsid = "$OpenBSD: strncat.c,v 1.3 2003/06/02 20:18:38 millert Exp
* are written at dst (at most n+1 bytes being appended). Return dst.
*/
char *
strncat(dst, src, n)
char *dst;
const char *src;
register size_t n;
strncat(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;
while (*d != 0)
d++;


+ 2
- 4
src/lib/libc/string/strncmp.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strncmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strncmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#ifndef _KERNEL
@ -38,9 +38,7 @@ static char *rcsid = "$OpenBSD: strncmp.c,v 1.4 2003/06/02 20:18:38 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)


+ 4
- 7
src/lib/libc/string/strncpy.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strncpy.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strncpy.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -41,14 +41,11 @@ static char *rcsid = "$OpenBSD: strncpy.c,v 1.3 2003/06/02 20:18:38 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) {


+ 4
- 5
src/lib/libc/string/strpbrk.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strpbrk.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strpbrk.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -37,11 +37,10 @@ static char *rcsid = "$OpenBSD: strpbrk.c,v 1.3 2003/06/02 20:18:38 millert Exp
* Find the first occurrence in s1 of a character in s2 (excluding NUL).
*/
char *
strpbrk(s1, s2)
register const char *s1, *s2;
strpbrk(const char *s1, const char *s2)
{
register const char *scanp;
register int c, sc;
const char *scanp;
int c, sc;
while ((c = *s1++) != 0) {
for (scanp = s2; (sc = *scanp++) != 0;)


+ 6
- 8
src/lib/libc/string/strsep.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */
/* $OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#else
static char *rcsid = "$OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@ -52,13 +52,11 @@ static char *rcsid = "$OpenBSD: strsep.c,v 1.4 2003/06/02 20:18:38 millert Exp $
* If *stringp is NULL, strsep returns NULL.
*/
char *
strsep(stringp, delim)
register char **stringp;
register const char *delim;
strsep(char **stringp, const char *delim)
{
register char *s;
register const char *spanp;
register int c, sc;
char *s;
const char *spanp;
int c, sc;
char *tok;
if ((s = *stringp) == NULL)


+ 3
- 3
src/lib/libc/string/strsignal.c View File

@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strsignal.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strsignal.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -37,9 +37,9 @@ static char *rcsid = "$OpenBSD: strsignal.c,v 1.4 2003/06/02 20:18:38 millert Ex
extern char *__strsignal(int, char *);
char *
strsignal(sig)
int sig;
strsignal(int sig)
{
static char buf[NL_TEXTMAX];
return __strsignal(sig, buf);
}

+ 4
- 5
src/lib/libc/string/strstr.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strstr.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strstr.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -40,11 +40,10 @@ static char *rcsid = "$OpenBSD: strstr.c,v 1.3 2003/06/02 20:18:38 millert Exp $
* Find the first occurrence of find in s.
*/
char *
strstr(s, find)
register const char *s, *find;
strstr(const char *s, const char *find)
{
register char c, sc;
register size_t len;
char c, sc;
size_t len;
if ((c = *find++) != 0) {
len = strlen(find);


+ 5
- 10
src/lib/libc/string/strtok.c View File

@ -28,15 +28,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strtok.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strtok.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
char *
strtok(s, delim)
register char *s;
register const char *delim;
strtok(char *s, const char *delim)
{
static char *last;
@ -44,13 +42,10 @@ strtok(s, delim)
}
char *
strtok_r(s, delim, last)
register char *s;
register const char *delim;
char **last;
strtok_r(char *s, const char *delim, char **last)
{
register char *spanp;
register int c, sc;
char *spanp;
int c, sc;
char *tok;


+ 4
- 7
src/lib/libc/string/strxfrm.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strxfrm.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: strxfrm.c,v 1.4 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -42,13 +42,10 @@ static char *rcsid = "$OpenBSD: strxfrm.c,v 1.3 2003/06/02 20:18:38 millert Exp
* on the original untransformed strings would return.
*/
size_t
strxfrm(dst, src, n)
register char *dst;
register const char *src;
register size_t n;
strxfrm(char *dst, const char *src, size_t n)
{
register size_t r = 0;
register int c;
size_t r = 0;
int c;
/*
* Since locales are unimplemented, this is just a copy.


+ 2
- 5
src/lib/libc/string/swab.c View File

@ -31,16 +31,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: swab.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
void
swab(from, to, len)
const void *from;
void *to;
size_t len;
swab(const void *from, void *to, size_t len)
{
register unsigned long temp;
register int n;


Loading…
Cancel
Save