From 9e5b556fca33c71510d927a841149a3c5678dda7 Mon Sep 17 00:00:00 2001 From: espie <> Date: Sun, 19 Jun 2005 22:12:07 +0000 Subject: [PATCH] K&R -> ANSI APIWARN okay millert@, otto@ --- src/lib/libc/string/wcscat.c | 13 ++++++++----- src/lib/libc/string/wcschr.c | 8 +++----- src/lib/libc/string/wcscmp.c | 7 +++---- src/lib/libc/string/wcscpy.c | 13 ++++++++----- src/lib/libc/string/wcscspn.c | 8 +++----- src/lib/libc/string/wcslcat.c | 9 +++------ src/lib/libc/string/wcslcpy.c | 9 +++------ src/lib/libc/string/wcslen.c | 7 +++---- src/lib/libc/string/wcsncat.c | 9 +++------ src/lib/libc/string/wcsncmp.c | 8 +++----- src/lib/libc/string/wcsncpy.c | 9 +++------ src/lib/libc/string/wcspbrk.c | 8 +++----- src/lib/libc/string/wcsrchr.c | 8 +++----- src/lib/libc/string/wcsspn.c | 8 +++----- src/lib/libc/string/wcsstr.c | 10 ++++------ src/lib/libc/string/wcstok.c | 10 ++++------ src/lib/libc/string/wcswidth.c | 8 +++----- src/lib/libc/string/wmemchr.c | 9 +++------ src/lib/libc/string/wmemcmp.c | 9 +++------ src/lib/libc/string/wmemcpy.c | 9 +++------ src/lib/libc/string/wmemmove.c | 9 +++------ src/lib/libc/string/wmemset.c | 11 ++++------- 22 files changed, 79 insertions(+), 120 deletions(-) diff --git a/src/lib/libc/string/wcscat.c b/src/lib/libc/string/wcscat.c index 69c8c0c2..80de3f0d 100644 --- a/src/lib/libc/string/wcscat.c +++ b/src/lib/libc/string/wcscat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcscat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcscat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,15 +30,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcscat.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcscat.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include +#if defined(APIWARN) +__warn_references(wcscat, + "warning: wcscat() is almost always misused, please use wcslcat()"); +#endif + wchar_t * -wcscat(s1, s2) - wchar_t *s1; - const wchar_t *s2; +wcscat(wchar_t *s1, const wchar_t *s2) { wchar_t *p; wchar_t *q; diff --git a/src/lib/libc/string/wcschr.c b/src/lib/libc/string/wcschr.c index eb4e65a8..80861225 100644 --- a/src/lib/libc/string/wcschr.c +++ b/src/lib/libc/string/wcschr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcschr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcschr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcschr.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcschr.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcschr(s, c) - const wchar_t *s; - wchar_t c; +wcschr(const wchar_t *s, wchar_t c) { const wchar_t *p; diff --git a/src/lib/libc/string/wcscmp.c b/src/lib/libc/string/wcscmp.c index 0f0dc0ef..d8a9aa73 100644 --- a/src/lib/libc/string/wcscmp.c +++ b/src/lib/libc/string/wcscmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /*- @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; * Compare strings. */ int -wcscmp(s1, s2) - const wchar_t *s1, *s2; +wcscmp(const wchar_t *s1, const wchar_t *s2) { while (*s1 == *s2++) diff --git a/src/lib/libc/string/wcscpy.c b/src/lib/libc/string/wcscpy.c index 266ea4a3..e5bf8b0d 100644 --- a/src/lib/libc/string/wcscpy.c +++ b/src/lib/libc/string/wcscpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcscpy.c,v 1.2 2005/04/16 10:40:45 tom Exp $ */ +/* $OpenBSD: wcscpy.c,v 1.3 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,15 +30,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcscpy.c,v 1.2 2005/04/16 10:40:45 tom Exp $"; +static char *rcsid = "$OpenBSD: wcscpy.c,v 1.3 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include +#if defined(APIWARN) +__warn_references(wcscpy, + "warning: wcscpy() is almost always misused, please use wcslcpy()"); +#endif + wchar_t * -wcscpy(s1, s2) - wchar_t *s1; - const wchar_t *s2; +wcscpy(wchar_t *s1, const wchar_t *s2) { wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcscspn.c b/src/lib/libc/string/wcscspn.c index 905c9376..59a95101 100644 --- a/src/lib/libc/string/wcscspn.c +++ b/src/lib/libc/string/wcscspn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcscspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcscspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcscspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcscspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include size_t -wcscspn(s, set) - const wchar_t *s; - const wchar_t *set; +wcscspn(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcslcat.c b/src/lib/libc/string/wcslcat.c index 266d012a..e74d52f4 100644 --- a/src/lib/libc/string/wcslcat.c +++ b/src/lib/libc/string/wcslcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcslcat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcslcat.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */ /* from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp */ @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcslcat.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -44,10 +44,7 @@ static char *rcsid = "$OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $" * truncation occurred. */ size_t -wcslcat(dst, src, siz) - wchar_t *dst; - const wchar_t *src; - size_t siz; +wcslcat(wchar_t *dst, const wchar_t *src, size_t siz) { wchar_t *d = dst; const wchar_t *s = src; diff --git a/src/lib/libc/string/wcslcpy.c b/src/lib/libc/string/wcslcpy.c index 101161e9..a6acb80d 100644 --- a/src/lib/libc/string/wcslcpy.c +++ b/src/lib/libc/string/wcslcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcslcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcslcpy.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */ /* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */ @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -42,10 +42,7 @@ static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $" * Returns wcslen(src); if retval >= siz, truncation occurred. */ size_t -wcslcpy(dst, src, siz) - wchar_t *dst; - const wchar_t *src; - size_t siz; +wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz) { wchar_t *d = dst; const wchar_t *s = src; diff --git a/src/lib/libc/string/wcslen.c b/src/lib/libc/string/wcslen.c index 6d1c5e5f..8bd5b5d0 100644 --- a/src/lib/libc/string/wcslen.c +++ b/src/lib/libc/string/wcslen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcslen.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcslen.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,14 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcslen.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcslen.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include size_t -wcslen(s) - const wchar_t *s; +wcslen(const wchar_t *s) { const wchar_t *p; diff --git a/src/lib/libc/string/wcsncat.c b/src/lib/libc/string/wcsncat.c index 984ef4ca..b8e000c8 100644 --- a/src/lib/libc/string/wcsncat.c +++ b/src/lib/libc/string/wcsncat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsncat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsncat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- @@ -30,16 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsncat.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsncat.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcsncat(s1, s2, n) - wchar_t *s1; - const wchar_t *s2; - size_t n; +wcsncat(wchar_t *s1, const wchar_t *s2, size_t n) { wchar_t *p; wchar_t *q; diff --git a/src/lib/libc/string/wcsncmp.c b/src/lib/libc/string/wcsncmp.c index e89b7914..aaa96b97 100644 --- a/src/lib/libc/string/wcsncmp.c +++ b/src/lib/libc/string/wcsncmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsncmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /* @@ -31,16 +31,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include "locale/runetype.h" int -wcsncmp(s1, s2, n) - const wchar_t *s1, *s2; - size_t n; +wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) { if (n == 0) diff --git a/src/lib/libc/string/wcsncpy.c b/src/lib/libc/string/wcsncpy.c index aa7bf959..2bf020e2 100644 --- a/src/lib/libc/string/wcsncpy.c +++ b/src/lib/libc/string/wcsncpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsncpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsncpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,16 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsncpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsncpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcsncpy(s1, s2, n) - wchar_t *s1; - const wchar_t *s2; - size_t n; +wcsncpy(wchar_t *s1, const wchar_t *s2, size_t n) { wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcspbrk.c b/src/lib/libc/string/wcspbrk.c index aeaac6ce..943057a2 100644 --- a/src/lib/libc/string/wcspbrk.c +++ b/src/lib/libc/string/wcspbrk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcspbrk.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcspbrk.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcspbrk.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcspbrk.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcspbrk(s, set) - const wchar_t *s; - const wchar_t *set; +wcspbrk(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcsrchr.c b/src/lib/libc/string/wcsrchr.c index d0cd8aeb..ced0fe3a 100644 --- a/src/lib/libc/string/wcsrchr.c +++ b/src/lib/libc/string/wcsrchr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsrchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsrchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsrchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsrchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcsrchr(s, c) - const wchar_t *s; - wchar_t c; +wcsrchr(const wchar_t *s, wchar_t c) { const wchar_t *p; diff --git a/src/lib/libc/string/wcsspn.c b/src/lib/libc/string/wcsspn.c index 52b22e3d..80f315f0 100644 --- a/src/lib/libc/string/wcsspn.c +++ b/src/lib/libc/string/wcsspn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include size_t -wcsspn(s, set) - const wchar_t *s; - const wchar_t *set; +wcsspn(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcsstr.c b/src/lib/libc/string/wcsstr.c index 992b5cab..9f330300 100644 --- a/src/lib/libc/string/wcsstr.c +++ b/src/lib/libc/string/wcsstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsstr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcsstr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcsstr.c,v 1.3 2003/03/05 20:18:17 tshiozak Exp $ */ /*- @@ -30,19 +30,17 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsstr.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsstr.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * #ifdef WCSWCS -wcswcs(big, little) +wcswcs(const wchar_t *big, const wchar_t *little) #else -wcsstr(big, little) +wcsstr(const wchar_t *big, const wchar_t *little) #endif - const wchar_t *big; - const wchar_t *little; { const wchar_t *p; const wchar_t *q; diff --git a/src/lib/libc/string/wcstok.c b/src/lib/libc/string/wcstok.c index 1b0790fd..619aea8a 100644 --- a/src/lib/libc/string/wcstok.c +++ b/src/lib/libc/string/wcstok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcstok.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcstok.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcstok.c,v 1.3 2003/07/10 08:50:48 tshiozak Exp $ */ /*- @@ -43,16 +43,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcstok.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcstok.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wcstok(s, delim, last) - wchar_t * __restrict s; - const wchar_t * __restrict delim; - wchar_t ** __restrict last; +wcstok(wchar_t * __restrict s, const wchar_t * __restrict delim, + wchar_t ** __restrict last) { const wchar_t *spanp; wchar_t c, sc; diff --git a/src/lib/libc/string/wcswidth.c b/src/lib/libc/string/wcswidth.c index c55d9ae7..ff6b4e1d 100644 --- a/src/lib/libc/string/wcswidth.c +++ b/src/lib/libc/string/wcswidth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcswidth.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wcswidth.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,15 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcswidth.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wcswidth.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include int -wcswidth(s, n) - const wchar_t *s; - size_t n; +wcswidth(const wchar_t *s, size_t n) { int w; diff --git a/src/lib/libc/string/wmemchr.c b/src/lib/libc/string/wmemchr.c index 0e502058..f3b8023c 100644 --- a/src/lib/libc/string/wmemchr.c +++ b/src/lib/libc/string/wmemchr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wmemchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,16 +30,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wmemchr(s, c, n) - const wchar_t *s; - wchar_t c; - size_t n; +wmemchr(const wchar_t *s, wchar_t c, size_t n) { size_t i; diff --git a/src/lib/libc/string/wmemcmp.c b/src/lib/libc/string/wmemcmp.c index 4792a3b4..fc021c11 100644 --- a/src/lib/libc/string/wmemcmp.c +++ b/src/lib/libc/string/wmemcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemcmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */ /*- @@ -30,17 +30,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include "locale/runetype.h" int -wmemcmp(s1, s2, n) - const wchar_t *s1; - const wchar_t *s2; - size_t n; +wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n) { size_t i; diff --git a/src/lib/libc/string/wmemcpy.c b/src/lib/libc/string/wmemcpy.c index 628795ce..6e7e0304 100644 --- a/src/lib/libc/string/wmemcpy.c +++ b/src/lib/libc/string/wmemcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wmemcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,17 +30,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include wchar_t * -wmemcpy(d, s, n) - wchar_t *d; - const wchar_t *s; - size_t n; +wmemcpy(wchar_t *d, const wchar_t *s, size_t n) { return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t)); diff --git a/src/lib/libc/string/wmemmove.c b/src/lib/libc/string/wmemmove.c index e5a0a1fe..5de24306 100644 --- a/src/lib/libc/string/wmemmove.c +++ b/src/lib/libc/string/wmemmove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemmove.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wmemmove.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,17 +30,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemmove.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemmove.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include wchar_t * -wmemmove(d, s, n) - wchar_t *d; - const wchar_t *s; - size_t n; +wmemmove(wchar_t *d, const wchar_t *s, size_t n) { return (wchar_t *)memmove(d, s, n * sizeof(wchar_t)); diff --git a/src/lib/libc/string/wmemset.c b/src/lib/libc/string/wmemset.c index abcbe44c..9db63f05 100644 --- a/src/lib/libc/string/wmemset.c +++ b/src/lib/libc/string/wmemset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemset.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */ +/* $OpenBSD: wmemset.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ /* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- @@ -30,21 +30,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemset.c,v 1.1 2005/04/13 16:35:58 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemset.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include wchar_t * -wmemset(s, c, n) - wchar_t *s; - wchar_t c; - size_t n; +wmemset(wchar_t *s, wchar_t c, size_t n) { size_t i; wchar_t *p; - p = (wchar_t *)s; + p = s; for (i = 0; i < n; i++) { *p = c; p++;