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).
This commit is contained in:
Robert Watson 2004-03-22 03:57:01 +00:00
parent fd5bc0548f
commit f2aa178725
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127291
6 changed files with 14 additions and 13 deletions

View File

@ -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,

View File

@ -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

View File

@ -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;

View File

@ -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))) {

View File

@ -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;

View File

@ -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);