sprinkle in _DIAGASSERT() as appropriate

This commit is contained in:
lukem 2001-01-03 14:29:36 +00:00
parent 0c55b7011c
commit 5ba790cb50
19 changed files with 112 additions and 40 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -44,6 +45,9 @@ wcscat(s1, s2)
wchar_t *q;
const wchar_t *r;
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
p = s1;
while (*p)
p++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -42,6 +43,8 @@ wcschr(s, c)
{
const wchar_t *p;
_DIAGASSERT(s != NULL);
p = s;
while (*p) {
if (*p == c) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcscmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcscmp.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcscmp.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
int
@ -40,6 +41,9 @@ wcscmp(s1, s2)
const wchar_t *s1;
const wchar_t *s2;
{
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
while (*s1 == *s2 && *s1) {
s1++;
s2++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -43,6 +44,9 @@ wcscpy(s1, s2)
wchar_t *p;
const wchar_t *q;
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
*s1 = '\0';
p = s1;
q = s2;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
size_t
@ -43,6 +44,9 @@ wcscspn(s, set)
const wchar_t *p;
const wchar_t *q;
_DIAGASSERT(s != NULL);
_DIAGASSERT(set != NULL);
p = s;
while (*p) {
q = set;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
size_t
@ -41,6 +42,8 @@ wcslen(s)
{
const wchar_t *p;
_DIAGASSERT(s != NULL);
p = s;
while (*p)
p++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -45,6 +46,9 @@ wcsncat(s1, s2, n)
wchar_t *q;
const wchar_t *r;
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
p = s1;
while (*p)
p++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsncmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcsncmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsncmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcsncmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
int
@ -41,6 +42,9 @@ wcsncmp(s1, s2, n)
const wchar_t *s2;
size_t n;
{
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
while (n && *s1 == *s2 && *s1) {
s1++;
s2++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsncpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
/* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsncpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
__RCSID("$NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -44,6 +45,9 @@ wcsncpy(s1, s2, n)
wchar_t *p;
const wchar_t *q;
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
*s1 = '\0';
p = s1;
q = s2;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -43,6 +44,9 @@ wcspbrk(s, set)
const wchar_t *p;
const wchar_t *q;
_DIAGASSERT(s != NULL);
_DIAGASSERT(set != NULL);
p = s;
while (*p) {
q = set;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -42,6 +43,8 @@ wcsrchr(s, c)
{
const wchar_t *p;
_DIAGASSERT(s != NULL);
p = s;
while (*p)
p++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wcsspn.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wcsspn.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
size_t
@ -43,6 +44,9 @@ wcsspn(s, set)
const wchar_t *p;
const wchar_t *q;
_DIAGASSERT(s != NULL);
_DIAGASSERT(set != NULL);
p = s;
while (*p) {
q = set;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wcsstr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wcsstr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -44,6 +45,9 @@ wcsstr(big, little)
const wchar_t *q;
const wchar_t *r;
_DIAGASSERT(big != NULL);
_DIAGASSERT(little != NULL);
if (!*little) {
/* LINTED interface specification */
return (wchar_t *)big;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wcswidth.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcswidth.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
int
@ -42,6 +43,8 @@ wcswidth(s, n)
{
int w;
_DIAGASSERT(s != NULL);
w = 0;
while (n && *s) {
w += wcwidth(*s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -43,6 +44,8 @@ wmemchr(s, c, n)
{
size_t i;
_DIAGASSERT(s != NULL);
for (i = 0; i < n; i++) {
if (*s == c) {
/* LINTED const castaway */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wmemcmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wmemcmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
int
@ -43,6 +44,9 @@ wmemcmp(s1, s2, n)
{
size_t i;
_DIAGASSERT(s1 != NULL);
_DIAGASSERT(s2 != NULL);
for (i = 0; i < n; i++) {
if (*s1 != *s2) {
/* wchar might be unsigned */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,11 +30,12 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <wchar.h>
#include <assert.h>
#include <string.h>
#include <wchar.h>
wchar_t *
wmemcpy(d, s, n)
@ -42,5 +43,9 @@ wmemcpy(d, s, n)
const wchar_t *s;
size_t n;
{
_DIAGASSERT(d != NULL);
_DIAGASSERT(s != NULL);
return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,11 +30,12 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <wchar.h>
#include <assert.h>
#include <string.h>
#include <wchar.h>
wchar_t *
wmemmove(d, s, n)
@ -42,5 +43,9 @@ wmemmove(d, s, n)
const wchar_t *s;
size_t n;
{
_DIAGASSERT(d != NULL);
_DIAGASSERT(s != NULL);
return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
/* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@ -30,9 +30,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $");
__RCSID("$NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
wchar_t *
@ -44,6 +45,8 @@ wmemset(s, c, n)
size_t i;
wchar_t *p;
_DIAGASSERT(s != NULL);
p = (wchar_t *)s;
for (i = 0; i < n; i++) {
*p = c;