Module Name:    src
Committed By:   plunky
Date:           Sat May  2 20:07:52 UTC 2009

Modified Files:
        src/usr.sbin/btpand: bnep.c channel.c packet.c tap.c

Log Message:
use assert() instead of _DIAGASSERT()

suggested by e...@freebsd


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/btpand/bnep.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/btpand/channel.c \
    src/usr.sbin/btpand/packet.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/btpand/tap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/btpand/bnep.c
diff -u src/usr.sbin/btpand/bnep.c:1.3 src/usr.sbin/btpand/bnep.c:1.4
--- src/usr.sbin/btpand/bnep.c:1.3	Wed Feb  4 19:24:18 2009
+++ src/usr.sbin/btpand/bnep.c	Sat May  2 20:07:51 2009
@@ -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)

Index: src/usr.sbin/btpand/channel.c
diff -u src/usr.sbin/btpand/channel.c:1.1 src/usr.sbin/btpand/channel.c:1.2
--- src/usr.sbin/btpand/channel.c:1.1	Sun Aug 17 13:20:57 2008
+++ src/usr.sbin/btpand/channel.c	Sat May  2 20:07:51 2009
@@ -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);
Index: src/usr.sbin/btpand/packet.c
diff -u src/usr.sbin/btpand/packet.c:1.1 src/usr.sbin/btpand/packet.c:1.2
--- src/usr.sbin/btpand/packet.c:1.1	Sun Aug 17 13:20:57 2008
+++ src/usr.sbin/btpand/packet.c	Sat May  2 20:07:51 2009
@@ -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;

Index: src/usr.sbin/btpand/tap.c
diff -u src/usr.sbin/btpand/tap.c:1.2 src/usr.sbin/btpand/tap.c:1.3
--- src/usr.sbin/btpand/tap.c:1.2	Tue Mar 10 22:12:17 2009
+++ src/usr.sbin/btpand/tap.c	Sat May  2 20:07:51 2009
@@ -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;
 }

Reply via email to