Sat May 2 20:07:52 2009 UTC ()
use assert() instead of _DIAGASSERT()

suggested by emax@freebsd


(plunky)
diff -r1.3 -r1.4 src/usr.sbin/btpand/bnep.c
diff -r1.1 -r1.2 src/usr.sbin/btpand/channel.c
diff -r1.1 -r1.2 src/usr.sbin/btpand/packet.c
diff -r1.2 -r1.3 src/usr.sbin/btpand/tap.c

cvs diff -r1.3 -r1.4 src/usr.sbin/btpand/bnep.c (expand / switch to context diff)
--- src/usr.sbin/btpand/bnep.c 2009/02/04 19:24:18 1.3
+++ src/usr.sbin/btpand/bnep.c 2009/05/02 20:07:51 1.4
@@ -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 <sys/cdefs.h>
-__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 <bluetooth.h>
 #include <sdp.h>
@@ -575,7 +575,7 @@
 	uint8_t *p;
 	va_list ap;
 
-	_DIAGASSERT(chan->state != CHANNEL_CLOSED);
+	assert(chan->state != CHANNEL_CLOSED);
 
 	pkt = packet_alloc(chan);
 	if (pkt == NULL)

cvs diff -r1.1 -r1.2 src/usr.sbin/btpand/channel.c (expand / switch to context diff)
--- src/usr.sbin/btpand/channel.c 2008/08/17 13:20:57 1.1
+++ src/usr.sbin/btpand/channel.c 2009/05/02 20:07:51 1.2
@@ -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 <sys/cdefs.h>
-__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 <sys/ioctl.h>
 
@@ -76,8 +76,8 @@
 {
 	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 @@
 {
 	pkthdr_t *ph;
 
-	_DIAGASSERT(chan->state != CHANNEL_CLOSED);
+	assert(chan->state != CHANNEL_CLOSED);
 
 	log_debug("(fd#%d)", chan->fd);
 
@@ -139,10 +139,10 @@
 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);

cvs diff -r1.1 -r1.2 src/usr.sbin/btpand/packet.c (expand / switch to context diff)
--- src/usr.sbin/btpand/packet.c 2008/08/17 13:20:57 1.1
+++ src/usr.sbin/btpand/packet.c 2009/05/02 20:07:51 1.2
@@ -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 <sys/cdefs.h>
-__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 @@
 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;

cvs diff -r1.2 -r1.3 src/usr.sbin/btpand/tap.c (expand / switch to context diff)
--- src/usr.sbin/btpand/tap.c 2009/03/10 22:12:17 1.2
+++ src/usr.sbin/btpand/tap.c 2009/05/02 20:07:51 1.3
@@ -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 <sys/cdefs.h>
-__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 <sys/ioctl.h>
 #include <sys/uio.h>
@@ -138,7 +138,7 @@
 
 	/* tap device write never fails */
 	nw = writev(chan->fd, iov, __arraycount(iov));
-	_DIAGASSERT(nw > 0);
+	assert(nw > 0);
 
 	return true;
 }