Browse Source

ansify + deregister. no binary change on i386. ok deraadt@ pat@ moritz@

OPENBSD_3_8
otto 19 years ago
parent
commit
8b4d0d1471
8 changed files with 45 additions and 64 deletions
  1. +4
    -7
      src/lib/libc/string/__strsignal.c
  2. +4
    -6
      src/lib/libc/string/bcmp.c
  3. +7
    -10
      src/lib/libc/string/bcopy.c
  4. +10
    -17
      src/lib/libc/string/bm.c
  5. +6
    -10
      src/lib/libc/string/memccpy.c
  6. +5
    -5
      src/lib/libc/string/strlcat.c
  7. +5
    -5
      src/lib/libc/string/strlcpy.c
  8. +4
    -4
      src/lib/libc/string/swab.c

+ 4
- 7
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.8 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: __strsignal.c,v 1.9 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#ifdef NLS
@ -45,8 +45,7 @@ static char *rcsid = "$OpenBSD: __strsignal.c,v 1.8 2003/06/02 20:18:38 millert
#include <signal.h>
#include <string.h>
static char *itoa(num)
int num;
static char *itoa(int num)
{
static char buffer[11];
char *p;
@ -61,12 +60,10 @@ static char *itoa(num)
}
char *
__strsignal(num, buf)
int num;
char *buf;
__strsignal(int num, char *buf)
{
#define UPREFIX "Unknown signal: "
register unsigned int signum;
unsigned int signum;
#ifdef NLS
nl_catd catd ;


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

@ -1,4 +1,4 @@
/* $OpenBSD: bcmp.c,v 1.6 2004/11/28 07:16:54 mickey Exp $ */
/* $OpenBSD: bcmp.c,v 1.7 2005/03/30 20:13:52 otto Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@ -30,7 +30,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: bcmp.c,v 1.6 2004/11/28 07:16:54 mickey Exp $";
static char *rcsid = "$OpenBSD: bcmp.c,v 1.7 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#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 $";
* 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 char *p1, *p2;
char *p1, *p2;
if (length == 0)
return(0);


+ 7
- 10
src/lib/libc/string/bcopy.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: bcopy.c,v 1.3 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: bcopy.c,v 1.4 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@ -52,23 +52,20 @@ typedef long word; /* "word" used for optimal copy speed */
*/
#ifdef MEMCOPY
void *
memcpy(dst0, src0, length)
memcpy(void *dst0, const void *src0, size_t length)
#else
#ifdef MEMMOVE
void *
memmove(dst0, src0, length)
memmove(void *dst0, const void *src0, size_t length)
#else
void
bcopy(src0, dst0, length)
bcopy(const void *src0, void *dst0, size_t length)
#endif
#endif
void *dst0;
const void *src0;
register size_t length;
{
register char *dst = dst0;
register const char *src = src0;
register size_t t;
char *dst = dst0;
const char *src = src0;
size_t t;
if (length == 0 || dst == src) /* nothing to do */
goto done;


+ 10
- 17
src/lib/libc/string/bm.c View File

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: bm.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: bm.c,v 1.5 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -85,14 +85,11 @@ static u_char const freq_def[256] = {
};
bm_pat *
bm_comp(pb, len, freq)
u_char const *pb;
size_t len;
u_char const *freq;
bm_comp(u_char const *pb, size_t len, u_char const *freq)
{
register u_char const *pe, *p;
register size_t *d, r;
register int j;
u_char const *pe, *p;
size_t *d, r;
int j;
int sv_errno;
bm_pat *pat;
@ -142,8 +139,7 @@ mem: sv_errno = errno;
}
void
bm_free(pat)
bm_pat *pat;
bm_free(bm_pat *pat)
{
if (pat->pat != NULL)
free(pat->pat);
@ -153,14 +149,11 @@ bm_free(pat)
}
u_char *
bm_exec(pat, base, n)
bm_pat *pat;
u_char *base;
size_t n;
bm_exec(bm_pat *pat, u_char *base, size_t n)
{
register u_char *e, *ep, *p, *q, *s;
register size_t *d0, k, md2, n1, ro;
register int rc;
u_char *e, *ep, *p, *q, *s;
size_t *d0, k, md2, n1, ro;
int rc;
if (n == 0)
return (NULL);


+ 6
- 10
src/lib/libc/string/memccpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memccpy.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */
/* $OpenBSD: memccpy.c,v 1.5 2005/03/30 20:13:52 otto Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -33,24 +33,20 @@
#if 0
static char sccsid[] = "@(#)memccpy.c 8.1 (Berkeley) 6/4/93";
#else
static char *rcsid = "$OpenBSD: memccpy.c,v 1.4 2003/06/02 20:18:38 millert Exp $";
static char *rcsid = "$OpenBSD: memccpy.c,v 1.5 2005/03/30 20:13:52 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
#include <string.h>
void *
memccpy(t, f, c, n)
void *t;
const void *f;
int c;
register size_t n;
memccpy(void *t, const void *f, int c, size_t n)
{
if (n) {
register unsigned char *tp = t;
register const unsigned char *fp = f;
register unsigned char uc = c;
unsigned char *tp = t;
const unsigned char *fp = f;
unsigned char uc = c;
do {
if ((*tp++ = *fp++) == uc)
return (tp);


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

@ -1,4 +1,4 @@
/* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ */
/* $OpenBSD: strlcat.c,v 1.12 2005/03/30 20:13:52 otto 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.11 2003/06/17 21:56:24 millert Exp $";
static char *rcsid = "$OpenBSD: strlcat.c,v 1.12 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#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
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 */


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

@ -1,4 +1,4 @@
/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */
/* $OpenBSD: strlcpy.c,v 1.9 2005/03/30 20:13:52 otto 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.8 2003/06/17 21:56:24 millert Exp $";
static char *rcsid = "$OpenBSD: strlcpy.c,v 1.9 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#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
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) {


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

@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
static char *rcsid = "$OpenBSD: swab.c,v 1.6 2005/03/30 20:13:52 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
@ -39,9 +39,9 @@ static char *rcsid = "$OpenBSD: swab.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
void
swab(const void *from, void *to, size_t len)
{
register unsigned long temp;
register int n;
register char *fp, *tp;
unsigned long temp;
int n;
char *fp, *tp;
n = (len >> 1) + 1;
fp = (char *)from;


Loading…
Cancel
Save