use assert() instead of _DIAGASSERT()
suggested by emax@freebsd
This commit is contained in:
parent
3bb03fc676
commit
02f520acc7
|
@ -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 @@ 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)
|
||||
|
|
|
@ -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 @@ 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);
|
||||
|
|
|
@ -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 @@ 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;
|
||||
|
|
|
@ -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_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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue