summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-22 03:57:01 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-22 03:57:01 +0000
commitc4f5b78e26d643d33a8a2470ef30cca375d588ff (patch)
treecb15c972ff0a24f442086521fc33195b4c54b2a7
parent49f091a5297c61274524ffca40f10b93b1f4c56d (diff)
downloadFreeBSD-src-c4f5b78e26d643d33a8a2470ef30cca375d588ff.zip
FreeBSD-src-c4f5b78e26d643d33a8a2470ef30cca375d588ff.tar.gz
Compare pointers with NULL rather than 0, or treating them as boolans in
if statements. at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be unused).
-rw-r--r--sys/netatalk/aarp.c10
-rw-r--r--sys/netatalk/at_control.c4
-rw-r--r--sys/netatalk/at_rmx.c3
-rw-r--r--sys/netatalk/ddp_input.c4
-rw-r--r--sys/netatalk/ddp_pcb.c2
-rw-r--r--sys/netatalk/ddp_usrreq.c4
6 files changed, 14 insertions, 13 deletions
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index b789d3a..18b47e7 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -39,7 +39,7 @@ static struct aarptab aarptab[AARPTAB_SIZE];
#define AARPTAB_HASH(a) \
((((a).s_net << 8) + (a).s_node) % AARPTAB_NB)
-#define AARPTAB_LOOK(aat,addr) { \
+#define AARPTAB_LOOK(aat, addr) { \
int n; \
aat = &aarptab[ AARPTAB_HASH(addr) * AARPTAB_BSIZ ]; \
for (n = 0; n < AARPTAB_BSIZ; n++, aat++) \
@@ -47,7 +47,7 @@ static struct aarptab aarptab[AARPTAB_SIZE];
aat->aat_ataddr.s_node == (addr).s_node) \
break; \
if (n >= AARPTAB_BSIZ) \
- aat = 0; \
+ aat = NULL; \
}
#define AARPT_AGE (60 * 1)
@@ -233,9 +233,9 @@ aarpresolve(ac, m, destsat, desten)
s = splimp();
AARPTAB_LOOK(aat, destsat->sat_addr);
- if (aat == 0) { /* No entry */
+ if (aat == NULL) { /* No entry */
aat = aarptnew(&destsat->sat_addr);
- if (aat == 0) {
+ if (aat == NULL) {
panic("aarpresolve: no free entry");
}
aat->aat_hold = m;
@@ -391,7 +391,7 @@ at_aarpinput(struct arpcom *ac, struct mbuf *m)
}
AARPTAB_LOOK(aat, spa);
- if (aat) {
+ if (aat != NULL) {
if (op == AARPOP_PROBE) {
/*
* Someone's probing for spa, dealocate the one we've got,
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c
index 2a61d63..22dc1f2 100644
--- a/sys/netatalk/at_control.c
+++ b/sys/netatalk/at_control.c
@@ -56,7 +56,7 @@ at_control(struct socket *so, u_long cmd, caddr_t data,
/*
* If we have an ifp, then find the matching at_ifaddr if it exists
*/
- if (ifp) {
+ if (ifp != NULL) {
for (aa = at_ifaddr; aa; aa = aa->aa_next) {
if (aa->aa_ifp == ifp) break;
}
@@ -554,7 +554,7 @@ at_ifinit(ifp, aa, sat)
* Now that we have selected an address, we need to tell the interface
* about it, just in case it needs to adjust something.
*/
- if (ifp->if_ioctl &&
+ if (ifp->if_ioctl != NULL&&
(error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)aa))) {
/*
* of course this could mean that it objects violently
diff --git a/sys/netatalk/at_rmx.c b/sys/netatalk/at_rmx.c
index ca8db3a..ab03536 100644
--- a/sys/netatalk/at_rmx.c
+++ b/sys/netatalk/at_rmx.c
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*
* at_rmx.c,v 1.13 1995/05/30 08:09:31 rgrimes Exp
+ * $FreeBSD$
*/
/* This code generates debugging traces to the radix code */
@@ -47,7 +48,7 @@ prsockaddr(void *v)
char *bp = &hexbuf[0];
u_char *cp = v;
- if (v) {
+ if (v != NULL) {
int len = *cp;
u_char *cplim = cp + len;
diff --git a/sys/netatalk/ddp_input.c b/sys/netatalk/ddp_input.c
index 69a15ac..fe9f4d4 100644
--- a/sys/netatalk/ddp_input.c
+++ b/sys/netatalk/ddp_input.c
@@ -95,7 +95,7 @@ ddp_input(m, ifp, elh, phase)
bzero((caddr_t)&from, sizeof(struct sockaddr_at));
bzero((caddr_t)&to, sizeof(struct sockaddr_at));
- if (elh) {
+ if (elh != NULL) {
/*
* Extract the information in the short header.
* netowrk information is defaulted to ATADDR_ANYNET
@@ -345,7 +345,7 @@ ddp_input(m, ifp, elh, phase)
* We are no longer interested in the link layer.
* so cut it off.
*/
- if (elh) {
+ if (elh != NULL) {
m_adj(m, sizeof(struct ddpshdr));
} else {
if (ddp_cksum && cksum && cksum != at_cksum(m, sizeof(int))) {
diff --git a/sys/netatalk/ddp_pcb.c b/sys/netatalk/ddp_pcb.c
index 4ee48d5..c4f7428 100644
--- a/sys/netatalk/ddp_pcb.c
+++ b/sys/netatalk/ddp_pcb.c
@@ -239,7 +239,7 @@ at_pcballoc(struct socket *so)
ddp->ddp_prev = NULL;
ddp->ddp_pprev = NULL;
ddp->ddp_pnext = NULL;
- if (ddpcb) {
+ if (ddpcb != NULL) {
ddpcb->ddp_prev = ddp;
}
ddpcb = ddp;
diff --git a/sys/netatalk/ddp_usrreq.c b/sys/netatalk/ddp_usrreq.c
index 490d907..b8f68aa 100644
--- a/sys/netatalk/ddp_usrreq.c
+++ b/sys/netatalk/ddp_usrreq.c
@@ -159,7 +159,7 @@ ddp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
return (EINVAL);
}
- if (addr) {
+ if (addr != NULL) {
if (ddp->ddp_fsat.sat_port != ATADDR_ANYPORT) {
return (EISCONN);
}
@@ -178,7 +178,7 @@ ddp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
s = splnet();
error = ddp_output(m, so);
- if (addr) {
+ if (addr != NULL) {
at_pcbdisconnect(ddp);
}
splx(s);
OpenPOWER on IntegriCloud