From 02f520acc7e0811cc2b77eb4be217c4c8625187f Mon Sep 17 00:00:00 2001 From: plunky Date: Sat, 2 May 2009 20:07:51 +0000 Subject: [PATCH] use assert() instead of _DIAGASSERT() suggested by emax@freebsd --- usr.sbin/btpand/bnep.c | 6 +++--- usr.sbin/btpand/channel.c | 18 +++++++++--------- usr.sbin/btpand/packet.c | 8 ++++---- usr.sbin/btpand/tap.c | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/usr.sbin/btpand/bnep.c b/usr.sbin/btpand/bnep.c index cd7cada3a79f..b3ffa8ba4d03 100644 --- a/usr.sbin/btpand/bnep.c +++ b/usr.sbin/btpand/bnep.c @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.3 2009/02/04 19:24:18 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include -__RCSID("$NetBSD: bnep.c,v 1.3 2009/02/04 19:24:18 plunky Exp $"); +__RCSID("$NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $"); #include #include @@ -575,7 +575,7 @@ bnep_send_control(channel_t *chan, uint8_t type, ...) uint8_t *p; va_list ap; - _DIAGASSERT(chan->state != CHANNEL_CLOSED); + assert(chan->state != CHANNEL_CLOSED); pkt = packet_alloc(chan); if (pkt == NULL) diff --git a/usr.sbin/btpand/channel.c b/usr.sbin/btpand/channel.c index 872b2c5e479c..c4141f1ba6d9 100644 --- a/usr.sbin/btpand/channel.c +++ b/usr.sbin/btpand/channel.c @@ -1,4 +1,4 @@ -/* $NetBSD: channel.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ +/* $NetBSD: channel.c,v 1.2 2009/05/02 20:07:51 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include -__RCSID("$NetBSD: channel.c,v 1.1 2008/08/17 13:20:57 plunky Exp $"); +__RCSID("$NetBSD: channel.c,v 1.2 2009/05/02 20:07:51 plunky Exp $"); #include @@ -76,8 +76,8 @@ channel_open(channel_t *chan, int fd) { int n; - _DIAGASSERT(chan->refcnt == 0); - _DIAGASSERT(chan->state != CHANNEL_CLOSED); + assert(chan->refcnt == 0); + assert(chan->state != CHANNEL_CLOSED); if (chan->mtu > 0) { chan->sendbuf = malloc(chan->mtu); @@ -114,7 +114,7 @@ channel_close(channel_t *chan) { pkthdr_t *ph; - _DIAGASSERT(chan->state != CHANNEL_CLOSED); + assert(chan->state != CHANNEL_CLOSED); log_debug("(fd#%d)", chan->fd); @@ -139,10 +139,10 @@ void channel_free(channel_t *chan) { - _DIAGASSERT(chan->refcnt == 0); - _DIAGASSERT(chan->state == CHANNEL_CLOSED); - _DIAGASSERT(chan->qlen == 0); - _DIAGASSERT(STAILQ_EMPTY(&chan->pktlist)); + assert(chan->refcnt == 0); + assert(chan->state == CHANNEL_CLOSED); + assert(chan->qlen == 0); + assert(STAILQ_EMPTY(&chan->pktlist)); LIST_REMOVE(chan, next); free(chan->pfilter); diff --git a/usr.sbin/btpand/packet.c b/usr.sbin/btpand/packet.c index 0385ea3ca3e3..c10b80f85441 100644 --- a/usr.sbin/btpand/packet.c +++ b/usr.sbin/btpand/packet.c @@ -1,4 +1,4 @@ -/* $NetBSD: packet.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ +/* $NetBSD: packet.c,v 1.2 2009/05/02 20:07:51 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include -__RCSID("$NetBSD: packet.c,v 1.1 2008/08/17 13:20:57 plunky Exp $"); +__RCSID("$NetBSD: packet.c,v 1.2 2009/05/02 20:07:51 plunky Exp $"); #include "btpand.h" @@ -75,8 +75,8 @@ void packet_adj(packet_t *pkt, size_t size) { - _DIAGASSERT(pkt->refcnt == 0); - _DIAGASSERT(pkt->len >= size); + assert(pkt->refcnt == 0); + assert(pkt->len >= size); pkt->ptr += size; pkt->len -= size; diff --git a/usr.sbin/btpand/tap.c b/usr.sbin/btpand/tap.c index 68d444204ef9..85b5000b1e5e 100644 --- a/usr.sbin/btpand/tap.c +++ b/usr.sbin/btpand/tap.c @@ -1,4 +1,4 @@ -/* $NetBSD: tap.c,v 1.2 2009/03/10 22:12:17 plunky Exp $ */ +/* $NetBSD: tap.c,v 1.3 2009/05/02 20:07:51 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include -__RCSID("$NetBSD: tap.c,v 1.2 2009/03/10 22:12:17 plunky Exp $"); +__RCSID("$NetBSD: tap.c,v 1.3 2009/05/02 20:07:51 plunky Exp $"); #include #include @@ -138,7 +138,7 @@ tap_send(channel_t *chan, packet_t *pkt) /* tap device write never fails */ nw = writev(chan->fd, iov, __arraycount(iov)); - _DIAGASSERT(nw > 0); + assert(nw > 0); return true; }