Replace all casts of NULL to something with NULL.
authorSascha Wildner <saw@online.de>
Mon, 6 Apr 2009 12:52:46 +0000 (14:52 +0200)
committerSascha Wildner <saw@online.de>
Tue, 7 Apr 2009 07:45:05 +0000 (09:45 +0200)
224 files changed:
bin/date/date.c
bin/dd/dd.c
bin/dd/misc.c
bin/expr/expr.y
bin/mv/mv.c
bin/pax/ar_io.c
bin/pax/gen_subs.c
bin/ps/ps.c
bin/rcp/util.c
bin/sh/eval.c
bin/sh/expand.c
bin/sh/jobs.c
bin/sh/parser.c
bin/sh/redir.c
bin/sleep/sleep.c
games/atc/input.c
games/bs/bs.c
games/cribbage/instr.c
games/hunt/hunt/hunt.c
games/hunt/huntd/driver.c
games/hunt/huntd/execute.c
games/hunt/huntd/shots.c
games/larn/tok.c
games/mille/mille.c
games/mille/move.c
games/mille/varpush.c
games/phantasia/misc.c
games/rain/rain.c
games/rogue/machdep.c
games/worms/worms.c
games/wump/wump.c
lib/libc/compat-43/getwd.c
lib/libc/db/hash/hash_page.c
lib/libc/gen/fstab.c
lib/libc/gen/wordexp.c
lib/libc/net/gethostbynis.c
lib/libc/net/getnetbynis.c
lib/libc/net/rcmdsh.c
lib/libc/rpc/auth_des.c
lib/libc/rpc/auth_time.c
lib/libc/rpc/clnt_dg.c
lib/libc/rpc/clnt_generic.c
lib/libc/rpc/clnt_vc.c
lib/libc/rpc/crypt_client.c
lib/libc/rpc/key_call.c
lib/libc/rpc/netname.c
lib/libc/rpc/rpc_generic.c
lib/libc/rpc/rpc_soc.c
lib/libc/rpc/rpcb_clnt.c
lib/libc/rpc/rtime.c
lib/libc/rpc/svc_auth_des.c
lib/libc/stdio/mktemp.c
lib/libc/stdio/setbuf.3
lib/libc/stdio/setbuffer.c
lib/libc/stdio/vfscanf.c
lib/libc/stdlib/atof.3
lib/libc/stdlib/atoi.3
lib/libc/stdlib/atoi.c
lib/libc/stdlib/atol.3
lib/libc/stdlib/atol.c
lib/libc/stdlib/system.c
lib/libc/stdtime/localtime.c
lib/libc_r/uthread/uthread_init.c
lib/libedit/filecomplete.c
lib/libedit/readline.c
lib/libposix1e/acl_to_text.3
lib/librpcsvc/rnusers.c
lib/librpcsvc/rwall.c
lib/libthread_xu/thread/thr_init.c
lib/libutil/login_tty.c
lib/libutil/pw_util.c
lib/libutil/uucplock.c
libexec/atrun/atrun.c
libexec/getty/main.c
libexec/getty/subr.c
libexec/pppoed/pppoed.c
libexec/rlogind/rlogind.c
libexec/rpc.rquotad/rquotad.c
libexec/rshd/rshd.c
sbin/adjkerntz/adjkerntz.c
sbin/atm/ilmid/ilmid.c
sbin/disklabel/disklabel.c
sbin/disklabel64/disklabel64.c
sbin/dump/tape.c
sbin/init/init.c
sbin/mountd/mountd.c
sbin/ping/ping.c
sbin/ping6/ping6.c
sbin/restore/symtab.c
sbin/restore/tape.c
sbin/route/route.c
sbin/shutdown/shutdown.c
share/examples/isdn/v21/v21modem.c
share/examples/scsi_target/scsi_target.c
share/examples/sunrpc/sort/rsort.c
share/examples/sunrpc/sort/sort_proc.c
share/man/man9/style.9
sys/bus/cam/scsi/scsi_sa.c
sys/dev/atm/hea/eni_receive.c
sys/dev/misc/psm/psm.c
sys/dev/netif/ie/if_ie.c
sys/dev/raid/asr/asr.c
sys/dev/raid/twa/twa_globals.c
sys/dev/serial/stl/stallion.c
sys/dev/serial/stli/istallion.c
sys/emulation/ndis/subr_ntoskrnl.c
sys/kern/inflate.c
sys/kern/subr_scanf.c
sys/kern/uipc_domain.c
sys/net/if.c
sys/net/if_clone.c
sys/netgraph7/bluetooth/socket/ng_btsocket_rfcomm.c
sys/netinet/if_atm.c
sys/netinet/in_pcb.c
sys/netinet/ip_divert.c
sys/netinet/ip_output.c
sys/netinet/sctp_indata.c
sys/netinet/sctp_input.c
sys/netinet/sctp_output.c
sys/netinet/sctp_pcb.c
sys/netinet/sctp_timer.c
sys/netinet/sctp_usrreq.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_timer.c
sys/netinet/tcp_usrreq.c
sys/netinet/udp_usrreq.c
sys/netinet6/frag6.c
sys/netinet6/icmp6.c
sys/netinet6/in6.c
sys/netinet6/in6_pcb.c
sys/netinet6/ip6_output.c
sys/netinet6/nd6_rtr.c
sys/netinet6/sctp6_usrreq.c
sys/netproto/atm/atm_if.c
sys/netproto/atm/queue.h
sys/netproto/atm/uni/unisig_if.c
sys/netproto/atm/uni/unisig_vc_state.c
sys/netproto/ipsec/key.c
sys/netproto/ipsec/xform_esp.c
sys/netproto/ipx/ipx.c
sys/netproto/ipx/ipx_ip.c
sys/netproto/ipx/ipx_pcb.c
sys/netproto/ipx/ipx_usrreq.c
sys/netproto/ipx/spx_usrreq.c
sys/netproto/key/key.c
sys/netproto/natm/natm.c
sys/netproto/ncp/ncp_sock.c
sys/netproto/ns/ns.c
sys/netproto/smb/smb_trantcp.c
sys/sys/socket.h
sys/vfs/ntfs/ntfs_subr.c
usr.bin/apply/apply.c
usr.bin/at/at.c
usr.bin/bc/bc.y
usr.bin/calendar/io.c
usr.bin/chat/chat.c
usr.bin/chpass/chpass.c
usr.bin/chpass/util.c
usr.bin/col/col.c
usr.bin/column/column.c
usr.bin/find/getdate.y
usr.bin/gcore/elfcore.c
usr.bin/getconf/getconf.c
usr.bin/hexdump/display.c
usr.bin/ldd/ldd.c
usr.bin/lock/lock.c
usr.bin/m4/gnum4.c
usr.bin/mail/aux.c
usr.bin/mail/cmd2.c
usr.bin/mail/collect.c
usr.bin/msgs/msgs.c
usr.bin/newgrp/newgrp.c
usr.bin/newkey/newkey.c
usr.bin/rdist/rshrcmd.c
usr.bin/rpcgen/rpc_main.c
usr.bin/rpcgen/rpc_sample.c
usr.bin/rpcgen/rpc_svcout.c
usr.bin/symorder/symorder.c
usr.bin/time/time.c
usr.bin/tr/tr.c
usr.bin/whereis/whereis.c
usr.bin/write/write.c
usr.bin/xinstall/xinstall.c
usr.sbin/IPXrouted/main.c
usr.sbin/apmd/apmd.c
usr.sbin/config/main.c
usr.sbin/cron/cron/cron.h
usr.sbin/cron/cron/job.c
usr.sbin/cron/lib/entry.c
usr.sbin/i4b/isdnd/log.c
usr.sbin/i4b/isdnd/main.c
usr.sbin/i4b/isdnd/process.c
usr.sbin/i4b/isdndecode/main.c
usr.sbin/i4b/isdntrace/trace.c
usr.sbin/inetd/builtins.c
usr.sbin/inetd/inetd.c
usr.sbin/keyserv/keyserv.c
usr.sbin/keyserv/setkey.c
usr.sbin/lpr/lpc/cmds.c
usr.sbin/mrouted/kern.c
usr.sbin/ngctl/main.c
usr.sbin/ppp/command.c
usr.sbin/pppd/auth.c
usr.sbin/pppd/main.c
usr.sbin/pwd_mkdb/pwd_mkdb.c
usr.sbin/resident/resident.c
usr.sbin/route6d/route6d.c
usr.sbin/rpc.lockd/lockd.c
usr.sbin/rpc.umntall/mounttab.c
usr.sbin/rpc.yppasswdd/yppasswdd_main.c
usr.sbin/rpc.ypupdated/ypupdated_main.c
usr.sbin/rpc.ypxfrd/ypxfrd_main.c
usr.sbin/rpcbind/rpcb_svc_com.c
usr.sbin/rpcbind/rpcbind.c
usr.sbin/rtsold/rtsold.c
usr.sbin/stallion/stlload/stlload.c
usr.sbin/syslogd/syslogd.c
usr.sbin/timed/timed/slave.c
usr.sbin/usbd/usbd.c
usr.sbin/vipw/vipw.c
usr.sbin/ypbind/yp_ping.c
usr.sbin/ypbind/ypbind.c
usr.sbin/ypserv/yp_main.c
usr.sbin/zic/ialloc.c

index 36ff3e9..5c04e73 100644 (file)
@@ -133,7 +133,7 @@ main(int argc, char **argv)
         * If -d or -t, set the timezone or daylight savings time; this
         * doesn't belong here; the kernel should not know about either.
         */
-       if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
+       if (set_timezone && settimeofday(NULL, &tz))
                err(1, "settimeofday (timezone)");
 
        if (!rflag && time(&tval) == -1)
@@ -273,7 +273,7 @@ setthetime(const char *fmt, const char *p, int jflag, int nflag)
                        logwtmp("|", "date", "");
                        tv.tv_sec = tval;
                        tv.tv_usec = 0;
-                       if (settimeofday(&tv, (struct timezone *)NULL))
+                       if (settimeofday(&tv, NULL))
                                err(1, "settimeofday (timeval)");
                        logwtmp("{", "date", "");
                }
index efb29ea..50ca08c 100644 (file)
@@ -189,7 +189,7 @@ setup(void)
                ctab = casetab;
        }
 
-       gettimeofday(&tv, (struct timezone *)NULL);
+       gettimeofday(&tv, NULL);
        st.start = tv.tv_sec + tv.tv_usec * 1e-6; 
 }
 
index ad94bdc..34c8728 100644 (file)
@@ -54,7 +54,7 @@ summary(void)
        double secs;
        char buf[100];
 
-       gettimeofday(&tv, (struct timezone *)NULL);
+       gettimeofday(&tv, NULL);
        secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start;
        if (secs < 1e-6)
                secs = 1e-6;
index 4807d9d..99b1851 100644 (file)
@@ -171,7 +171,7 @@ to_integer(struct val *vp)
 
        /* vp->type == numeric_string, make it numeric */
        errno = 0;
-       i  = strtoll(vp->u.s, (char**)NULL, 10);
+       i  = strtoll(vp->u.s, NULL, 10);
        if (errno != 0) {
                errx (2, "overflow");
        }
index 57dc6cd..de898e8 100644 (file)
@@ -355,7 +355,7 @@ copy(const char *from, const char *to)
 
        if ((pid = fork()) == 0) {
                execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to,
-                   (char *)NULL);
+                   NULL);
                warn("%s", _PATH_CP);
                _exit(1);
        }
@@ -373,7 +373,7 @@ copy(const char *from, const char *to)
                return (1);
        }
        if (!(pid = vfork())) {
-               execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL);
+               execl(_PATH_RM, "mv", "-rf", "--", from, NULL);
                warn("%s", _PATH_RM);
                _exit(1);
        }
index 7b0b9d8..c14a738 100644 (file)
@@ -1272,8 +1272,7 @@ ar_start_gzip(int fd, const char *gzip_program, int wr)
                }
                close(fds[0]);
                close(fds[1]);
-               if (execlp(gzip_program, gzip_program, gzip_flags,
-                   (char *)NULL) < 0)
+               if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0)
                        err(1, "could not exec");
                /* NOTREACHED */
        }
index 2a93a86..9943bec 100644 (file)
@@ -158,7 +158,7 @@ ls_tty(ARCHD *arcn)
        if (d_first < 0)
                d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
 
-       if ((arcn->sb.st_mtime + SIXMONTHS) <= time((time_t *)NULL))
+       if ((arcn->sb.st_mtime + SIXMONTHS) <= time(NULL))
                timefrmt = d_first ? OLDFRMTD : OLDFRMTM;
        else
                timefrmt = d_first ? CURFRMTD : CURFRMTM;
index 337b00e..82e3e63 100644 (file)
@@ -563,7 +563,7 @@ saveuser(KINFO *ki)
                ki->ki_args = NULL;
        }
        if (needenv) {
-               ki->ki_env = getfmt(kvm_getenvv, ki, (char *)NULL, 0);
+               ki->ki_env = getfmt(kvm_getenvv, ki, NULL, 0);
        } else {
                ki->ki_env = NULL;
        }
index 61d3d57..231c12b 100644 (file)
@@ -114,7 +114,7 @@ susystem(char *s, int userid)
 
        case 0:
                setuid(userid);
-               execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL);
+               execl(_PATH_BSHELL, "sh", "-c", s, NULL);
                _exit(127);
        }
        istat = signal(SIGINT, SIG_IGN);
index ae6a391..5759aa3 100644 (file)
@@ -266,7 +266,7 @@ evaltree(union node *n, int flags)
                do_etest = !(flags & EV_TESTED);
                break;
        case NCMD:
-               evalcommand(n, flags, (struct backcmd *)NULL);
+               evalcommand(n, flags, NULL);
                do_etest = !(flags & EV_TESTED);
                break;
        default:
@@ -406,7 +406,7 @@ evalsubshell(union node *n, int flags)
        }
        if (! backgnd) {
                INTOFF;
-               exitstatus = waitforjob(jp, (int *)NULL);
+               exitstatus = waitforjob(jp, NULL);
                INTON;
        }
 }
@@ -505,7 +505,7 @@ evalpipe(union node *n)
        INTON;
        if (n->npipe.backgnd == 0) {
                INTOFF;
-               exitstatus = waitforjob(jp, (int *)NULL);
+               exitstatus = waitforjob(jp, NULL);
                TRACE(("evalpipe:  job done exit status %d\n", exitstatus));
                INTON;
        }
index 8172c27..a397528 100644 (file)
@@ -133,7 +133,7 @@ void
 expandhere(union node *arg, int fd)
 {
        herefd = fd;
-       expandarg(arg, (struct arglist *)NULL, 0);
+       expandarg(arg, NULL, 0);
        xwrite(fd, stackblock(), expdest - stackblock());
 }
 
@@ -473,7 +473,7 @@ expbackq(union node *cmd, int quoted, int flag)
        if (in.buf)
                ckfree(in.buf);
        if (in.jp)
-               exitstatus = waitforjob(in.jp, (int *)NULL);
+               exitstatus = waitforjob(in.jp, NULL);
        if (quoted == 0)
                recordregion(startloc, dest - stackblock(), 0);
        TRACE(("evalbackq: size=%d: \"%.*s\"\n",
@@ -520,7 +520,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc,
        case VSQUESTION:
                if (*p != CTLENDVAR) {
                        outfmt(&errout, "%s\n", startp);
-                       error((char *)NULL);
+                       error(NULL);
                }
                error("%.*s: parameter %snot set", (int)(p - str - 1),
                      str, (varflags & VSNUL) ? "null or "
index bbd7e72..939ece5 100644 (file)
@@ -210,7 +210,7 @@ fgcmd(int argc __unused, char **argv)
        restartjob(jp);
        jp->foreground = 1;
        INTOFF;
-       status = waitforjob(jp, (int *)NULL);
+       status = waitforjob(jp, NULL);
        INTON;
        return status;
 }
@@ -400,7 +400,7 @@ showjobs(int change, int mode)
        struct job *jp;
 
        TRACE(("showjobs(%d) called\n", change));
-       while (dowait(0, (struct job *)NULL) > 0);
+       while (dowait(0, NULL) > 0);
        for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) {
                if (! jp->used)
                        continue;
@@ -491,7 +491,7 @@ waitcmd(int argc, char **argv)
                                        break;
                        }
                }
-       } while (dowait(1, (struct job *)NULL) != -1);
+       } while (dowait(1, NULL) != -1);
        in_waitcmd--;
 
        return 0;
@@ -1031,7 +1031,7 @@ waitproc(int block, int *status)
 #endif
        if (block == 0)
                flags |= WNOHANG;
-       return wait3(status, flags, (struct rusage *)NULL);
+       return wait3(status, flags, NULL);
 }
 
 /*
index 22a25d1..6648bf2 100644 (file)
@@ -848,7 +848,7 @@ xxreadtoken(void)
                }
        }
 breakloop:
-       return readtoken1(c, BASESYNTAX, (char *)NULL, 0);
+       return readtoken1(c, BASESYNTAX, NULL, 0);
 #undef RETURN
 }
 
@@ -1525,7 +1525,7 @@ synerror(const char *msg)
        if (commandname)
                outfmt(&errout, "%s: %d: ", commandname, startlinno);
        outfmt(&errout, "Syntax error: %s\n", msg);
-       error((char *)NULL);
+       error(NULL);
 }
 
 STATIC void
index fff61ad..e2a403b 100644 (file)
@@ -248,7 +248,7 @@ openhere(union node *redir)
                        goto out;
                }
        }
-       if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) {
+       if (forkshell(NULL, NULL, FORK_NOJOB) == 0) {
                close(pip[0]);
                signal(SIGINT, SIG_IGN);
                signal(SIGQUIT, SIG_IGN);
index e78886f..fcf51c5 100644 (file)
@@ -113,7 +113,7 @@ main(int argc, char **argv)
        }
 
        if (!neg && (time_to_sleep.tv_sec > 0 || time_to_sleep.tv_nsec > 0))
-               nanosleep(&time_to_sleep, (struct timespec *)NULL);
+               nanosleep(&time_to_sleep, NULL);
 
        exit(0);
 }
index e8a6f96..74fd13c 100644 (file)
@@ -364,10 +364,10 @@ gettoken(void)
                                                base = shell;
                                        else
                                                base++;
-                                       execl(shell, base, (char *) NULL);
+                                       execl(shell, base, NULL);
                                }
                                else
-                                       execl(_PATH_BSHELL, "sh", (char *) NULL);
+                                       execl(_PATH_BSHELL, "sh", NULL);
 
                                exit(0);        /* oops */
                        }
index 7d10c03..f4c3a6f 100644 (file)
@@ -400,7 +400,7 @@ initgame(void)
        placeship(COMPUTER, ss, FALSE);
     }
 
-    ss = (ship_t *)NULL;
+    ss = NULL;
     do {
        char c, docked[SHIPTYPES + 2], *cp = docked;
 
@@ -446,7 +446,7 @@ initgame(void)
            prompt(1, "Random-placing your %s", ss->name);
            randomplace(PLAYER, ss);
            placeship(PLAYER, ss, TRUE);
-           error((char *)NULL);
+           error(NULL);
            ss->placed = TRUE;
        }
        else if (c == 'R')
@@ -459,7 +459,7 @@ initgame(void)
                    placeship(PLAYER, ss, TRUE);
                    ss->placed = TRUE;
                }
-           error((char *)NULL);
+           error(NULL);
        }
        else if (strchr("hjkl8462", c))
        {
@@ -477,7 +477,7 @@ initgame(void)
            if (checkplace(PLAYER, ss, TRUE))
            {
                placeship(PLAYER, ss, TRUE);
-               error((char *)NULL);
+               error(NULL);
                ss->placed = TRUE;
            }
        }
@@ -699,12 +699,12 @@ hitship(int x, int y)
     getyx(stdscr, oldy, oldx);
     sb = (turn) ? plyship : cpuship;
     if(!(sym = board[OTHER][x][y]))
-       return((ship_t *)NULL);
+       return(NULL);
     for(ss = sb; ss < sb + SHIPTYPES; ++ss)
        if(ss->symbol == sym)
        {
            if (++ss->hits < ss->length) {      /* still afloat? */
-                       return((ship_t *)NULL);
+                       return(NULL);
            } else { /* sunk */
                int i, j;
 
@@ -755,7 +755,7 @@ hitship(int x, int y)
            }
        }
     move(oldy, oldx);
-    return((ship_t *)NULL);
+    return(NULL);
 }
 
 static int
index bb40f3f..39fe1b5 100644 (file)
@@ -70,7 +70,7 @@ instructions(void)
                if ((pager = rindex(path, '/')) != NULL)
                        ++pager;
                pager = path;
-               execlp(path, pager, _PATH_INSTR, (char *) NULL);
+               execlp(path, pager, _PATH_INSTR, NULL);
                fprintf(stderr, "cribbage: %s.\n", strerror(errno));
                _exit(1);
        default:
index 71a3431..54417d2 100644 (file)
@@ -258,7 +258,7 @@ main(int ac, char **av)
                if ((enter_status = quit(enter_status)) == Q_QUIT)
                        break;
        }
-       leave(0, (char *) NULL);
+       leave(0, NULL);
        /* NOTREACHED */
        return(0);
 }
@@ -436,7 +436,7 @@ bad_ver(void)
 static void
 sigterm(int signo __unused)
 {
-       leave(0, (char *) NULL);
+       leave(0, NULL);
 }
 
 /*
@@ -480,7 +480,7 @@ intr(int dummy __unused)
                                (void) write(Socket, "q", 1);
                                (void) close(Socket);
                        }
-                       leave(0, (char *) NULL);
+                       leave(0, NULL);
                }
                else if (ch == 'n') {
                        (void) signal(SIGINT, intr);
index f21940b..e1a9bc6 100644 (file)
@@ -1,31 +1,31 @@
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
  * met:
- * 
- * + Redistributions of source code must retain the above copyright 
+ *
+ * + Redistributions of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * + Redistributions in binary form must reproduce the above copyright 
- *   notice, this list of conditions and the following disclaimer in the 
+ * + Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * + Neither the name of the University of California, San Francisco nor 
- *   the names of its contributors may be used to endorse or promote 
- *   products derived from this software without specific prior written 
+ * + Neither the name of the University of California, San Francisco nor
+ *   the names of its contributors may be used to endorse or promote
+ *   products derived from this software without specific prior written
  *   permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $OpenBSD: driver.c,v 1.17 2007/04/02 14:55:16 jmc Exp $
@@ -143,7 +143,7 @@ again:
                        read_fds = Fds_mask;
                        errno = 0;
                        timerclear(&timeout);
-                       nready = select(Num_fds, &read_fds, NULL, NULL, 
+                       nready = select(Num_fds, &read_fds, NULL, NULL,
                            &timeout);
                        if (nready < 0 && errno != EINTR) {
                                logit(LOG_ERR, "select");
@@ -155,7 +155,7 @@ again:
                        /*
                         * Nothing was ready. We do some work now
                         * to see if the simulation has any pending work
-                        * to do, and decide if we need to block 
+                        * to do, and decide if we need to block
                         * indefinitely or just timeout.
                         */
                        do {
@@ -173,10 +173,10 @@ again:
                                 * just block waiting for external activity
                                 */
                                        to = NULL;
-                               
+
                                read_fds = Fds_mask;
                                errno = 0;
-                               nready = select(Num_fds, &read_fds, NULL, NULL, 
+                               nready = select(Num_fds, &read_fds, NULL, NULL,
                                    to);
                                if (nready < 0 && errno != EINTR) {
                                        logit(LOG_ERR, "select");
@@ -198,7 +198,7 @@ again:
                        fd = sp->fd;
                        if (FD_ISSET(fd, &Have_inp) && answer_next(sp)) {
                                /*
-                                * Remove from the spawn list. (fd remains in 
+                                * Remove from the spawn list. (fd remains in
                                 * read set).
                                 */
                                *sp->prevnext = sp->next;
@@ -213,7 +213,7 @@ again:
                                if (first && should_announce)
                                        announce_game();
                                first = FALSE;
-                       } 
+                       }
                        sp = spnext;
                }
 
@@ -442,7 +442,7 @@ init(void)
                Server_socket = socket(AF_INET, SOCK_DGRAM, 0);
 
                /* Permit multiple huntd's on the same port. */
-               if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true, 
+               if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true,
                    sizeof true) < 0)
                        logit(LOG_ERR, "setsockopt SO_REUSEADDR");
 
@@ -601,7 +601,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage,
                }
 
                /* Set the death message: */
-               (void) snprintf(victim->p_death, sizeof victim->p_death, 
+               (void) snprintf(victim->p_death, sizeof victim->p_death,
                        "| %s by %s |", cp, blame);
 
                /* No further score crediting needed. */
@@ -609,14 +609,14 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage,
        }
 
        /* Set the death message: */
-       (void) snprintf(victim->p_death, sizeof victim->p_death, 
+       (void) snprintf(victim->p_death, sizeof victim->p_death,
                "| %s by %s |", cp, credit->i_name);
 
        if (victim == attacker) {
                /* No use killing yourself. */
                credit->i_kills--;
                credit->i_bkills++;
-       } 
+       }
        else if (victim->p_ident->i_team == ' '
            || victim->p_ident->i_team != credit->i_team) {
                /* A cross-team kill: */
@@ -647,7 +647,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage,
                        attacker->p_damage = 0;
 
                /* Tell the attacker his new strength: */
-               outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d", 
+               outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d",
                        attacker->p_damage, attacker->p_damcap);
 
                /* Tell the attacker his new 'kill count': */
@@ -758,12 +758,12 @@ zap(PLAYER *pp, FLAG was_player)
                        char buf[BUFSIZ];
 
                        /* Detonate: */
-                       (void) add_shot(expl_type, pp->p_y, pp->p_x, 
-                           pp->p_face, expl_charge, (PLAYER *) NULL, 
+                       (void) add_shot(expl_type, pp->p_y, pp->p_x,
+                           pp->p_face, expl_charge, NULL,
                            TRUE, SPACE);
 
                        /* Explain what the explosion is about. */
-                       snprintf(buf, sizeof buf, "%s detonated.", 
+                       snprintf(buf, sizeof buf, "%s detonated.",
                                pp->p_ident->i_name);
                        message(ALL_PLAYERS, buf);
 
@@ -804,7 +804,7 @@ zap(PLAYER *pp, FLAG was_player)
                volcano += pp->p_ammo - expl_charge;
 
                /* Volcano eruption: */
-               if (conf_volcano && rand_num(100) < volcano / 
+               if (conf_volcano && rand_num(100) < volcano /
                    conf_volcano_max) {
                        /* Erupt near the middle of the map */
                        do {
@@ -814,7 +814,7 @@ zap(PLAYER *pp, FLAG was_player)
 
                        /* Convert volcano charge into lava: */
                        (void) add_shot(LAVA, y, x, LEFTS, volcano,
-                               (PLAYER *) NULL, TRUE, SPACE);
+                               NULL, TRUE, SPACE);
                        volcano = 0;
 
                        /* Tell eveyone what's happening */
@@ -833,7 +833,7 @@ zap(PLAYER *pp, FLAG was_player)
                        add_shot(DSHOT, y, x, rand_dir(),
                                shot_req[conf_mindshot +
                                rand_num(MAXBOMB - conf_mindshot)],
-                               (PLAYER *) NULL, FALSE, SPACE);
+                               NULL, FALSE, SPACE);
                }
 
                /* Tell the zapped player's client to shut down. */
@@ -845,8 +845,8 @@ zap(PLAYER *pp, FLAG was_player)
                if (pp != End_player) {
                        /* Move the last player into the gap: */
                        memcpy(pp, End_player, sizeof *pp);
-                       outyx(ALL_PLAYERS, 
-                               STAT_PLAY_ROW + 1 + (pp - Player), 
+                       outyx(ALL_PLAYERS,
+                               STAT_PLAY_ROW + 1 + (pp - Player),
                                STAT_NAME_COL,
                                "%5.2f%c%-10.10s %c",
                                pp->p_ident->i_score, stat_char(pp),
@@ -868,7 +868,7 @@ zap(PLAYER *pp, FLAG was_player)
                End_monitor--;
                if (pp != End_monitor) {
                        memcpy(pp, End_monitor, sizeof *pp);
-                       outyx(ALL_PLAYERS, 
+                       outyx(ALL_PLAYERS,
                                STAT_MON_ROW + 1 + (pp - Player), STAT_NAME_COL,
                                "%5.5s %-10.10s %c", " ",
                                pp->p_ident->i_name, pp->p_ident->i_team);
index b9e338a..dcc4131 100644 (file)
@@ -614,8 +614,7 @@ pickup(PLAYER *pp, int y, int x, int prob, int obj)
        /* Does it explode? */
        if (rand_num(100) < prob)
                /* Ooooh, unlucky: (Boom) */
-               add_shot(obj, y, x, LEFTS, req, (PLAYER *) NULL,
-                       TRUE, pp->p_face);
+               add_shot(obj, y, x, LEFTS, req, NULL, TRUE, pp->p_face);
        else {
                /* Safely picked it up. Add to player's ammo: */
                pp->p_ammo += req;
index 32eeb57..7e5b45f 100644 (file)
@@ -724,7 +724,7 @@ again:
                /* Land: */
                if (pp->p_face != BOOT && pp->p_face != BOOT_PAIR) {
                        /* Land a player - they stustain a fall: */
-                       checkdam(pp, (PLAYER *) NULL, (IDENT *) NULL,
+                       checkdam(pp, NULL, NULL,
                                rand_num(pp->p_damage / conf_fall_frac), FALL);
                        pp->p_face = rand_dir();
                        showstat(pp);
@@ -826,7 +826,7 @@ chkshot(BULLET *bp, BULLET *next)
                                        y, x, LEFTS,
                                        (Maze[y][x] == GMINE) ?
                                        GRENREQ : BULREQ,
-                                       (PLAYER *) NULL, TRUE, SPACE);
+                                       NULL, TRUE, SPACE);
                                Maze[y][x] = SPACE;
                                break;
                        }
index 5c85f4a..d860981 100644 (file)
@@ -77,7 +77,7 @@ yylex(void)
                                {
                                /* revoke */
                                setgid(getgid());
-                               execl("/bin/csh", "csh", (char *) NULL);    exit(1);
+                               execl("/bin/csh", "csh", NULL);    exit(1);
                                }
                        wait(0);
                        if (ic<0) /* error */
index 9efcb11..ff0670b 100644 (file)
@@ -61,7 +61,7 @@ main(int ac, char *av[])
 
        if (strcmp(av[0], "a.out") == 0) {
                outf = fopen("q", "w");
-               setbuf(outf, (char *)NULL);
+               setbuf(outf, NULL);
                Debug = TRUE;
        }
        restore = FALSE;
index 994a981..4809e96 100644 (file)
@@ -464,7 +464,7 @@ getmove(void)
                                leaveok(Board, TRUE);
                                if ((outf = fopen(buf, "w")) == NULL)
                                        perror(buf);
-                               setbuf(outf, (char *)NULL);
+                               setbuf(outf, NULL);
                        }
                        Debug = !Debug;
                        break;
index 24a1f7e..25683e9 100644 (file)
@@ -90,7 +90,7 @@ over:
                                goto over;
                        }
                        if (strcmp(buf, _PATH_DEVNULL) != 0)
-                               setbuf(outf, (char *)NULL);
+                               setbuf(outf, NULL);
                }
 #endif
        }
index ccfe926..ef85e48 100644 (file)
@@ -996,8 +996,7 @@ static      const char      *deathmesg[] =
     if (ch == 'Y')
        {
        cleanup(FALSE);
-       execl(_PATH_GAMEPROG, "phantasia", "-s",
-           (Wizard ? "-S": (char *) NULL), (char *) NULL);
+       execl(_PATH_GAMEPROG, "phantasia", "-s", (Wizard ? "-S": NULL), NULL);
        exit(0);
        /*NOTREACHED*/
        }
index 33694dc..b22b599 100644 (file)
@@ -65,7 +65,7 @@ main(int argc, char **argv)
        while ((ch = getopt(argc, argv, "d:h")) != -1)
                switch (ch) {
                case 'd':
-                       if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1
+                       if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1
                            || delay > 1000)
                                errx(1, "invalid delay (1-1000)");
                        delay *= 1000;  /* ms -> us */
index cc9d0da..ae9e39a 100644 (file)
@@ -389,7 +389,7 @@ md_gln(void)
        if ((s = getlogin()))
                return s;
        if (!(p = getpwuid(getuid())))
-               return((char *)NULL);
+               return(NULL);
        return(p->pw_name);
 }
 
@@ -541,7 +541,7 @@ md_shell(const char *shell)
        if (!fork()) {
                /* revoke */
                setgid(getgid());
-               execl(shell, shell, (char *) NULL);
+               execl(shell, shell, NULL);
        }
        wait((int *)w);
 }
index 4f58154..934e861 100644 (file)
@@ -194,7 +194,7 @@ main(int argc, char **argv)
        while ((ch = getopt(argc, argv, "d:fl:n:t")) != -1)
                switch(ch) {
                case 'd':
-                       if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1 || delay > 1000)
+                       if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1 || delay > 1000)
                                errx(1, "invalid delay (1-1000)");
                        delay *= 1000;  /* ms -> us */
                        break;
index 6285697..70d9dd6 100644 (file)
@@ -747,7 +747,7 @@ puff of greasy black smoke! (poof)\n");
                        err(1, "open %s", _PATH_WUMPINFO);
                if (dup2(fd, 0) == -1)
                        err(1, "dup2");
-               (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL);
+               (void)execl("/bin/sh", "sh", "-c", pager, NULL);
                err(1, "exec sh -c %s", pager);
        case -1:
                err(1, "fork");
index f42c3ca..134e5c3 100644 (file)
@@ -48,5 +48,5 @@ getwd(char *buf)
        if ( (p = getcwd(buf, MAXPATHLEN)) )
                return(p);
        strcpy(buf, strerror(errno));
-       return((char *)NULL);
+       return(NULL);
 }
index 6a6b85d..1d5f259 100644 (file)
@@ -843,7 +843,7 @@ open_temp(HTAB *hashp)
                unlink(namestr);
                _fcntl(hashp->fp, F_SETFD, 1);
        }
-       _sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
+       _sigprocmask(SIG_SETMASK, &oset, NULL);
        return (hashp->fp != -1 ? 0 : -1);
 }
 
index 2ce1f5d..9d7bea1 100644 (file)
@@ -213,7 +213,7 @@ struct fstab *
 getfsent(void)
 {
        if ((!_fs_fp && !setfsent()) || !fstabscan())
-               return((struct fstab *)NULL);
+               return(NULL);
        return(&_fs_fstab);
 }
 
@@ -224,7 +224,7 @@ getfsspec(const char *name)
                while (fstabscan())
                        if (!strcmp(_fs_fstab.fs_spec, name))
                                return(&_fs_fstab);
-       return((struct fstab *)NULL);
+       return(NULL);
 }
 
 struct fstab *
@@ -234,7 +234,7 @@ getfsfile(const char *name)
                while (fstabscan())
                        if (!strcmp(_fs_fstab.fs_file, name))
                                return(&_fs_fstab);
-       return((struct fstab *)NULL);
+       return(NULL);
 }
 
 int
index 8d098b6..595543b 100644 (file)
@@ -126,7 +126,7 @@ we_askshell(const char *words, wordexp_t *we, int flags)
                        _close(devnull);
                }
                execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
-                   "-c", cmd, (char *)NULL);
+                   "-c", cmd, NULL);
                _exit(1);
        }
 
index 768a4c5..979891b 100644 (file)
@@ -73,7 +73,7 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he,
                return (-1);
        }
 
-       if (hed->yp_domain == (char *)NULL)
+       if (hed->yp_domain == NULL)
                if (yp_get_default_domain (&hed->yp_domain)) {
                        RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
                        return (-1);
index c6d6139..3e5cba7 100644 (file)
@@ -67,7 +67,7 @@ _getnetbynis(const char *name, char *map, int af, struct netent *ne,
                return (-1);
        }
 
-       if (ned->yp_domain == (char *)NULL)
+       if (ned->yp_domain == NULL)
                if (yp_get_default_domain (&ned->yp_domain))
                        return (-1);
 
index 31cd5ee..8b4514d 100644 (file)
@@ -147,12 +147,11 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser,
                        else
                                rshprog = pw->pw_shell;
                        p = strrchr(rshprog, '/');
-                       execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd,
-                           (char *)NULL);
+                       execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd, NULL);
                } else {
                        p = strrchr(rshprog, '/');
                        execlp(rshprog, p ? p + 1 : rshprog, *ahost, "-l",
-                           remuser, cmd, (char *)NULL);
+                           remuser, cmd, NULL);
                }
                fprintf(stderr, "rcmdsh: execlp %s failed: %s\n",
                    rshprog, strerror(errno));
index 008fec1..e30d5d0 100644 (file)
@@ -284,7 +284,7 @@ authdes_marshal(AUTH *auth, XDR *xdrs)
         * Figure out the "time", accounting for any time difference
         * with the server if necessary.
         */
-       gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL);
+       gettimeofday(&ad->ad_timestamp, NULL);
        ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec;
        ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec;
        while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) {
index 9463678..6fc77e6 100644 (file)
@@ -404,7 +404,7 @@ __rpc_get_time_offset(struct timeval *td,   /* Time difference                      */
                                FD_ZERO(&readfds);
                                FD_SET(s, &readfds);
                                res = _select(_rpc_dtablesize(), &readfds,
-                                    (fd_set *)NULL, (fd_set *)NULL, &timeout);
+                                    NULL, NULL, &timeout);
                        } while (res < 0 && errno == EINTR);
                        if (res <= 0)
                                goto error;
index 25e4db8..52a793a 100644 (file)
@@ -157,14 +157,14 @@ clnt_dg_create(int fd,                    /* open file descriptor */
        sigfillset(&newmask);
        thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
        mutex_lock(&clnt_fd_lock);
-       if (dg_fd_locks == (int *) NULL) {
+       if (dg_fd_locks == NULL) {
                int cv_allocsz;
                size_t fd_allocsz;
                int dtbsize = __rpc_dtbsize();
 
                fd_allocsz = dtbsize * sizeof (int);
                dg_fd_locks = (int *) mem_alloc(fd_allocsz);
-               if (dg_fd_locks == (int *) NULL) {
+               if (dg_fd_locks == NULL) {
                        mutex_unlock(&clnt_fd_lock);
                        thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
                        goto err1;
@@ -173,9 +173,9 @@ clnt_dg_create(int fd,                      /* open file descriptor */
 
                cv_allocsz = dtbsize * sizeof (cond_t);
                dg_cv = (cond_t *) mem_alloc(cv_allocsz);
-               if (dg_cv == (cond_t *) NULL) {
+               if (dg_cv == NULL) {
                        mem_free(dg_fd_locks, fd_allocsz);
-                       dg_fd_locks = (int *) NULL;
+                       dg_fd_locks = NULL;
                        mutex_unlock(&clnt_fd_lock);
                        thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
                        goto err1;
index 3b8dc20..d8b2996 100644 (file)
@@ -123,7 +123,7 @@ clnt_create_vers_timed(const char *hostname, rpcprog_t prog,
        to.tv_sec = 10;
        to.tv_usec = 0;
        rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void,
-                       (char *)NULL, (xdrproc_t)xdr_void, (char *)NULL, to);
+                       NULL, (xdrproc_t)xdr_void, NULL, to);
        if (rpc_stat == RPC_SUCCESS) {
                *vers_out = vers_high;
                return (clnt);
@@ -145,8 +145,8 @@ clnt_create_vers_timed(const char *hostname, rpcprog_t prog,
                }
                CLNT_CONTROL(clnt, CLSET_VERS, (char *)&vers_high);
                rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void,
-                               (char *)NULL, (xdrproc_t)xdr_void,
-                               (char *)NULL, to);
+                               NULL, (xdrproc_t)xdr_void,
+                               NULL, to);
                if (rpc_stat == RPC_SUCCESS) {
                        *vers_out = vers_high;
                        return (clnt);
index 8700343..9fa08f7 100644 (file)
@@ -129,7 +129,7 @@ static cond_t   *vc_cv;
        mutex_lock(&clnt_fd_lock);      \
        vc_fd_locks[fd] = 0;            \
        mutex_unlock(&clnt_fd_lock);    \
-       thr_sigsetmask(SIG_SETMASK, &(mask), (sigset_t *) NULL);        \
+       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);     \
        cond_signal(&vc_cv[fd]);        \
 }
 
@@ -173,7 +173,7 @@ clnt_vc_create(int fd,                      /* open file descriptor */
 
        cl = (CLIENT *)mem_alloc(sizeof (*cl));
        ct = (struct ct_data *)mem_alloc(sizeof (*ct));
-       if ((cl == (CLIENT *)NULL) || (ct == (struct ct_data *)NULL)) {
+       if ((cl == NULL) || (ct == NULL)) {
                syslog(LOG_ERR, clnt_vc_errstr, clnt_vc_str, __no_mem_str);
                rpc_createerr.cf_stat = RPC_SYSTEMERROR;
                rpc_createerr.cf_error.re_errno = errno;
@@ -183,25 +183,25 @@ clnt_vc_create(int fd,                    /* open file descriptor */
        sigfillset(&newmask);
        thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
        mutex_lock(&clnt_fd_lock);
-       if (vc_fd_locks == (int *) NULL) {
+       if (vc_fd_locks == NULL) {
                int cv_allocsz, fd_allocsz;
                int dtbsize = __rpc_dtbsize();
 
                fd_allocsz = dtbsize * sizeof (int);
                vc_fd_locks = (int *) mem_alloc(fd_allocsz);
-               if (vc_fd_locks == (int *) NULL) {
+               if (vc_fd_locks == NULL) {
                        mutex_unlock(&clnt_fd_lock);
                        thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
                        goto err;
                } else
                        memset(vc_fd_locks, '\0', fd_allocsz);
 
-               assert(vc_cv == (cond_t *) NULL);
+               assert(vc_cv == NULL);
                cv_allocsz = dtbsize * sizeof (cond_t);
                vc_cv = (cond_t *) mem_alloc(cv_allocsz);
-               if (vc_cv == (cond_t *) NULL) {
+               if (vc_cv == NULL) {
                        mem_free(vc_fd_locks, fd_allocsz);
-                       vc_fd_locks = (int *) NULL;
+                       vc_fd_locks = NULL;
                        mutex_unlock(&clnt_fd_lock);
                        thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
                        goto err;
@@ -212,7 +212,7 @@ clnt_vc_create(int fd,                      /* open file descriptor */
                                cond_init(&vc_cv[i], 0, NULL);
                }
        } else
-               assert(vc_cv != (cond_t *) NULL);
+               assert(vc_cv != NULL);
 
        /*
         * XXX - fvdl connecting while holding a mutex?
@@ -301,7 +301,7 @@ err:
                if (cl)
                        mem_free(cl, sizeof (CLIENT));
        }
-       return ((CLIENT *)NULL);
+       return (NULL);
 }
 
 static enum clnt_stat
index 96daef4..c344b5d 100644 (file)
@@ -64,7 +64,7 @@ _des_crypt_call(char *buf, int len, struct desparams *dparms)
                return(DESERR_HWERROR);
        }
        clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf);
-       if (clnt == (CLIENT *) NULL) {
+       if (clnt == NULL) {
                endnetconfig(localhandle);
                return(DESERR_HWERROR);
        }
@@ -78,7 +78,7 @@ _des_crypt_call(char *buf, int len, struct desparams *dparms)
        bcopy(dparms->des_key, des_crypt_1_arg.des_key, 8);
 
        result_1 = des_crypt_1(&des_crypt_1_arg, clnt);
-       if (result_1 == (desresp *) NULL) {
+       if (result_1 == NULL) {
                clnt_destroy(clnt);
                return(DESERR_HWERROR);
        }
index bb0e619..9843eec 100644 (file)
@@ -307,10 +307,10 @@ getkeyserv_handle(int vers)
                }
                kcp = (struct key_call_private *)thr_getspecific(key_call_key);
        }
-       if (kcp == (struct key_call_private *)NULL) {
+       if (kcp == NULL) {
                kcp = (struct key_call_private *)malloc(sizeof (*kcp));
-               if (kcp == (struct key_call_private *)NULL) {
-                       return ((CLIENT *) NULL);
+               if (kcp == NULL) {
+                       return (NULL);
                }
                if (main_thread)
                        key_call_private_main = kcp;
@@ -335,7 +335,7 @@ getkeyserv_handle(int vers)
                        if (kcp->client->cl_auth == NULL) {
                                clnt_destroy(kcp->client);
                                kcp->client = NULL;
-                               return ((CLIENT *) NULL);
+                               return (NULL);
                        }
                }
                /* Change the version number to the new one */
@@ -343,13 +343,13 @@ getkeyserv_handle(int vers)
                return (kcp->client);
        }
        if (!(localhandle = setnetconfig())) {
-               return ((CLIENT *) NULL);
+               return (NULL);
        }
        tpconf = NULL;
        if (uname(&u) == -1)
        {
                endnetconfig(localhandle);
-               return ((CLIENT *) NULL);
+               return (NULL);
        }
        while ((nconf = getnetconfig(localhandle)) != NULL) {
                if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) {
@@ -367,14 +367,14 @@ getkeyserv_handle(int vers)
                        }
                }
        }
-       if ((kcp->client == (CLIENT *) NULL) && (tpconf))
+       if ((kcp->client == NULL) && (tpconf))
                /* Now, try the CLTS or COTS loopback transport */
                kcp->client = clnt_tp_create(u.nodename,
                        KEY_PROG, vers, tpconf);
        endnetconfig(localhandle);
 
-       if (kcp->client == (CLIENT *) NULL) {
-               return ((CLIENT *) NULL);
+       if (kcp->client == NULL) {
+               return (NULL);
        }
        kcp->uid = geteuid();
        kcp->pid = getpid();
@@ -382,7 +382,7 @@ getkeyserv_handle(int vers)
        if (kcp->client->cl_auth == NULL) {
                clnt_destroy(kcp->client);
                kcp->client = NULL;
-               return ((CLIENT *) NULL);
+               return (NULL);
        }
 
        wait_time.tv_sec = TOTAL_TIMEOUT/TOTAL_TRIES;
index 5cef0e8..686ed63 100644 (file)
@@ -89,9 +89,9 @@ getnetname(char *name)
 
        uid = geteuid();
        if (uid == 0) {
-               return (host2netname(name, (char *) NULL, (char *) NULL));
+               return (host2netname(name, NULL, NULL));
        } else {
-               return (user2netname(name, uid, (char *) NULL));
+               return (user2netname(name, uid, NULL));
        }
 }
 
index 2568035..183afd8 100644 (file)
@@ -222,8 +222,8 @@ struct netconfig *
 __rpc_getconfip(const char *nettype)
 {
        char *netid;
-       char *netid_tcp = (char *) NULL;
-       char *netid_udp = (char *) NULL;
+       char *netid_tcp = NULL;
+       char *netid_udp = NULL;
        static char *netid_tcp_main;
        static char *netid_udp_main;
        struct netconfig *dummy;
index ce049f0..8d7abec 100644 (file)
@@ -457,7 +457,7 @@ svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path)
        SVCXPRT *xprt;
        int addrlen;
 
-       xprt = (SVCXPRT *)NULL;
+       xprt = NULL;
        localhandle = setnetconfig();
        while ((nconf = getnetconfig(localhandle)) != NULL) {
                if (nconf->nc_protofmly != NULL &&
index 3c2da02..198c6ae 100644 (file)
@@ -179,7 +179,7 @@ check_cache(const char *host, const char *netid)
                        return (cptr);
                }
        }
-       return ((struct address_cache *) NULL);
+       return (NULL);
 }
 
 static void
@@ -1040,7 +1040,7 @@ rpcb_getaddr(rpcprog_t program, rpcvers_t version,
 
        if ((na = __rpcb_findaddr_timed(program, version,
            (struct netconfig *) nconf, (char *) host,
-           (CLIENT **) NULL, (struct timeval *) NULL)) == NULL)
+           NULL, NULL)) == NULL)
                return (FALSE);
 
        if (na->len > address->maxlen) {
@@ -1219,7 +1219,7 @@ rpcb_gettime(const char *host, time_t *timep)
                        break;
        }
        __rpc_endconf(handle);
-       if (client == (CLIENT *) NULL) {
+       if (client == NULL) {
                return (FALSE);
        }
 
index 2a589a1..3bc5a7d 100644 (file)
@@ -105,7 +105,7 @@ rtime(struct sockaddr_in *addrp, struct timeval *timep, struct timeval *timeout)
                        FD_ZERO(&readfds);
                        FD_SET(s, &readfds);
                        res = _select(_rpc_dtablesize(), &readfds,
-                                    (fd_set *)NULL, (fd_set *)NULL, timeout);
+                                    NULL, NULL, timeout);
                } while (res < 0 && errno == EINTR);
                if (res <= 0) {
                        if (res == 0) {
index 3ed9814..aaf1606 100644 (file)
@@ -267,7 +267,7 @@ _svcauth_des(struct svc_req *rqst, struct rpc_msg *msg)
                        debug("timestamp before last seen");
                        return (AUTH_REJECTEDVERF);     /* replay */
                }
-               gettimeofday(&current, (struct timezone *)NULL);
+               gettimeofday(&current, NULL);
                current.tv_sec -= window;       /* allow for expiration */
                if (!BEFORE(&current, &timestamp)) {
                        debug("timestamp expired");
index f0babe0..b9e8a03 100644 (file)
@@ -73,13 +73,13 @@ mkstemp(char *path)
 char *
 mkdtemp(char *path)
 {
-       return (_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL);
+       return (_gettemp(path, NULL, 1, 0) ? path : NULL);
 }
 
 char *
 _mktemp(char *path)
 {
-       return (_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
+       return (_gettemp(path, NULL, 0, 0) ? path : NULL);
 }
 
 __warn_references(mktemp,
index df523df..3934824 100644 (file)
@@ -159,7 +159,7 @@ The
 function
 is exactly equivalent to the call:
 .Pp
-.Dl "setvbuf(stream, (char *)NULL, _IOLBF, 0);"
+.Dl "setvbuf(stream, NULL, _IOLBF, 0);"
 .Sh RETURN VALUES
 The
 .Fn setvbuf
index 1c86f45..9c4bb48 100644 (file)
@@ -54,5 +54,5 @@ int
 setlinebuf(FILE *fp)
 {
 
-       return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0));
+       return (setvbuf(fp, NULL, _IOLBF, (size_t)0));
 }
index 82a98f8..07ac0c4 100644 (file)
@@ -736,9 +736,9 @@ literal:
 
                                *p = 0;
                                if ((flags & UNSIGNED) == 0)
-                                   res = strtoimax(buf, (char **)NULL, base);
+                                   res = strtoimax(buf, NULL, base);
                                else
-                                   res = strtoumax(buf, (char **)NULL, base);
+                                   res = strtoumax(buf, NULL, base);
                                if (flags & POINTER)
                                        *va_arg(ap, void **) =
                                                        (void *)(uintptr_t)res;
index 6d8a03a..85ca6d0 100644 (file)
@@ -58,7 +58,7 @@ representation.
 .Pp
 It is equivalent to:
 .Bd -literal -offset indent
-strtod(nptr, (char **)NULL);
+strtod(nptr, NULL);
 .Ed
 .Pp
 The decimal point
index 3f58a43..c1f6543 100644 (file)
@@ -58,7 +58,7 @@ representation.
 .Pp
 It is equivalent to:
 .Bd -literal -offset indent
-(int)strtol(nptr, (char **)NULL, 10);
+(int)strtol(nptr, NULL, 10);
 .Ed
 .Pp
 The
index ed243c3..746d92a 100644 (file)
@@ -36,5 +36,5 @@
 int
 atoi(const char *str)
 {
-       return((int)strtol(str, (char **)NULL, 10));
+       return((int)strtol(str, NULL, 10));
 }
index 76c1f29..cb832da 100644 (file)
@@ -66,7 +66,7 @@ representation.
 .Pp
 It is equivalent to:
 .Pp
-.Dl "strtol(nptr, (char **)NULL, 10);"
+.Dl "strtol(nptr, NULL, 10);"
 .Pp
 The
 .Fn atoll
@@ -79,7 +79,7 @@ representation.
 .Pp
 It is equivalent to:
 .Pp
-.Dl "strtoll(nptr, (char **)NULL, 10);"
+.Dl "strtoll(nptr, NULL, 10);"
 .Sh ERRORS
 The functions
 .Fn atol
index b0ca813..2d4bf74 100644 (file)
@@ -36,5 +36,5 @@
 long
 atol(const char *str)
 {
-       return(strtol(str, (char **)NULL, 10));
+       return(strtol(str, NULL, 10));
 }
index 1ef4fb1..43fd35b 100644 (file)
@@ -76,7 +76,7 @@ __system(const char *command)
                _sigaction(SIGINT, &intact, NULL);
                _sigaction(SIGQUIT,  &quitact, NULL);
                _sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
-               execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL);
+               execl(_PATH_BSHELL, "sh", "-c", command, NULL);
                _exit(127);
        default:                        /* parent */
                savedpid = pid;
index c12a17d..88cfa54 100644 (file)
@@ -1130,7 +1130,7 @@ tzsetwall_basic(int rdlocked)
        _RWLOCK_WRLOCK(&lcl_rwlock);
        lcl_is_set = -1;
 
-       if (tzload((char *) NULL, lclptr, TRUE) != 0)
+       if (tzload(NULL, lclptr, TRUE) != 0)
                gmtload(lclptr);
        settzname();
        _RWLOCK_UNLOCK(&lcl_rwlock);
index 25d1cb0..7b6bcea 100644 (file)
@@ -150,7 +150,7 @@ _thread_init(void)
                        PANIC("Can't open console");
                if (setlogin("root") == -1)
                        PANIC("Can't set login to root");
-               if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1)
+               if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1)
                        PANIC("Can't set controlling terminal");
                if (__sys_dup2(fd, 0) == -1 ||
                    __sys_dup2(fd, 1) == -1 ||
index dd6576e..ea7d123 100644 (file)
@@ -326,7 +326,7 @@ completion_matches(const char *text, char *(*genfunc)(const char *, int))
        match_list[0] = retstr;
 
        /* add NULL as last pointer to the array */
-       match_list[matches + 1] = (char *) NULL;
+       match_list[matches + 1] = NULL;
 
        return (match_list);
 }
index 501b6de..da62506 100644 (file)
@@ -190,7 +190,7 @@ _move_history(int op)
        static HIST_ENTRY rl_he;
 
        if (history(h, &ev, op) != 0)
-               return (HIST_ENTRY *) NULL;
+               return NULL;
 
        rl_he.line = ev.str;
        rl_he.data = NULL;
index 006ef58..03a311f 100644 (file)
@@ -67,7 +67,7 @@ development at this time.
 .Sh RETURN VALUES
 Upon successful completion, the function shall return a pointer to the
 long text form of an ACL.  Otherwise, a value of
-.Va (char*)NULL
+.Va NULL
 shall be returned and
 .Va errno
 shall be set to indicate the error.
index ab24d45..ad1114b 100644 (file)
@@ -47,7 +47,7 @@ int
 rusers(char *host, utmpidlearr *up)
 {
        return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES,
-                       (xdrproc_t)xdr_void, (char *) NULL,
+                       (xdrproc_t)xdr_void, NULL,
                        (xdrproc_t)xdr_utmpidlearr, (char *) up));
 }
 
@@ -57,7 +57,7 @@ rnusers(char *host)
        int nusers;
 
        if (callrpc(host, RUSERSPROG, RUSERSVERS_ORIG, RUSERSPROC_NUM,
-                       (xdrproc_t)xdr_void, (char *) NULL,
+                       (xdrproc_t)xdr_void, NULL,
                        (xdrproc_t)xdr_u_long, (char *) &nusers) != 0)
                return (-1);
        else
index 9a6517f..1e3fd27 100644 (file)
@@ -47,5 +47,5 @@ rwall(char *host, char *msg)
 {
        return (callrpc(host, WALLPROG, WALLVERS, WALLPROC_WALL,
                        (xdrproc_t)xdr_wrapstring, (char *) &msg,
-                       (xdrproc_t)xdr_void, (char *) NULL));
+                       (xdrproc_t)xdr_void, NULL));
 }
index 42723e6..902ea0c 100644 (file)
@@ -201,7 +201,7 @@ _libpthread_init(struct pthread *curthread)
                        PANIC("Can't open console");
                if (setlogin("root") == -1)
                        PANIC("Can't set login to root");
-               if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1)
+               if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1)
                        PANIC("Can't set controlling terminal");
        }
 
index 048aea6..2626194 100644 (file)
@@ -43,7 +43,7 @@ int
 login_tty(int fd)
 {
        (void) setsid();
-       if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
+       if (ioctl(fd, TIOCSCTTY, NULL) == -1)
                return (-1);
        (void) dup2(fd, 0);
        (void) dup2(fd, 1);
index 532e799..bd3d396 100644 (file)
@@ -258,11 +258,11 @@ pw_mkdb(const char *user)
                /* child */
                if (user == NULL)
                        execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
-                           "-d", passwd_dir, tempname, (char *)NULL);
+                           "-d", passwd_dir, tempname, NULL);
                else
                        execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
                            "-d", passwd_dir, "-u", user, tempname,
-                           (char *)NULL);
+                           NULL);
                _exit(1);
                /* NOTREACHED */
        default:
@@ -314,7 +314,7 @@ pw_edit(int notsetuid)
                        setuid(getuid());
                }
                errno = 0;
-               execlp(editor, basename(editor), tempname, (char *)NULL);
+               execlp(editor, basename(editor), tempname, NULL);
                _exit(errno);
        default:
                /* parent */
index 5df204c..4390455 100644 (file)
@@ -216,7 +216,7 @@ get_pid(int fd, int *err)
        bytes_read = read (fd, buf, sizeof (buf) - 1);
        if (bytes_read > 0) {
                buf[bytes_read] = '\0';
-               pid = strtol (buf, (char **) NULL, 10);
+               pid = strtol (buf, NULL, 10);
        } else {
                pid = -1;
                *err = bytes_read ? errno : EINVAL;
index b1d631b..9229950 100644 (file)
@@ -332,7 +332,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
        if (chdir(pentry->pw_dir))
                chdir("/");
 
-       if(execle("/bin/sh","sh",(char *) NULL, nenvp) != 0)
+       if(execle("/bin/sh","sh",NULL, nenvp) != 0)
            perr("exec failed for /bin/sh");
 
        PRIV_END
@@ -341,7 +341,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
      */
     close(fd_in);
     close(fd_out);
-    waitpid(pid, (int *) NULL, 0);
+    waitpid(pid, NULL, 0);
 
     /* Send mail.  Unlink the output file first, so it is deleted after
      * the run.
@@ -380,7 +380,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
 
        execl(_PATH_SENDMAIL, "sendmail", "-F", "Atrun Service",
                        "-odi", "-oem",
-                       mailname, (char *) NULL);
+                       mailname, NULL);
            perr("exec failed for mail command");
 
        PRIV_END
index 3b0356e..7f0fd4f 100644 (file)
@@ -236,13 +236,13 @@ main(int argc, char **argv)
 
                        if (!opentty(ttyn, O_RDWR|O_NONBLOCK))
                                exit(1);
-                       setdefttymode(tname);
-                       rfds = 1 << 0;  /* FD_SET */
-                       timeout.tv_sec = RT;
-                       timeout.tv_usec = 0;
-                       i = select(32, (fd_set*)&rfds, (fd_set*)NULL,
-                                      (fd_set*)NULL, RT ? &timeout : NULL);
-                       if (i < 0) {
+                       setdefttymode(tname);
+                       rfds = 1 << 0;  /* FD_SET */
+                       timeout.tv_sec = RT;
+                       timeout.tv_usec = 0;
+                       i = select(32, (fd_set*)&rfds, NULL,
+                                      NULL, RT ? &timeout : NULL);
+                       if (i < 0) {
                                syslog(LOG_ERR, "select %s: %m", ttyn);
                        } else if (i == 0) {
                                syslog(LOG_NOTICE, "recycle tty %s", ttyn);
index 287fe44..7c8b086 100644 (file)
@@ -806,15 +806,13 @@ autobaud(void)
        rfds = 1 << 0;
        timeout.tv_sec = 5;
        timeout.tv_usec = 0;
-       if (select(32, (fd_set *)&rfds, (fd_set *)NULL,
-           (fd_set *)NULL, &timeout) <= 0)
+       if (select(32, (fd_set *)&rfds, NULL, NULL, &timeout) <= 0)
                return (type);
        if (read(STDIN_FILENO, &c, sizeof(char)) != sizeof(char))
                return (type);
        timeout.tv_sec = 0;
        timeout.tv_usec = 20;
-       (void) select(32, (fd_set *)NULL, (fd_set *)NULL,
-           (fd_set *)NULL, &timeout);
+       (void) select(32, NULL, NULL, NULL, &timeout);
        (void)tcflush(0, TCIOFLUSH);
        switch (c & 0377) {
 
index de8304f..04e326f 100644 (file)
@@ -444,7 +444,7 @@ Spawn(const char *prog __unused, const char *acname, const char *provider,
 
       setsid();
       syslog(LOG_INFO, "Executing: %s", exec);
-      execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, (char *)NULL);
+      execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, NULL);
       syslog(LOG_ERR, "execlp failed: %m");
       _exit(EX_OSFILE);
 
index ba50ff8..cb3726a 100644 (file)
@@ -293,10 +293,10 @@ doit(int f, union sockunion *fromp)
                }
                if (authenticated) {
                        execl(_PATH_LOGIN, "login", "-p",
-                           "-h", hostname, "-f", lusername, (char *)NULL);
+                           "-h", hostname, "-f", lusername, NULL);
                } else
                        execl(_PATH_LOGIN, "login", "-p",
-                           "-h", hostname, lusername, (char *)NULL);
+                           "-h", hostname, lusername, NULL);
                fatal(STDERR_FILENO, _PATH_LOGIN, 1);
                /*NOTREACHED*/
        }
@@ -374,7 +374,7 @@ protocol(int f, int p)
                FD_ZERO(&ebits);
                FD_ZERO(&ibits);
                FD_ZERO(&obits);
-               omask = (fd_set *)NULL;
+               omask = NULL;
                if (fcc) {
                        FD_SET(p, &obits);
                        omask = &obits;
index e7f6d05..f321e7c 100644 (file)
@@ -112,7 +112,7 @@ rquota_service(struct svc_req *request, SVCXPRT *transp)
 {
        switch (request->rq_proc) {
        case NULLPROC:
-               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
+               (void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
                break;
 
        case RQUOTAPROC_GETQUOTA:
index 3c7a2f7..8eebc16 100644 (file)
@@ -612,7 +612,7 @@ fail:
                    syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: cmd='%.80s'",
                        remuser, fromhost, locuser, cmdbuf);
        }
-       execl(pwd->pw_shell, cp, "-c", cmdbuf, (char *)NULL);
+       execl(pwd->pw_shell, cp, "-c", cmdbuf, NULL);
        perror(pwd->pw_shell);
        exit(1);
 }
index 4f936a5..3766f03 100644 (file)
@@ -306,7 +306,7 @@ recalculate:
                         * restoring disrtcset, since we don't clean up
                         * anything.
                         */
-                       if (gettimeofday(&tv, (struct timezone *)NULL)) {
+                       if (gettimeofday(&tv, NULL)) {
                                syslog(LOG_ERR, "gettimeofday: %m");
                                return 1;
                        }
index efe0712..e4206ca 100644 (file)
@@ -893,7 +893,7 @@ asn_get_header ( u_char **bufp )
         * Allocate memory to hold the SNMP header
         */
        if ( ( h = (Snmp_Header *)UM_ALLOC(sizeof(Snmp_Header)) ) == NULL )
-               return ( (Snmp_Header *)NULL );
+               return ( NULL );
 
        /*
         * Ensure that we wipe the slate clean
@@ -904,7 +904,7 @@ asn_get_header ( u_char **bufp )
         * PDU has to start as SEQUENCE OF
         */
        if ( *bp++ != ASN_SEQUENCE ) /* Class == Universial, f == 1, tag == SEQUENCE */
-               return ( (Snmp_Header *)NULL );
+               return ( NULL );
 
        /*
         * Get the length of remaining PDU data
@@ -915,7 +915,7 @@ asn_get_header ( u_char **bufp )
         * We expect to find an integer encoding Version-1
         */
        if ( *bp++ != ASN_INTEGER ) {
-               return ( (Snmp_Header *)NULL );
+               return ( NULL );
        }
        h->version = asn_get_int ( &bp, NULL );
 
@@ -923,7 +923,7 @@ asn_get_header ( u_char **bufp )
         * After the version, we need the community name
         */
        if ( *bp++ != ASN_OCTET ) {
-               return ( (Snmp_Header *)NULL );
+               return ( NULL );
        }
        asn_get_octet ( &bp, h->community, NULL );
 
@@ -942,28 +942,28 @@ asn_get_header ( u_char **bufp )
                /* Request ID */
                if ( *bp++ != ASN_INTEGER ) {
                        UM_FREE ( h );
-                       return ( (Snmp_Header *)NULL );
+                       return ( NULL );
                }
                h->reqid = asn_get_int ( &bp, NULL );
 
                /* Error Status */
                if ( *bp++ != ASN_INTEGER ) {
                        UM_FREE ( h );
-                       return ( (Snmp_Header *)NULL );
+                       return ( NULL );
                }
                h->error = asn_get_int ( &bp, NULL );
 
                /* Error Index */
                if ( *bp++ != ASN_INTEGER ) {
                        UM_FREE ( h );
-                       return ( (Snmp_Header *)NULL );
+                       return ( NULL );
                }
                h->erridx = asn_get_int ( &bp, NULL );
 
                /* Sequence of... */
                if ( *bp++ != ASN_SEQUENCE ) {
                        UM_FREE ( h );
-                       return ( (Snmp_Header *)NULL );
+                       return ( NULL );
                }
                h->varlen = ( asn_get_pdu_len ( &bp, &len ) - 1 );
                h->varlen += ( len - 1 );
@@ -1956,7 +1956,7 @@ static void
 Increment_DL ( __unused int sig )
 {
        Debug_Level++;
-       if ( Debug_Level && Log == (FILE *)NULL ) {
+       if ( Debug_Level && Log == NULL ) {
            if ( foregnd ) {
                Log = stderr;
            } else {
index bec4f33..b94642e 100644 (file)
@@ -488,7 +488,7 @@ l_perror(const char *s)
                break;
 
        default:
-               warn((char *)NULL);
+               warn(NULL);
                break;
        }
 }
index d765994..067e03a 100644 (file)
@@ -516,7 +516,7 @@ l_perror(const char *s)
                break;
 
        default:
-               warn((char *)NULL);
+               warn(NULL);
                break;
        }
 }
index abbe6c3..817b3c8 100644 (file)
@@ -337,7 +337,7 @@ trewind(void)
                }
                close(slaves[f].fd);
        }
-       while (wait((int *)NULL) >= 0)  /* wait for any signals from slaves */
+       while (wait(NULL) >= 0) /* wait for any signals from slaves */
                /* void */;
 
        if (pipeout)
index dd0c449..49a66ea 100644 (file)
@@ -1658,7 +1658,7 @@ setprocresources(const char *cname)
 {
        login_cap_t *lc;
        if ((lc = login_getclassbyname(cname, NULL)) != NULL) {
-               setusercontext(lc, (struct passwd*)NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES);
+               setusercontext(lc, NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES);
                login_close(lc);
        }
 }
index 9dc6117..18f72ae 100644 (file)
@@ -309,9 +309,9 @@ main(int argc, char **argv)
                };
        argc -= optind;
        argv += optind;
-       grphead = (struct grouplist *)NULL;
-       exphead = (struct exportlist *)NULL;
-       mlhead = (struct mountlist *)NULL;
+       grphead = NULL;
+       exphead = NULL;
+       mlhead = NULL;
        if (argc == 1) {
                strncpy(exname, *argv, MAXPATHLEN-1);
                exname[MAXPATHLEN-1] = '\0';
@@ -787,7 +787,7 @@ xdr_explist(XDR *xdrsp, caddr_t cp)
                if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, &putdef))
                        goto errout;
                if (ep->ex_defdir && putdef == 0 &&
-                       put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL,
+                       put_exlist(ep->ex_defdir, xdrsp, NULL,
                        &putdef))
                        goto errout;
                ep = ep->ex_next;
@@ -848,7 +848,7 @@ put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp)
                                                return (1);
                                }
                                hp = hp->ht_next;
-                               if (gotalldir && hp == (struct hostlist *)NULL) {
+                               if (gotalldir && hp == NULL) {
                                        hp = adp->dp_hosts;
                                        gotalldir = 0;
                                }
@@ -893,7 +893,7 @@ get_exportlist(void)
                ep = ep->ex_next;
                free_exp(ep2);
        }
-       exphead = (struct exportlist *)NULL;
+       exphead = NULL;
 
        grp = grphead;
        while (grp) {
@@ -901,7 +901,7 @@ get_exportlist(void)
                grp = grp->gr_next;
                free_grp(tgrp);
        }
-       grphead = (struct grouplist *)NULL;
+       grphead = NULL;
 
        /*
         * And delete exports that are in the kernel for all local
@@ -947,7 +947,7 @@ get_exportlist(void)
                syslog(LOG_ERR, "can't open %s", exname);
                exit(2);
        }
-       dirhead = (struct dirlist *)NULL;
+       dirhead = NULL;
        while (get_line()) {
                if (debug)
                        warnx("got line %s", line);
@@ -964,7 +964,7 @@ get_exportlist(void)
                exflags = MNT_EXPORTED;
                got_nondir = 0;
                opt_flags = 0;
-               ep = (struct exportlist *)NULL;
+               ep = NULL;
 
                /*
                 * Create new exports list entry
@@ -977,7 +977,7 @@ get_exportlist(void)
                            goto nextline;
                        }
                        if (*cp == '-') {
-                           if (ep == (struct exportlist *)NULL) {
+                           if (ep == NULL) {
                                getexp_err(ep, tgrp);
                                goto nextline;
                            }
@@ -1011,7 +1011,7 @@ get_exportlist(void)
                                     * in the list.
                                     */
                                    ep = ex_search(&fsb.f_fsid);
-                                   if (ep == (struct exportlist *)NULL) {
+                                   if (ep == NULL) {
                                        ep = get_exp();
                                        ep->ex_fs = fsb.f_fsid;
                                        ep->ex_fsdir = (char *)
@@ -1045,7 +1045,7 @@ get_exportlist(void)
                            savedc = *endcp;
                            *endcp = '\0';
                            got_nondir = 1;
-                           if (ep == (struct exportlist *)NULL) {
+                           if (ep == NULL) {
                                getexp_err(ep, tgrp);
                                goto nextline;
                            }
@@ -1136,11 +1136,11 @@ get_exportlist(void)
                        grp->gr_next = grphead;
                        grphead = tgrp;
                } else {
-                       hang_dirp(dirhead, (struct grouplist *)NULL, ep,
+                       hang_dirp(dirhead, NULL, ep,
                                opt_flags);
                        free_grp(grp);
                }
-               dirhead = (struct dirlist *)NULL;
+               dirhead = NULL;
                if ((ep->ex_flag & EX_LINKED) == 0) {
                        ep2 = exphead;
                        epp = &exphead;
@@ -1160,7 +1160,7 @@ get_exportlist(void)
 nextline:
                if (dirhead) {
                        free_dir(dirhead);
-                       dirhead = (struct dirlist *)NULL;
+                       dirhead = NULL;
                }
        }
        fclose(exp_file);
@@ -1175,7 +1175,7 @@ get_exp(void)
        struct exportlist *ep;
 
        ep = (struct exportlist *)malloc(sizeof (struct exportlist));
-       if (ep == (struct exportlist *)NULL)
+       if (ep == NULL)
                out_of_mem();
        memset(ep, 0, sizeof(struct exportlist));
        return (ep);
@@ -1190,7 +1190,7 @@ get_grp(void)
        struct grouplist *gp;
 
        gp = (struct grouplist *)malloc(sizeof (struct grouplist));
-       if (gp == (struct grouplist *)NULL)
+       if (gp == NULL)
                out_of_mem();
        memset(gp, 0, sizeof(struct grouplist));
        return (gp);
@@ -1242,12 +1242,12 @@ add_expdir(struct dirlist **dpp, char *cp, int len)
        struct dirlist *dp;
 
        dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len);
-       if (dp == (struct dirlist *)NULL)
+       if (dp == NULL)
                out_of_mem();
        dp->dp_left = *dpp;
-       dp->dp_right = (struct dirlist *)NULL;
+       dp->dp_right = NULL;
        dp->dp_flag = 0;
-       dp->dp_hosts = (struct hostlist *)NULL;
+       dp->dp_hosts = NULL;
        strcpy(dp->dp_dirp, cp);
        *dpp = dp;
        return (dp->dp_dirp);
@@ -1269,7 +1269,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep,
                        free((caddr_t)dp);
                else
                        ep->ex_defdir = dp;
-               if (grp == (struct grouplist *)NULL) {
+               if (grp == NULL) {
                        ep->ex_defdir->dp_flag |= DP_DEFSET;
                        if (flags & OP_KERB)
                                ep->ex_defdir->dp_flag |= DP_KERB;
@@ -1320,7 +1320,7 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp,
                        free((caddr_t)newdp);
        } else {
                dp = newdp;
-               dp->dp_left = (struct dirlist *)NULL;
+               dp->dp_left = NULL;
                *dpp = dp;
        }
        if (grp) {
@@ -1695,9 +1695,9 @@ get_ht(void)
        struct hostlist *hp;
 
        hp = (struct hostlist *)malloc(sizeof (struct hostlist));
-       if (hp == (struct hostlist *)NULL)
+       if (hp == NULL)
                out_of_mem();
-       hp->ht_next = (struct hostlist *)NULL;
+       hp->ht_next = NULL;
        hp->ht_flag = 0;
        return (hp);
 }
@@ -2153,13 +2153,13 @@ get_mountlist(void)
                if (host == NULL || dirp == NULL)
                        continue;
                mlp = (struct mountlist *)malloc(sizeof (*mlp));
-               if (mlp == (struct mountlist *)NULL)
+               if (mlp == NULL)
                        out_of_mem();
                strncpy(mlp->ml_host, host, RPCMNT_NAMELEN);
                mlp->ml_host[RPCMNT_NAMELEN] = '\0';
                strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
                mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
-               mlp->ml_next = (struct mountlist *)NULL;
+               mlp->ml_next = NULL;
                *mlpp = mlp;
                mlpp = &mlp->ml_next;
        }
@@ -2217,13 +2217,13 @@ add_mlist(char *hostp, char *dirp)
                mlp = mlp->ml_next;
        }
        mlp = (struct mountlist *)malloc(sizeof (*mlp));
-       if (mlp == (struct mountlist *)NULL)
+       if (mlp == NULL)
                out_of_mem();
        strncpy(mlp->ml_host, hostp, RPCMNT_NAMELEN);
        mlp->ml_host[RPCMNT_NAMELEN] = '\0';
        strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
        mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
-       mlp->ml_next = (struct mountlist *)NULL;
+       mlp->ml_next = NULL;
        *mlpp = mlp;
        if ((mlfile = fopen(_PATH_RMOUNTLIST, "a")) == NULL) {
                syslog(LOG_ERR, "can't update %s", _PATH_RMOUNTLIST);
@@ -2268,7 +2268,7 @@ int
 check_options(struct dirlist *dp)
 {
 
-       if (dp == (struct dirlist *)NULL)
+       if (dp == NULL)
            return (1);
        if ((opt_flags & (OP_MAPROOT | OP_MAPALL)) == (OP_MAPROOT | OP_MAPALL) ||
            (opt_flags & (OP_MAPROOT | OP_KERB)) == (OP_MAPROOT | OP_KERB) ||
index 5d2e9f7..bd07c8a 100644 (file)
@@ -289,7 +289,7 @@ main(int argc, char **argv)
                                err(EX_NOPERM, "-f flag");
                        }
                        options |= F_FLOOD;
-                       setbuf(stdout, (char *)NULL);
+                       setbuf(stdout, NULL);
                        break;
                case 'G': /* Maximum packet size for ping sweep */
                        ultmp = strtoul(optarg, &ep, 0);
index 10ede10..fcf1c3a 100644 (file)
@@ -411,7 +411,7 @@ main(int argc, char **argv)
                                errx(1, "Must be superuser to flood ping");
                        }
                        options |= F_FLOOD;
-                       setbuf(stdout, (char *)NULL);
+                       setbuf(stdout, NULL);
                        break;
                case 'g':
                        gateway = optarg;
index 0faec33..b02fe8d 100644 (file)
@@ -535,7 +535,7 @@ initsymtable(char *filename)
                entrytblsize = maxino / HASHFACTOR;
                entry = (struct entry **)
                        calloc((unsigned)entrytblsize, sizeof(struct entry *));
-               if (entry == (struct entry **)NULL)
+               if (entry == NULL)
                        panic("no memory for entry table\n");
                ep = addentry(".", ROOTINO, NODE);
                ep->e_flags |= NEW;
index 466006a..dec1e92 100644 (file)
@@ -265,7 +265,7 @@ setup(void)
                done(1);
        }
        map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY));
-       if (map == (char *)NULL)
+       if (map == NULL)
                panic("no memory for file dump list\n");
        dumpmap = map;
        curfile.action = USING;
index 9c908e7..a70c66a 100644 (file)
@@ -150,7 +150,7 @@ main(int argc, char **argv)
        int ch;
 
        if (argc < 2)
-               usage((char *)NULL);
+               usage(NULL);
 
        while ((ch = getopt(argc, argv, "c:wnqdtv")) != -1)
                switch(ch) {
@@ -177,7 +177,7 @@ main(int argc, char **argv)
                        break;
                case '?':
                default:
-                       usage((char *)NULL);
+                       usage(NULL);
                }
        argc -= optind;
        argv += optind;
@@ -705,33 +705,33 @@ newroute(int argc, char **argv)
                                break;
                        case K_IFA:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                getaddr(RTA_IFA, *++argv, 0);
                                break;
                        case K_IFP:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                getaddr(RTA_IFP, *++argv, 0);
                                break;
                        case K_GENMASK:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                getaddr(RTA_GENMASK, *++argv, 0);
                                break;
                        case K_GATEWAY:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                getaddr(RTA_GATEWAY, *++argv, 0);
                                break;
                        case K_DST:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                ishost = getaddr(RTA_DST, *++argv, &hp);
                                dest = *argv;
                                break;
                        case K_NETMASK:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                getaddr(RTA_NETMASK, *++argv, 0);
                                /* FALLTHROUGH */
                        case K_NET:
@@ -739,7 +739,7 @@ newroute(int argc, char **argv)
                                break;
                        case K_PREFIXLEN:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                if (prefixlen(*++argv) == -1) {
                                        forcenet = 0;
                                        ishost = 1;
@@ -793,7 +793,7 @@ newroute(int argc, char **argv)
                                af = AF_MPLS;
                                aflen = sizeof(struct sockaddr_mpls);
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                switch(pushcount + swapcount){
                                        case 1:
                                                getaddr(RTA_MPLS1, *++argv, 0);
@@ -815,7 +815,7 @@ newroute(int argc, char **argv)
                        case K_RTT:
                        case K_RTTVAR:
                                if (--argc == 0)
-                                       usage((char *)NULL);
+                                       usage(NULL);
                                set_metric(*++argv, key);
                                break;
                        default:
index cc68a8c..c5c08dd 100644 (file)
@@ -136,13 +136,13 @@ main(int argc, char **argv)
                        break;
                case '?':
                default:
-                       usage((char *)NULL);
+                       usage(NULL);
                }
        argc -= optind;
        argv += optind;
 
        if (argc < 1)
-               usage((char *)NULL);
+               usage(NULL);
 
        if (killflg + doreboot + dohalt + dopower > 1)
                usage("incompatible switches -h, -k, -p and -r");
@@ -354,21 +354,21 @@ die_you_gravy_sucking_pig_dog(void)
        } else {
                if (doreboot) {
                        execle(_PATH_REBOOT, "reboot", "-l", nosync, 
-                               (char *)NULL, empty_environ);
+                               NULL, empty_environ);
                        syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
                                _PATH_REBOOT);
                        warn(_PATH_REBOOT);
                }
                else if (dohalt) {
                        execle(_PATH_HALT, "halt", "-l", nosync,
-                               (char *)NULL, empty_environ);
+                               NULL, empty_environ);
                        syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
                                _PATH_HALT);
                        warn(_PATH_HALT);
                }
                else if (dopower) {
                        execle(_PATH_HALT, "halt", "-l", "-p", nosync,
-                               (char *)NULL, empty_environ);
+                               NULL, empty_environ);
                        syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
                                _PATH_HALT);
                        warn(_PATH_HALT);
index db3c88b..fdd4d8b 100644 (file)
@@ -243,7 +243,7 @@ create_session(void)
        i = forkpty(&ptyfd, buf, 0, 0);
        if (i == 0) {
                execl("/usr/libexec/getty", "getty", "std.300", "-",
-                   (char *)NULL);
+                   NULL);
                syslog(LOG_ERR, "exec getty %d", errno);
                exit(2);
        } else if (i < 0) {
index e15b0cf..44a1545 100644 (file)
@@ -141,7 +141,7 @@ main(int argc, char *argv[])
                                errx(1, "Unreasonable sector size: %s", optarg);
                        break;
                case 's':
-                       user_size = strtoll(optarg, (char **)NULL, /*base*/10);
+                       user_size = strtoll(optarg, NULL, /*base*/10);
                        if (user_size < 0)
                                errx(1, "Unreasonable volume size: %s", optarg);
                        break;
index 5c05ad7..0070dca 100644 (file)
@@ -22,7 +22,7 @@ main(argc, argv)
        machinename = argv[1];
        args.ss.ss_len = argc - 2;     /* substract off progname, machinename */
        args.ss.ss_val = &argv[2];
-       res.ss.ss_val = (char **)NULL;
+       res.ss.ss_val = NULL;
 
        if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT,
            xdr_sortstrings, &args, xdr_sortstrings, &res)))
index 5538faf..209dcb5 100644 (file)
@@ -15,7 +15,7 @@ sort_1(ssp)
 {
     static struct sortstrings ss_res;
 
-    if (ss_res.ss.ss_val != (str *)NULL)
+    if (ss_res.ss.ss_val != NULL)
         free(ss_res.ss.ss_val);
 
     qsort(ssp->ss.ss_val, ssp->ss.ss_len, sizeof (char *), comparestrings);
index cfd512e..150c1fc 100644 (file)
@@ -616,7 +616,7 @@ or
 do not roll your own.
 .Bd -literal
        if ((four = malloc(sizeof(struct foo))) == NULL)
-               err(1, (char *)NULL);
+               err(1, NULL);
        if ((six = (int *)overflow()) == NULL)
                errx(1, "number overflowed");
        return(eight);
index e2d12c4..fea2257 100644 (file)
@@ -3639,7 +3639,7 @@ scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries,
        struct scsi_tape_locate *scmd;
 
        cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action,
-           (u_int8_t *)NULL, 0, sense_len, sizeof(*scmd), timeout);
+           NULL, 0, sense_len, sizeof(*scmd), timeout);
        scmd = (struct scsi_tape_locate *)&csio->cdb_io.cdb_bytes;
        bzero(scmd, sizeof(*scmd));
        scmd->opcode = LOCATE;
index f877492..3f9ac37 100644 (file)
@@ -132,7 +132,7 @@ eni_do_service(Eni_unit *eup)
                 */
                evp = (Eni_vcc *) atm_dev_vcc_find ( (Cmn_unit *)eup,
                    0, vcc, VCC_IN );
-               if ( evp == (Eni_vcc *)NULL )
+               if ( evp == NULL )
                        goto next_vcc;          /* VCI no longer active */
                rdptr = evp->ev_rxpos;
                /*
@@ -323,7 +323,7 @@ eni_do_service(Eni_unit *eup)
                    /*
                     * Do we have a valid buffer?
                     */
-                   if ( m != (KBuffer *)NULL )
+                   if ( m != NULL )
                    {
                        int     len;
                        u_long  *up;
index 5cd8752..e786100 100644 (file)
@@ -707,7 +707,7 @@ doinitialize(struct psm_softc *sc, mousemode_t *mode)
     sc->mode.packetsize = vendortype[i].packetsize;
 
     /* set mouse parameters */
-    if (mode != (mousemode_t *)NULL) {
+    if (mode != NULL) {
        if (mode->rate > 0)
             mode->rate = set_mouse_sampling_rate(kbdc, mode->rate);
        if (mode->resolution >= 0)
index 67e013e..722853d 100644 (file)
@@ -1723,7 +1723,7 @@ iereset(int unit)
        }
        kprintf("ie%d: reset\n", unit);
        ie_softc[unit].arpcom.ac_if.if_flags &= ~IFF_UP;
-       ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL);
+       ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL);
 
        /*
         * Stop i82586 dead in its tracks.
@@ -1741,7 +1741,7 @@ iereset(int unit)
 #endif
 
        ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP;
-       ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL);
+       ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL);
 }
 
 /*
@@ -2142,7 +2142,7 @@ ie_mc_reset(int unit)
                if (ie->mcast_count >= MAXMCAST) {
                        ie->arpcom.ac_if.if_flags |= IFF_ALLMULTI;
                        ieioctl(&ie->arpcom.ac_if, SIOCSIFFLAGS, NULL,
-                               (struct ucred *)NULL);
+                               NULL);
                        goto setflag;
                }
                bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr),
index 1edc6d4..2bb9d6a 100644 (file)
@@ -853,7 +853,7 @@ ASR_queue_c (
         union asr_ccb       * ccb;
         OUT int               status;
 
-        if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+        if ((ccb = asr_alloc_ccb (sc)) == NULL) {
                 return (CAM_REQUEUE_REQ);
         }
 
@@ -939,7 +939,7 @@ ASR_failActiveCommands (
          *      xpt_async (AC_BUS_RESET, sc->ha_path[bus], NULL);
          *  }
          */
-        while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != (struct ccb_hdr *)NULL) {
+        while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != NULL) {
                 ASR_ccbRemove (sc, (union asr_ccb *)ccb);
 
                 ccb->status &= ~CAM_STATUS_MASK;
@@ -992,8 +992,8 @@ STATIC INLINE int
 ASR_getBlinkLedCode (
         IN Asr_softc_t * sc)
 {
-        if ((sc != (Asr_softc_t *)NULL)
-         && (sc->ha_blinkLED != (u_int8_t *)NULL)
+        if ((sc != NULL)
+         && (sc->ha_blinkLED != NULL)
          && (sc->ha_blinkLED[1] == 0xBC)) {
                 return (sc->ha_blinkLED[0]);
         }
@@ -1029,13 +1029,13 @@ ASR_getTidAddress(
          *      sc must be valid before it gets here, so that check could be
          * dropped if speed a critical issue.
          */
-        if ((sc == (Asr_softc_t *)NULL)
+        if ((sc == NULL)
          || (bus > MAX_CHANNEL)
          || (target > sc->ha_MaxId)
          || (lun > sc->ha_MaxLun)) {
                 debug_asr_printf("(%lx,%d,%d,%d) target out of range\n",
                   (u_long)sc, bus, target, lun);
-                return ((tid_t *)NULL);
+                return (NULL);
         }
         /*
          *      See if there is an associated bus list.
@@ -1046,7 +1046,7 @@ ASR_getTidAddress(
          */
 #       define BUS_CHUNK 8
         new_size = ((target + BUS_CHUNK - 1) & ~(BUS_CHUNK - 1));
-        if ((bus_ptr = sc->ha_targets[bus]) == (target2lun_t *)NULL) {
+        if ((bus_ptr = sc->ha_targets[bus]) == NULL) {
                 /*
                  *      Allocate a new structure?
                  *              Since one element in structure, the +1
@@ -1056,9 +1056,9 @@ ASR_getTidAddress(
                  || ((sc->ha_targets[bus] = bus_ptr = (target2lun_t *)kmalloc (
                     sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
                     M_TEMP, M_WAITOK))
-                   == (target2lun_t *)NULL)) {
+                   == NULL)) {
                         debug_asr_printf("failed to allocate bus list\n");
-                        return ((tid_t *)NULL);
+                        return (NULL);
                 }
                 bzero (bus_ptr, sizeof(*bus_ptr)
                   + (sizeof(bus_ptr->LUN) * new_size));
@@ -1075,9 +1075,9 @@ ASR_getTidAddress(
                  || ((new_bus_ptr = (target2lun_t *)kmalloc (
                     sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
                     M_TEMP, M_WAITOK))
-                   == (target2lun_t *)NULL)) {
+                   == NULL)) {
                         debug_asr_printf("failed to reallocate bus list\n");
-                        return ((tid_t *)NULL);
+                        return (NULL);
                 }
                 /*
                  *      Zero and copy the whole thing, safer, simpler coding
@@ -1103,7 +1103,7 @@ ASR_getTidAddress(
         if ((new_size = lun) != 0) {
                 new_size = ((lun + TARGET_CHUNK - 1) & ~(TARGET_CHUNK - 1));
         }
-        if ((target_ptr = bus_ptr->LUN[target]) == (lun2tid_t *)NULL) {
+        if ((target_ptr = bus_ptr->LUN[target]) == NULL) {
                 /*
                  *      Allocate a new structure?
                  *              Since one element in structure, the +1
@@ -1113,9 +1113,9 @@ ASR_getTidAddress(
                  || ((bus_ptr->LUN[target] = target_ptr = (lun2tid_t *)kmalloc (
                     sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
                     M_TEMP, M_WAITOK))
-                   == (lun2tid_t *)NULL)) {
+                   == NULL)) {
                         debug_asr_printf("failed to allocate target list\n");
-                        return ((tid_t *)NULL);
+                        return (NULL);
                 }
                 bzero (target_ptr, sizeof(*target_ptr)
                   + (sizeof(target_ptr->TID) * new_size));
@@ -1132,9 +1132,9 @@ ASR_getTidAddress(
                  || ((new_target_ptr = (lun2tid_t *)kmalloc (
                     sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
                     M_TEMP, M_WAITOK))
-                   == (lun2tid_t *)NULL)) {
+                   == NULL)) {
                         debug_asr_printf("failed to reallocate target list\n");
-                        return ((tid_t *)NULL);
+                        return (NULL);
                 }
                 /*
                  *      Zero and copy the whole thing, safer, simpler coding
@@ -1175,7 +1175,7 @@ ASR_getTid (
 
        crit_enter();
         if (((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, FALSE))
-          == (tid_t *)NULL)
+          == NULL)
         /* (tid_t)0 or (tid_t)-1 indicate no TID */
          || (*tid_ptr == (tid_t)0)) {
                crit_exit();
@@ -1209,7 +1209,7 @@ ASR_setTid (
                 }
                crit_enter();
                 if ((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, TRUE))
-                 == (tid_t *)NULL) {
+                 == NULL) {
                        crit_exit();
                         return ((tid_t)-1);
                 }
@@ -2262,8 +2262,8 @@ ASR_sync (
          * as the OS normally would flush all outstanding commands before
          * issuing a shutdown or an adapter reset).
          */
-        if ((sc != (Asr_softc_t *)NULL)
-         && (LIST_FIRST(&(sc->ha_ccb)) != (struct ccb_hdr *)NULL)
+        if ((sc != NULL)
+         && (LIST_FIRST(&(sc->ha_ccb)) != NULL)
          && ((TID = ASR_getTid (sc, bus, target, lun)) != (tid_t)-1)
          && (TID != (tid_t)0)) {
                 defAlignLong(PRIVATE_SCSI_SCB_EXECUTE_MESSAGE,Message);
@@ -2400,7 +2400,7 @@ asr_pci_map_mem (
         p &= ~15;
         sc->ha_mem_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid,
           p, p + l, l, RF_ACTIVE);
-        if (sc->ha_mem_res == (struct resource *)NULL) {
+        if (sc->ha_mem_res == NULL) {
                 return (0);
         }
         sc->ha_Base = (void *)rman_get_start(sc->ha_mem_res);
@@ -2423,7 +2423,7 @@ asr_pci_map_mem (
                 p &= ~15;
                 sc->ha_mes_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid,
                   p, p + l, l, RF_ACTIVE);
-                if (sc->ha_mes_res == (struct resource *)NULL) {
+                if (sc->ha_mes_res == NULL) {
                         return (0);
                 }
                 if ((void *)rman_get_start(sc->ha_mes_res) == NULL) {
@@ -2450,7 +2450,7 @@ asr_pci_map_int (
 
         sc->ha_irq_res = bus_alloc_resource(tag, SYS_RES_IRQ, &rid,
           0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
-        if (sc->ha_irq_res == (struct resource *)NULL) {
+        if (sc->ha_irq_res == NULL) {
                 return (0);
         }
        error = bus_setup_intr(tag, sc->ha_irq_res, 0,
@@ -2474,7 +2474,7 @@ asr_attach (ATTACH_ARGS)
         ATTACH_SET();
 
         sc = kmalloc(sizeof(*sc), M_DEVBUF, M_INTWAIT | M_ZERO);
-        if (Asr_softc == (Asr_softc_t *)NULL) {
+        if (Asr_softc == NULL) {
                 /*
                  *      Fixup the OS revision as saved in the dptsig for the
                  *      engine (dptioctl.h) to pick up.
@@ -2727,7 +2727,7 @@ asr_attach (ATTACH_ARGS)
                 int             bus;
                 union asr_ccb * ccb;
 
-                if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+                if ((ccb = asr_alloc_ccb (sc)) == NULL) {
                         kprintf ("asr%d: CAM could not be notified of asynchronous callback parameters\n", unit);
                         ATTACH_RETURN(ENOMEM);
                 }
@@ -3087,7 +3087,7 @@ asr_intr (
                  * and a generic handler for immunity against odd error
                  * returns from the adapter.
                  */
-                if (ccb == (union asr_ccb *)NULL) {
+                if (ccb == NULL) {
                         /*
                          * Return Reply so that it can be used for the
                          * next command
@@ -3238,7 +3238,7 @@ asr_open(struct dev_open_args *ap)
        cdev_t dev = ap->a_head.a_dev;
         OUT int error;
 
-        if (ASR_get_sc (dev) == (Asr_softc_t *)NULL) {
+        if (ASR_get_sc (dev) == NULL) {
                 return (ENODEV);
         }
        crit_enter();
@@ -3571,7 +3571,7 @@ ASR_queue_i(
                 }
                 if (error) {
                         while ((elm = SLIST_FIRST(&sgList))
-                          != (struct ioctlSgList_S *)NULL) {
+                          != NULL) {
                                 SLIST_REMOVE_HEAD(&sgList, link);
                                 kfree (elm, M_TEMP);
                         }
@@ -3585,10 +3585,10 @@ ASR_queue_i(
         debug_usr_cmd_dump_message(Message_Ptr);
 
         /* Send the command */
-        if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+        if ((ccb = asr_alloc_ccb (sc)) == NULL) {
                 /* Free up in-kernel buffers */
                 while ((elm = SLIST_FIRST(&sgList))
-                  != (struct ioctlSgList_S *)NULL) {
+                  != NULL) {
                         SLIST_REMOVE_HEAD(&sgList, link);
                         kfree (elm, M_TEMP);
                 }
@@ -3625,7 +3625,7 @@ ASR_queue_i(
                        crit_exit();
                         /* Free up in-kernel buffers */
                         while ((elm = SLIST_FIRST(&sgList))
-                          != (struct ioctlSgList_S *)NULL) {
+                          != NULL) {
                                 SLIST_REMOVE_HEAD(&sgList, link);
                                 kfree (elm, M_TEMP);
                         }
@@ -3667,7 +3667,7 @@ ASR_queue_i(
         }
 
         /* Free up in-kernel buffers */
-        while ((elm = SLIST_FIRST(&sgList)) != (struct ioctlSgList_S *)NULL) {
+        while ((elm = SLIST_FIRST(&sgList)) != NULL) {
                 /* Copy out as necessary */
                 if ((error == 0)
                 /* DIR bit considered `valid', error due to ignorance works */
@@ -3715,7 +3715,7 @@ asr_ioctl(struct dev_ioctl_args *ap)
         OUT int       error = 0;
         Asr_softc_t * sc = ASR_get_sc (dev);
 
-        if (sc != (Asr_softc_t *)NULL)
+        if (sc != NULL)
         switch(ap->a_cmd) {
 
         case DPT_SIGNATURE:
index dd6947c..63dd685 100644 (file)
@@ -107,7 +107,7 @@ struct twa_message  twa_aen_table[] = {
        {0x00FD, "Handler lockup"},
        {0x00FE, "Retrying PCI transfer"},
        {0x00FF, "AEN queue is full"},
-       {0xFFFFFFFF, (char *)NULL}
+       {0xFFFFFFFF, NULL}
 };
 
 /* AEN severity table. */
@@ -117,7 +117,7 @@ char        *twa_aen_severity_table[] = {
        "WARNING",
        "INFO",
        "DEBUG",
-       (char *)NULL
+       NULL
 };
 
 /* Error messages. */
@@ -234,7 +234,7 @@ struct twa_message  twa_error_table[] = {
        {0x025B, "Invalid LBA offset specified in CreateUnit descriptor"},
        {0x025C, "Invalid stripelet size specified in CreateUnit descriptor"},
        {0x0260, "SMART attribute exceeded threshold"},
-       {0xFFFFFFFF, (char *)NULL}
+       {0xFFFFFFFF, NULL}
 };
     
 #ifdef TWA_DEBUG
index 06e5111..58e212b 100644 (file)
@@ -306,32 +306,32 @@ static stlbrd_t           *stl_brds[STL_MAXBRDS];
  *     referencing boards when printing trace and stuff.
  */
 static char    *stl_brdnames[] = {
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
        "EasyIO",
        "EC8/32-AT",
        "EC8/32-MC",
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
+       NULL,
+       NULL,
+       NULL,
        "EC8/32-PCI",
        "EC8/64-PCI",
        "EasyIO-PCI",
@@ -824,7 +824,7 @@ static int stl_findfreeunit(void)
        int     i;
 
        for (i = 0; (i < STL_MAXBRDS); i++)
-               if (stl_brds[i] == (stlbrd_t *) NULL)
+               if (stl_brds[i] == NULL)
                        break;
        return((i >= STL_MAXBRDS) ? -1 : i);
 }
@@ -991,11 +991,11 @@ static const char *stlpciprobe(pcici_t tag, pcidi_t type)
         }
 
         if (brdtype == 0)
-                return((char *) NULL);
+                return(NULL);
 
         class = pci_conf_read(tag, PCI_CLASS_REG);
         if ((class & PCI_CLASS_MASK) == PCI_CLASS_MASS_STORAGE)
-                return((char *) NULL);
+                return(NULL);
 
         return(stl_brdnames[brdtype]);
 }
@@ -1159,7 +1159,7 @@ STATIC int stlopen(struct dev_open_args *ap)
                return(0);
 
        portp = stl_dev2port(dev);
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return(ENXIO);
         if (minor(dev) & STL_CTRLDEV)
                 return(0);
@@ -1276,7 +1276,7 @@ STATIC int stlclose(struct dev_close_args *ap)
                 return(0);
 
        portp = stl_dev2port(dev);
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return(ENXIO);
        tp = &portp->tty;
 
@@ -1337,7 +1337,7 @@ STATIC int stlioctl(struct dev_ioctl_args *ap)
                return(stl_memioctl(dev, cmd, data, ap->a_fflag));
 
        portp = stl_dev2port(dev);
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return(ENODEV);
        tp = &portp->tty;
        error = 0;
@@ -1506,8 +1506,8 @@ STATIC stlport_t *stl_dev2port(cdev_t dev)
        stlbrd_t        *brdp;
 
        brdp = stl_brds[MKDEV2BRD(dev)];
-       if (brdp == (stlbrd_t *) NULL)
-               return((stlport_t *) NULL);
+       if (brdp == NULL)
+               return(NULL);
        return(brdp->ports[MKDEV2PORT(dev)]);
 }
 
@@ -1709,7 +1709,7 @@ static void stl_flush(stlport_t *portp, int flag)
        kprintf("stl_flush(portp=%x,flag=%x)\n", (int) portp, flag);
 #endif
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        crit_enter();
@@ -1767,7 +1767,7 @@ void stlintr(void *arg)
 #endif
 
         for (i = 0; (i < stl_nrbrds); i++) {
-                if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL)
+                if ((brdp = stl_brds[i]) == NULL)
                         continue;
                 if (brdp->state == 0)
                         continue;
@@ -1961,10 +1961,10 @@ static void stl_poll(void *arg)
 
        crit_enter();
        for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) {
-               if ((brdp = stl_brds[brdnr]) == (stlbrd_t *) NULL)
+               if ((brdp = stl_brds[brdnr]) == NULL)
                        continue;
                for (portnr = 0; (portnr < brdp->nrports); portnr++) {
-                       if ((portp = brdp->ports[portnr]) == (stlport_t *) NULL)
+                       if ((portp = brdp->ports[portnr]) == NULL)
                                continue;
                        if ((portp->state & ASY_ACTIVE) == 0)
                                continue;
@@ -2106,7 +2106,7 @@ static int stl_param(struct tty *tp, struct termios *tiosp)
         stlport_t       *portp;
 
         portp = (stlport_t *) tp;
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return(ENODEV);
 
         return(stl_setport(portp, tiosp));
@@ -2548,7 +2548,7 @@ static int stl_brdinit(stlbrd_t *brdp)
 
        for (i = 0, k = 0; (i < STL_MAXPANELS); i++) {
                panelp = brdp->panels[i];
-               if (panelp != (stlpanel_t *) NULL) {
+               if (panelp != NULL) {
                        stl_initports(brdp, panelp);
                        for (j = 0; (j < panelp->nrports); j++)
                                brdp->ports[k++] = panelp->ports[j];
@@ -2577,7 +2577,7 @@ static int stl_getbrdstats(caddr_t data)
        if (stl_brdstats.brd >= STL_MAXBRDS)
                return(-ENODEV);
        brdp = stl_brds[stl_brdstats.brd];
-       if (brdp == (stlbrd_t *) NULL)
+       if (brdp == NULL)
                return(-ENODEV);
 
        bzero(&stl_brdstats, sizeof(combrd_t));
@@ -2613,17 +2613,17 @@ static stlport_t *stl_getport(int brdnr, int panelnr, int portnr)
        stlpanel_t      *panelp;
 
        if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
-               return((stlport_t *) NULL);
+               return(NULL);
        brdp = stl_brds[brdnr];
-       if (brdp == (stlbrd_t *) NULL)
-               return((stlport_t *) NULL);
+       if (brdp == NULL)
+               return(NULL);
        if ((panelnr < 0) || (panelnr >= brdp->nrpanels))
-               return((stlport_t *) NULL);
+               return(NULL);
        panelp = brdp->panels[panelnr];
-       if (panelp == (stlpanel_t *) NULL)
-               return((stlport_t *) NULL);
+       if (panelp == NULL)
+               return(NULL);
        if ((portnr < 0) || (portnr >= panelp->nrports))
-               return((stlport_t *) NULL);
+               return(NULL);
        return(panelp->ports[portnr]);
 }
 
@@ -2639,11 +2639,11 @@ static int stl_getportstats(stlport_t *portp, caddr_t data)
 {
        unsigned char   *head, *tail;
 
-       if (portp == (stlport_t *) NULL) {
+       if (portp == NULL) {
                stl_comstats = *((comstats_t *) data);
                portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
                        stl_comstats.port);
-               if (portp == (stlport_t *) NULL)
+               if (portp == NULL)
                        return(-ENODEV);
        }
 
@@ -2680,11 +2680,11 @@ static int stl_getportstats(stlport_t *portp, caddr_t data)
 
 static int stl_clrportstats(stlport_t *portp, caddr_t data)
 {
-       if (portp == (stlport_t *) NULL) {
+       if (portp == NULL) {
                stl_comstats = *((comstats_t *) data);
                portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
                        stl_comstats.port);
-               if (portp == (stlport_t *) NULL)
+               if (portp == NULL)
                        return(ENODEV);
        }
 
@@ -2715,10 +2715,10 @@ static int stl_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag)
 
         switch (cmd) {
         case COM_GETPORTSTATS:
-                rc = stl_getportstats((stlport_t *) NULL, data);
+                rc = stl_getportstats(NULL, data);
                 break;
         case COM_CLRPORTSTATS:
-                rc = stl_clrportstats((stlport_t *) NULL, data);
+                rc = stl_clrportstats(NULL, data);
                 break;
         case COM_GETBRDSTATS:
                 rc = stl_getbrdstats(data);
@@ -2777,7 +2777,7 @@ static void stl_cd1400flush(stlport_t *portp, int flag)
         kprintf("stl_cd1400flush(portp=%x,flag=%x)\n", (int) portp, flag);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return;
 
         crit_enter();
@@ -3429,7 +3429,7 @@ static int stl_cd1400datastate(stlport_t *portp)
         kprintf("stl_cd1400datastate(portp=%x)\n", (int) portp);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return(0);
 
         return((portp->state & ASY_TXBUSY) ? 1 : 0);
@@ -3660,8 +3660,8 @@ static void stl_cd1400portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *po
                 (int) brdp, (int) panelp, (int) portp);
 #endif
 
-        if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
-            (portp == (stlport_t *) NULL))
+        if ((brdp == NULL) || (panelp == NULL) ||
+            (portp == NULL))
                 return;
 
         portp->ioaddr = panelp->iobase + (((brdp->brdtype == BRD_ECHPCI) ||
@@ -3851,8 +3851,8 @@ static void stl_sc26198portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *p
                 (int) brdp, (int) panelp, (int) portp);
 #endif
 
-        if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
-            (portp == (stlport_t *) NULL))
+        if ((brdp == NULL) || (panelp == NULL) ||
+            (portp == NULL))
                 return;
 
         portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4);
@@ -4248,7 +4248,7 @@ static void stl_sc26198sendflow(stlport_t *portp, int hw, int sw)
                 (int) portp, hw, sw);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return;
 
         crit_enter();
@@ -4308,7 +4308,7 @@ static int stl_sc26198datastate(stlport_t *portp)
         kprintf("stl_sc26198datastate(portp=%x)\n", (int) portp);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return(0);
         if (portp->state & ASY_TXBUSY) 
                 return(1);
@@ -4331,7 +4331,7 @@ static void stl_sc26198flush(stlport_t *portp, int flag)
         kprintf("stl_sc26198flush(portp=%x,flag=%x)\n", (int) portp, flag);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return;
 
         crit_enter();
@@ -4383,7 +4383,7 @@ static void stl_sc26198wait(stlport_t *portp)
         kprintf("stl_sc26198wait(portp=%x)\n", (int) portp);
 #endif
 
-        if (portp == (stlport_t *) NULL)
+        if (portp == NULL)
                 return;
 
         for (i = 0; (i < 20); i++)
index 233b906..577a1ae 100644 (file)
@@ -308,18 +308,18 @@ static char       *stli_brdnames[] = {
        "Brumby",
        "Brumby",
        "ONboard-EI",
-       (char *) NULL,
+       NULL,
        "ONboard",
        "ONboard-MC",
        "ONboard-MC",
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
        "EasyIO",
        "EC8/32-AT",
        "EC8/32-MC",
@@ -668,7 +668,7 @@ static int stli_findfreeunit(void)
        int     i;
 
        for (i = 0; (i < STL_MAXBRDS); i++)
-               if (stli_brds[i] == (stlibrd_t *) NULL)
+               if (stli_brds[i] == NULL)
                        break;
        return((i >= STL_MAXBRDS) ? -1 : i);
 }
@@ -802,7 +802,7 @@ static int stliprobe(struct isa_device *idp)
  *     Go ahead and try probing for the shared memory region now.
  *     This way we will really know if the board is here...
  */
-       if ((brdp = stli_brdalloc()) == (stlibrd_t *) NULL)
+       if ((brdp = stli_brdalloc()) == NULL)
                return(0);
 
        brdp->brdnr = stli_findfreeunit();
@@ -821,7 +821,7 @@ static int stliprobe(struct isa_device *idp)
        stli_stliprobed[idp->id_unit] = brdp->brdnr;
        stli_brdinit(brdp);
        if ((brdp->state & BST_FOUND) == 0) {
-               stli_brds[brdp->brdnr] = (stlibrd_t *) NULL;
+               stli_brds[brdp->brdnr] = NULL;
                return(0);
        }
        stli_nrbrds++;
@@ -846,7 +846,7 @@ static int stliattach(struct isa_device *idp)
 
        brdnr = stli_stliprobed[idp->id_unit];
        brdp = stli_brds[brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(0);
        if (brdp->state & BST_FOUND)
                stli_brdattach(brdp);
@@ -875,7 +875,7 @@ STATIC int stliopen(struct dev_open_args *ap)
                return(0);
 
        portp = stli_dev2port(dev);
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return(ENXIO);
        if (minor(dev) & STL_CTRLDEV)
                return(0);
@@ -1004,7 +1004,7 @@ STATIC int stliclose(struct dev_close_args *ap)
                return(0);
 
        portp = stli_dev2port(dev);
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return(ENXIO);
        tp = &portp->tty;
 
@@ -1034,7 +1034,7 @@ STATIC int stliread(struct dev_read_args *ap)
                return(ENODEV);
 
        portp = stli_dev2port(dev);
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return(ENODEV);
        return ttyread(ap);
 }
@@ -1083,7 +1083,7 @@ STATIC int stliwrite(struct dev_write_args *ap)
        if (minor(dev) & STL_CTRLDEV)
                return(ENODEV);
        portp = stli_dev2port(dev);
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return(ENODEV);
        return ttywrite(ap);
 }
@@ -1111,9 +1111,9 @@ STATIC int stliioctl(struct dev_ioctl_args *ap)
                return(stli_memioctl(dev, cmd, data, ap->a_fflag));
 
        portp = stli_dev2port(dev);
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return(ENODEV);
-       if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+       if ((brdp = stli_brds[portp->brdnr]) == NULL)
                return(ENODEV);
        tp = &portp->tty;
        error = 0;
@@ -1308,10 +1308,10 @@ STATIC stliport_t *stli_dev2port(cdev_t dev)
        stlibrd_t       *brdp;
 
        brdp = stli_brds[MKDEV2BRD(dev)];
-       if (brdp == (stlibrd_t *) NULL)
-               return((stliport_t *) NULL);
+       if (brdp == NULL)
+               return(NULL);
        if ((brdp->state & BST_STARTED) == 0)
-               return((stliport_t *) NULL);
+               return(NULL);
        return(brdp->ports[MKDEV2PORT(dev)]);
 }
 
@@ -1336,7 +1336,7 @@ static int stli_initopen(stliport_t *portp)
        kprintf("stli_initopen(portp=%x)\n", (int) portp);
 #endif
 
-       if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+       if ((brdp = stli_brds[portp->brdnr]) == NULL)
                return(ENXIO);
        if (portp->state & ST_INITIALIZED)
                return(0);
@@ -1390,7 +1390,7 @@ static int stli_shutdownclose(stliport_t *portp)
                (void *) portp, portp->brdnr, portp->panelnr, portp->portnr);
 #endif
 
-       if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+       if ((brdp = stli_brds[portp->brdnr]) == NULL)
                return(ENXIO);
 
        tp = &portp->tty;
@@ -1687,7 +1687,7 @@ static void stli_start(struct tty *tp)
  */
        if (tp->t_outq.c_cc != 0) {
                brdp = stli_brds[portp->brdnr];
-               if (brdp == (stlibrd_t *) NULL) {
+               if (brdp == NULL) {
                        crit_exit();
                        return;
                }
@@ -1761,7 +1761,7 @@ static int stli_param(struct tty *tp, struct termios *tiosp)
        int             rc;
 
        portp = (stliport_t *) tp;
-       if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+       if ((brdp = stli_brds[portp->brdnr]) == NULL)
                return(ENXIO);
 
        crit_enter();
@@ -1791,12 +1791,12 @@ static void stli_flush(stliport_t *portp, int flag)
        kprintf("stli_flush(portp=%x,flag=%x)\n", (int) portp, flag);
 #endif
 
-       if (portp == (stliport_t *) NULL)
+       if (portp == NULL)
                return;
        if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds))
                return;
        brdp = stli_brds[portp->brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return;
 
        crit_enter();
@@ -1980,7 +1980,7 @@ static void stli_rxprocess(stlibrd_t *brdp, stliport_t *portp)
                                tail -= size;
                }
                rp->tail = tail;
-               stli_rxtmpport = (stliport_t *) NULL;
+               stli_rxtmpport = NULL;
                stli_rxtmplen = 0;
        }
 
@@ -2268,7 +2268,7 @@ static void stli_poll(void *arg)
  */
        for (brdnr = 0; (brdnr < stli_nrbrds); brdnr++) {
                brdp = stli_brds[brdnr];
-               if (brdp == (stlibrd_t *) NULL)
+               if (brdp == NULL)
                        continue;
                if ((brdp->state & BST_STARTED) == 0)
                        continue;
@@ -3294,7 +3294,7 @@ static int stli_startbrd(stlibrd_t *brdp)
                if (memp->dtype != TYP_ASYNC)
                        break;
                portp = brdp->ports[portnr];
-               if (portp == (stliport_t *) NULL)
+               if (portp == NULL)
                        break;
                portp->devnr = i;
                portp->addr = memp->offset;
@@ -3313,12 +3313,12 @@ static int stli_startbrd(stlibrd_t *brdp)
  */
        for (i = 1, portnr = 0; (i < nrdevs); i++, portnr++) {
                portp = brdp->ports[portnr];
-               if (portp == (stliport_t *) NULL)
+               if (portp == NULL)
                        break;
                if (portp->addr == 0)
                        break;
                ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr);
-               if (ap != (volatile cdkasy_t *) NULL) {
+               if (ap != NULL) {
                        portp->rxsize = ap->rxq.size;
                        portp->txsize = ap->txq.size;
                        portp->rxoffset = ap->rxq.offset;
@@ -3439,7 +3439,7 @@ static int stli_getbrdstats(caddr_t data)
        if (stli_brdstats.brd >= STL_MAXBRDS)
                return(ENODEV);
        brdp = stli_brds[stli_brdstats.brd];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(ENODEV);
 
        bzero(&stli_brdstats, sizeof(combrd_t));
@@ -3473,14 +3473,14 @@ static stliport_t *stli_getport(int brdnr, int panelnr, int portnr)
        int             i;
 
        if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
-               return((stliport_t *) NULL);
+               return(NULL);
        brdp = stli_brds[brdnr];
-       if (brdp == (stlibrd_t *) NULL)
-               return((stliport_t *) NULL);
+       if (brdp == NULL)
+               return(NULL);
        for (i = 0; (i < panelnr); i++)
                portnr += brdp->panels[i];
        if ((portnr < 0) || (portnr >= brdp->nrports))
-               return((stliport_t *) NULL);
+               return(NULL);
        return(brdp->ports[portnr]);
 }
 
@@ -3497,16 +3497,16 @@ static int stli_getportstats(stliport_t *portp, caddr_t data)
        stlibrd_t       *brdp;
        int             rc;
 
-       if (portp == (stliport_t *) NULL) {
+       if (portp == NULL) {
                stli_comstats = *((comstats_t *) data);
                portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
                        stli_comstats.port);
-               if (portp == (stliport_t *) NULL)
+               if (portp == NULL)
                        return(ENODEV);
        }
 
        brdp = stli_brds[portp->brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(ENODEV);
 
        if (brdp->state & BST_STARTED) {
@@ -3563,16 +3563,16 @@ static int stli_clrportstats(stliport_t *portp, caddr_t data)
        stlibrd_t       *brdp;
        int             rc;
 
-       if (portp == (stliport_t *) NULL) {
+       if (portp == NULL) {
                stli_comstats = *((comstats_t *) data);
                portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
                        stli_comstats.port);
-               if (portp == (stliport_t *) NULL)
+               if (portp == NULL)
                        return(ENODEV);
        }
 
        brdp = stli_brds[portp->brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(ENODEV);
 
        if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0)
@@ -3609,7 +3609,7 @@ STATIC int stli_memrw(cdev_t dev, struct uio *uiop, int flag)
 
        brdnr = minor(dev) & 0x7;
        brdp = stli_brds[brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(ENODEV);
        if (brdp->state == 0)
                return(ENODEV);
@@ -3659,10 +3659,10 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag)
  */
        switch (cmd) {
        case COM_GETPORTSTATS:
-               return(stli_getportstats((stliport_t *) NULL, data));
+               return(stli_getportstats(NULL, data));
                break;
        case COM_CLRPORTSTATS:
-               return(stli_clrportstats((stliport_t *) NULL, data));
+               return(stli_clrportstats(NULL, data));
                break;
        case COM_GETBRDSTATS:
                return(stli_getbrdstats(data));
@@ -3676,7 +3676,7 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag)
  */
        brdnr = minor(dev) & 0x7;
        brdp = stli_brds[brdnr];
-       if (brdp == (stlibrd_t *) NULL)
+       if (brdp == NULL)
                return(ENODEV);
        if (brdp->state == 0)
                return(ENODEV);
@@ -3702,10 +3702,10 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag)
                }
                break;
        case COM_GETPORTSTATS:
-               rc = stli_getportstats((stliport_t *) NULL, data);
+               rc = stli_getportstats(NULL, data);
                break;
        case COM_CLRPORTSTATS:
-               rc = stli_clrportstats((stliport_t *) NULL, data);
+               rc = stli_clrportstats(NULL, data);
                break;
        case COM_GETBRDSTATS:
                rc = stli_getbrdstats(data);
index ceb2c0d..750c614 100644 (file)
@@ -1198,13 +1198,13 @@ ntoskrnl_free_ansi_string(ndis_ansi_string *astr)
 static int
 atoi(const char *str)
 {
-       return (int)strtol(str, (char **)NULL, 10);
+       return (int)strtol(str, NULL, 10);
 }
 
 static long
 atol(const char *str)
 {
-       return strtol(str, (char **)NULL, 10);
+       return strtol(str, NULL, 10);
 }
 
 static int
index e519cc5..ff27d8e 100644 (file)
@@ -463,7 +463,7 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s,
                p++;            /* assume all entries <= BMAX */
        } while (--i);
        if (c[0] == n) {        /* null input--all zero length codes */
-               *t = (struct huft *) NULL;
+               *t = NULL;
                *m = 0;
                return 0;
        }
@@ -510,8 +510,8 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s,
        p = v;                  /* grab values in bit order */
        h = -1;                 /* no tables yet--level -1 */
        w = l[-1] = 0;          /* no bits decoded yet */
-       u[0] = (struct huft *) NULL;    /* just to keep compilers happy */
-       q = (struct huft *) NULL;       /* ditto */
+       u[0] = NULL;            /* just to keep compilers happy */
+       q = NULL;               /* ditto */
        z = 0;                  /* ditto */
 
        /* go through the bit lengths (k already is bits in shortest code) */
@@ -558,7 +558,7 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s,
                                glbl->gz_hufts += z + 1;        /* track memory usage */
                                *t = q + 1;     /* link to list for
                                                 * huft_free() */
-                               *(t = &(q->v.t)) = (struct huft *) NULL;
+                               *(t = &(q->v.t)) = NULL;
                                u[h] = ++q;     /* table starts after link */
 
                                /* connect to last table, if there is one */
@@ -627,7 +627,7 @@ huft_free(struct inflate *glbl, struct huft *t)
 
        /* Go through linked list, freeing from the malloced (t[-1]) address. */
        p = t;
-       while (p != (struct huft *) NULL) {
+       while (p != NULL) {
                q = (--p)->v.t;
                kfree(p, M_GZIP);
                p = q;
@@ -784,7 +784,7 @@ static int
 inflate_fixed(struct inflate *glbl)
 {
        /* if first time, set up tables for fixed blocks */
-       if (glbl->gz_fixed_tl == (struct huft *) NULL) {
+       if (glbl->gz_fixed_tl == NULL) {
                int             i;      /* temporary variable */
                static unsigned l[288]; /* length list for huft_build */
 
@@ -801,7 +801,7 @@ inflate_fixed(struct inflate *glbl)
                glbl->gz_fixed_bl = 7;
                if ((i = huft_build(glbl, l, 288, 257, cplens, cplext,
                            &glbl->gz_fixed_tl, &glbl->gz_fixed_bl)) != 0) {
-                       glbl->gz_fixed_tl = (struct huft *) NULL;
+                       glbl->gz_fixed_tl = NULL;
                        return i;
                }
                /* distance table */
@@ -812,7 +812,7 @@ inflate_fixed(struct inflate *glbl)
                if ((i = huft_build(glbl, l, 30, 0, cpdist, cpdext,
                             &glbl->gz_fixed_td, &glbl->gz_fixed_bd)) > 1) {
                        huft_free(glbl, glbl->gz_fixed_tl);
-                       glbl->gz_fixed_tl = (struct huft *) NULL;
+                       glbl->gz_fixed_tl = NULL;
                        return i;
                }
        }
@@ -1012,7 +1012,7 @@ xinflate(struct inflate *glbl)
        int             r;      /* result code */
        unsigned        h;      /* maximum struct huft's malloc'ed */
 
-       glbl->gz_fixed_tl = (struct huft *) NULL;
+       glbl->gz_fixed_tl = NULL;
 
        /* initialize window, bit buffer */
        glbl->gz_wp = 0;
@@ -1055,13 +1055,13 @@ inflate(struct inflate *glbl)
 #endif
        i = xinflate(glbl);
 
-       if (glbl->gz_fixed_td != (struct huft *) NULL) {
+       if (glbl->gz_fixed_td != NULL) {
                huft_free(glbl, glbl->gz_fixed_td);
-               glbl->gz_fixed_td = (struct huft *) NULL;
+               glbl->gz_fixed_td = NULL;
        }
-       if (glbl->gz_fixed_tl != (struct huft *) NULL) {
+       if (glbl->gz_fixed_tl != NULL) {
                huft_free(glbl, glbl->gz_fixed_tl);
-               glbl->gz_fixed_tl = (struct huft *) NULL;
+               glbl->gz_fixed_tl = NULL;
        }
 #ifdef _KERNEL
        if (p == glbl->gz_slide) {
index 46d230b..dfee4d2 100644 (file)
@@ -509,7 +509,7 @@ literal:
                                u_quad_t res;
 
                                *p = 0;
-                               res = (*ccfn)(buf, (char **)NULL, base);
+                               res = (*ccfn)(buf, NULL, base);
                                if (flags & POINTER)
                                        *__va_arg(ap, void **) =
                                                (void *)(uintptr_t)res;
index 2b6ca59..774f90e 100644 (file)
@@ -196,7 +196,7 @@ found:
                        return (pr);
 
                if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
-                   pr->pr_protocol == 0 && maybe == (struct protosw *)NULL)
+                   pr->pr_protocol == 0 && maybe == NULL)
                        maybe = pr;
        }
        return (maybe);
index b591c76..98100d6 100644 (file)
@@ -770,7 +770,7 @@ if_rtdel(struct radix_node *rn, void *arg)
 
                err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
                                rt_mask(rt), rt->rt_flags,
-                               (struct rtentry **) NULL);
+                               NULL);
                if (err) {
                        log(LOG_WARNING, "if_rtdel: error %d\n", err);
                }
@@ -1586,7 +1586,7 @@ ifpromisc(struct ifnet *ifp, int pswitch)
        ifr.ifr_flagshigh = ifp->if_flags >> 16;
        lwkt_serialize_enter(ifp->if_serializer);
        error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
-                                (struct ucred *)NULL);
+                                NULL);
        lwkt_serialize_exit(ifp->if_serializer);
        if (error == 0)
                rt_ifmsg(ifp);
@@ -1704,7 +1704,7 @@ if_allmulti(struct ifnet *ifp, int onswitch)
                        ifr.ifr_flagshigh = ifp->if_flags >> 16;
                        lwkt_serialize_enter(ifp->if_serializer);
                        error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
-                                             (struct ucred *)NULL);
+                                             NULL);
                        lwkt_serialize_exit(ifp->if_serializer);
                }
        } else {
@@ -1717,7 +1717,7 @@ if_allmulti(struct ifnet *ifp, int onswitch)
                        ifr.ifr_flagshigh = ifp->if_flags >> 16;
                        lwkt_serialize_enter(ifp->if_serializer);
                        error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
-                                             (struct ucred *)NULL);
+                                             NULL);
                        lwkt_serialize_exit(ifp->if_serializer);
                }
        }
@@ -1818,7 +1818,7 @@ if_addmulti(
         */
        crit_enter();
        lwkt_serialize_enter(ifp->if_serializer);
-       ifp->if_ioctl(ifp, SIOCADDMULTI, 0, (struct ucred *)NULL);
+       ifp->if_ioctl(ifp, SIOCADDMULTI, 0, NULL);
        lwkt_serialize_exit(ifp->if_serializer);
        crit_exit();
 
@@ -1855,7 +1855,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
         */
        if (ifma->ifma_addr->sa_family == AF_LINK && sa == 0) {
                lwkt_serialize_enter(ifp->if_serializer);
-               ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL);
+               ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL);
                lwkt_serialize_exit(ifp->if_serializer);
        }
        crit_exit();
@@ -1889,7 +1889,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
        crit_enter();
        lwkt_serialize_enter(ifp->if_serializer);
        LIST_REMOVE(ifma, ifma_link);
-       ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL);
+       ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL);
        lwkt_serialize_exit(ifp->if_serializer);
        crit_exit();
        kfree(ifma->ifma_addr, M_IFMADDR);
@@ -1939,12 +1939,12 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len)
                ifr.ifr_flags = ifp->if_flags;
                ifr.ifr_flagshigh = ifp->if_flags >> 16;
                ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
-                             (struct ucred *)NULL);
+                             NULL);
                ifp->if_flags |= IFF_UP;
                ifr.ifr_flags = ifp->if_flags;
                ifr.ifr_flagshigh = ifp->if_flags >> 16;
                ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
-                                (struct ucred *)NULL);
+                                NULL);
 #ifdef INET
                /*
                 * Also send gratuitous ARPs to notify other nodes about
index 79f7468..28dafec 100644 (file)
@@ -268,7 +268,7 @@ if_clone_lookup(const char *name, int *unitp)
        }
 
        /* No match. */
-       return ((struct if_clone *)NULL);
+       return (NULL);
 
  found_name:
        if (*cp == '\0') {
index 0f232cb..d37ff5f 100644 (file)
@@ -1598,8 +1598,7 @@ ng_btsocket_rfcomm_session_receive(ng_btsocket_rfcomm_session_p s)
                flags = MSG_DONTWAIT;
 
                m = NULL;
-               error = soreceive(s->l2so, NULL, &uio, &m,
-                   (struct mbuf **) NULL, &flags);
+               error = soreceive(s->l2so, NULL, &uio, &m, NULL, &flags);
                if (error != 0) {
                        if (error == EWOULDBLOCK)
                                return (0); /* XXX can happen? */
index a228a05..d8f30a2 100644 (file)
@@ -174,8 +174,8 @@ failed:
                        rt->rt_flags &= ~RTF_LLINFO;
                }
 #endif
-               rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *) NULL,
-                   rt_mask(rt), 0, (struct rtentry **) NULL);
+               rtrequest(RTM_DELETE, rt_key(rt), NULL,
+                   rt_mask(rt), 0, NULL);
                break;
 
        case RTM_DELETE:
@@ -199,7 +199,7 @@ failed:
                api.rxhand = NULL;
                lwkt_serialize_enter(rt->rt_ifp->if_serializer);
                rt->rt_ifp->if_ioctl(rt->rt_ifp, SIOCATMDIS, (caddr_t)&api,
-                                    (struct ucred *)NULL);
+                                    NULL);
                lwkt_serialize_exit(rt->rt_ifp->if_serializer);
                break;
        }
index 9f7bfe1..d937d79 100644 (file)
@@ -472,7 +472,7 @@ in_pcbladdr(struct inpcb *inp, struct sockaddr *nam,
        if (inp->inp_laddr.s_addr == INADDR_ANY) {
                struct route *ro;
 
-               ia = (struct in_ifaddr *)NULL;
+               ia = NULL;
                /*
                 * If route is known or can be allocated now,
                 * our src addr is taken from the i/f, else punt.
@@ -487,11 +487,11 @@ in_pcbladdr(struct inpcb *inp, struct sockaddr *nam,
                                      sin->sin_addr.s_addr ||
                     inp->inp_socket->so_options & SO_DONTROUTE)) {
                        RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)NULL;
+                       ro->ro_rt = NULL;
                }
                if (!(inp->inp_socket->so_options & SO_DONTROUTE) && /*XXX*/
-                   (ro->ro_rt == (struct rtentry *)NULL ||
-                   ro->ro_rt->rt_ifp == (struct ifnet *)NULL)) {
+                   (ro->ro_rt == NULL ||
+                   ro->ro_rt->rt_ifp == NULL)) {
                        /* No route yet, so try to acquire one */
                        bzero(&ro->ro_dst, sizeof(struct sockaddr_in));
                        ro->ro_dst.sa_family = AF_INET;
@@ -621,7 +621,7 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct thread *td)
        }
        if (inp->inp_laddr.s_addr == INADDR_ANY) {
                if (inp->inp_lport == 0) {
-                       error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+                       error = in_pcbbind(inp, NULL, td);
                        if (error)
                                return (error);
                }
index 16a8241..5b1afc6 100644 (file)
@@ -313,7 +313,7 @@ div_packet(struct mbuf *m, int incoming, int port)
        }
        if (sa) {
                if (ssb_appendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc, m,
-                                (struct mbuf *)NULL) == 0)
+                                NULL) == 0)
                        m_freem(m);
                else
                        sorwakeup(sa);
index 3fc5796..ab53a0f 100644 (file)
@@ -327,7 +327,7 @@ reroute:
             dst->sin_family != AF_INET ||
             dst->sin_addr.s_addr != pkt_dst.s_addr)) {
                rtfree(ro->ro_rt);
-               ro->ro_rt = (struct rtentry *)NULL;
+               ro->ro_rt = NULL;
        }
        if (ro->ro_rt == NULL) {
                bzero(dst, sizeof *dst);
@@ -1186,7 +1186,7 @@ smart_frag_failure:
                        goto done;
                }
                m->m_pkthdr.len = mhlen + len;
-               m->m_pkthdr.rcvif = (struct ifnet *)NULL;
+               m->m_pkthdr.rcvif = NULL;
                m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags;
                mhip->ip_off = htons(mhip->ip_off);
                mhip->ip_sum = 0;
@@ -1274,7 +1274,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen)
                        *phlen = 0;
                        return (m);
                }
-               n->m_pkthdr.rcvif = (struct ifnet *)NULL;
+               n->m_pkthdr.rcvif = NULL;
                n->m_pkthdr.len = m->m_pkthdr.len + optlen;
                m->m_len -= sizeof(struct ip);
                m->m_data += sizeof(struct ip);
index 8662c64..be68768 100644 (file)
@@ -2469,7 +2469,7 @@ sctp_service_queues(struct sctp_tcb *stcb, struct sctp_association *asoc, int ho
                        break;
                }
                /* If deliver_data says no we must stop */
-               if (sctp_deliver_data(stcb, asoc, (struct sctp_tmit_chunk *)NULL, hold_locks) == 0)
+               if (sctp_deliver_data(stcb, asoc, NULL, hold_locks) == 0)
                        break;
                cntDel++;
                chk = TAILQ_FIRST(&asoc->delivery_queue);
@@ -3973,7 +3973,7 @@ sctp_handle_sack(struct sctp_sack_chunk *ch, struct sctp_tcb *stcb,
                                                SCTP_RECEIVED_SACK, (void *)net);
                                /* now was it the primary? if so restore */
                                if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) {
-                                       sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net);
+                                       sctp_set_primary_addr(stcb, NULL, net);
                                }
                        }
                }
index 551f745..fbe20f8 100644 (file)
@@ -498,7 +498,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
 
                /* now was it the primary? if so restore */
                if (r_net->dest_state & SCTP_ADDR_WAS_PRIMARY) {
-                       sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, r_net);
+                       sctp_set_primary_addr(stcb, NULL, r_net);
                }
        }
        /* Now lets do a RTO with this */
@@ -1526,7 +1526,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
                }
 #endif /* SCTP_DEBUG */
                op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC);
-               sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen,
+               sctp_abort_association(inp, NULL, m, iphlen,
                    sh, op_err);
                return (NULL);
        }
@@ -1548,7 +1548,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
                 * was in flight. Only recourse is to abort the association.
                 */
                op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC);
-               sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen,
+               sctp_abort_association(inp, NULL, m, iphlen,
                    sh, op_err);
                return (NULL);
        }
@@ -2082,7 +2082,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
        if (netl) {
                if (netl->dest_state &  SCTP_ADDR_UNCONFIRMED) {
                        netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED;
-                       sctp_set_primary_addr((*stcb), (struct sockaddr *)NULL,
+                       sctp_set_primary_addr((*stcb), NULL,
                                              netl);
                        sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
                                        (*stcb), 0, (void *)netl);
index 5acfd4b..a1938a2 100644 (file)
@@ -2307,7 +2307,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                                                alt = sctp_find_alternate_net(stcb, net);
                                                if (alt != net) {
                                                        if (sctp_set_primary_addr(stcb,
-                                                                             (struct sockaddr *)NULL,
+                                                                             NULL,
                                                                                 alt) == 0) {
                                                                net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
                                                                net->src_addr_selected = 0;
@@ -2338,7 +2338,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                                ro, o_flgs, inp->ip_inp.inp.inp_moptions
 #if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD_version >= 480000) \
     || defined(__DragonFly__)
-                               , (struct inpcb *)NULL
+                               , NULL
 #endif
 #if defined(__NetBSD__)
                                 ,(struct socket *)inp->sctp_socket
@@ -2494,7 +2494,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
                                                alt = sctp_find_alternate_net(stcb, net);
                                                if (alt != net) {
                                                        if (sctp_set_primary_addr(stcb,
-                                                                             (struct sockaddr *)NULL,
+                                                                             NULL,
                                                                                 alt) == 0) {
                                                                net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
                                                                net->src_addr_selected = 0;
index ceca83a..5583efb 100644 (file)
@@ -2994,11 +2994,11 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
 #endif
 
                if ((err = sctp_inpcb_bind(inp->sctp_socket,
-                   (struct sockaddr *)NULL,
+                   NULL,
 #if (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__DragonFly__)
-                                          (struct thread *)NULL
+                                          NULL
 #else
-                                          (struct proc *)NULL
+                                          NULL
 #endif
                             ))){
                        /* bind error, probably perm */
index 5f9f7ea..b66a735 100644 (file)
@@ -830,7 +830,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp,
                         * from any net structures.
                         */
                        if (sctp_set_primary_addr(stcb,
-                                                (struct sockaddr *)NULL,
+                                                NULL,
                                                 alt) == 0) {
                                net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
                                net->src_addr_selected = 0;
index d3d40e4..0a6f4f6 100644 (file)
@@ -3411,7 +3411,7 @@ sctp_optsset(struct socket *so,
                        lnet = stcb->asoc.primary_destination;
                         lnet->next_tsn_at_change = net->next_tsn_at_change = stcb->asoc.sending_seq;
                        if (sctp_set_primary_addr(stcb,
-                                                 (struct sockaddr *)NULL,
+                                                 NULL,
                                                  net) == 0) {
                                if (net->dest_state & SCTP_ADDR_SWITCH_PRIMARY) {
                                        net->dest_state |= SCTP_ADDR_DOUBLE_SWITCH;
@@ -3704,11 +3704,11 @@ sctp_ctloutput(int op, struct socket *so, int level, int optname,
        }
        /* Ok if we reach here it is a SCTP option we hope */
        if (op == PRCO_SETOPT) {
-               error = sctp_optsset(so, optname, mp, (struct proc *)NULL);
+               error = sctp_optsset(so, optname, mp, NULL);
                if (*mp)
                        m_free(*mp);
        } else if (op ==  PRCO_GETOPT) {
-               error = sctp_optsget(so, optname, mp, (struct proc *)NULL);
+               error = sctp_optsget(so, optname, mp, NULL);
        } else {
                error = EINVAL;
        }
index 69fb29a..c0f736d 100644 (file)
@@ -636,7 +636,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
        }
        m->m_len = tlen;
        m->m_pkthdr.len = tlen;
-       m->m_pkthdr.rcvif = (struct ifnet *) NULL;
+       m->m_pkthdr.rcvif = NULL;
        nth->th_seq = htonl(seq);
        nth->th_ack = htonl(ack);
        nth->th_x2 = 0;
index a7944a5..1aeb860 100644 (file)
@@ -358,7 +358,7 @@ tcp_timer_keep_handler(struct tcpcb *tp)
                t_template = tcp_maketemplate(tp);
                if (t_template) {
                        tcp_respond(tp, t_template->tt_ipgen,
-                                   &t_template->tt_t, (struct mbuf *)NULL,
+                                   &t_template->tt_t, NULL,
                                    tp->rcv_nxt, tp->snd_una - 1, 0);
                        tcp_freetemplate(t_template);
                }
index 9f555b8..1756e83 100644 (file)
@@ -1024,7 +1024,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
 #endif
 
        if (inp->inp_lport == 0) {
-               error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+               error = in_pcbbind(inp, NULL, td);
                if (error)
                        return (error);
        }
index 0cfb72d..ac1c849 100644 (file)
@@ -748,7 +748,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *dstaddr,
        }
 
        if (inp->inp_lport == 0) {      /* unbound socket */
-               error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+               error = in_pcbbind(inp, NULL, td);
                if (error)
                        goto release;
                in_pcbinswildcardhash(inp);
index 45ce364..a73a8a6 100644 (file)
@@ -162,7 +162,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
            (!(ro.ro_rt->rt_flags & RTF_UP) ||
             !IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6->ip6_dst))) {
                rtfree(ro.ro_rt);
-               ro.ro_rt = (struct rtentry *)NULL;
+               ro.ro_rt = NULL;
        }
        if (ro.ro_rt == NULL) {
                bzero(dst, sizeof(*dst));
index db6832e..9d454e6 100644 (file)
@@ -2291,7 +2291,7 @@ icmp6_redirect_input(struct mbuf *m, int off)
                bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr));
                bcopy(&src6, &ssrc.sin6_addr, sizeof(struct in6_addr));
                rtredirect((struct sockaddr *)&sdst, (struct sockaddr *)&sgw,
-                          (struct sockaddr *)NULL, RTF_GATEWAY | RTF_HOST,
+                          NULL, RTF_GATEWAY | RTF_HOST,
                           (struct sockaddr *)&ssrc);
        }
        /* finally update cached route in each socket via kpfctlinput */
@@ -2400,9 +2400,9 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
                sin6 = (struct sockaddr_in6 *)rt->rt_gateway;
                router_ll6 = &sin6->sin6_addr;
                if (!IN6_IS_ADDR_LINKLOCAL(router_ll6))
-                       router_ll6 = (struct in6_addr *)NULL;
+                       router_ll6 = NULL;
        } else
-               router_ll6 = (struct in6_addr *)NULL;
+               router_ll6 = NULL;
 
        /* ip6 */
        ip6 = mtod(m, struct ip6_hdr *);
index ef148f6..5c1b218 100644 (file)
@@ -1590,8 +1590,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, struct sockaddr_in6 *sin6,
        ia->ia_addr = *sin6;
 
        if (ifacount <= 1 && ifp->if_ioctl &&
-           (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia,
-                                     (struct ucred *)NULL))) {
+           (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, NULL))) {
                lwkt_serialize_exit(ifp->if_serializer);
                return (error);
        }
index b93711d..7187834 100644 (file)
@@ -128,7 +128,7 @@ int
 in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct thread *td)
 {
        struct socket *so = inp->inp_socket;
-       struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL;
+       struct sockaddr_in6 *sin6 = NULL;
        struct sockaddr_in6 jsin6;
        struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
        struct proc *p = td->td_proc;
index e919315..381d7b7 100644 (file)
@@ -1308,7 +1308,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro,
                    ((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 ||
                     !IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) {
                        RTFREE(ro_pmtu->ro_rt);
-                       ro_pmtu->ro_rt = (struct rtentry *)NULL;
+                       ro_pmtu->ro_rt = NULL;
                }
                if (ro_pmtu->ro_rt == NULL) {
                        bzero(sa6_dst, sizeof(*sa6_dst));
index 78e4465..681d09b 100644 (file)
@@ -121,8 +121,8 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len)
        char *lladdr = NULL;
        int lladdrlen = 0;
 #if 0
-       struct sockaddr_dl *sdl = (struct sockaddr_dl *)NULL;
-       struct llinfo_nd6 *ln = (struct llinfo_nd6 *)NULL;
+       struct sockaddr_dl *sdl = NULL;
+       struct llinfo_nd6 *ln = NULL;
        struct rtentry *rt = NULL;
        int is_newentry;
 #endif
index 707e548..d8e0664 100644 (file)
@@ -586,7 +586,7 @@ sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d)
        if (d != NULL) {
                ip6cp = (struct ip6ctlparam *)d;
        } else {
-               ip6cp = (struct ip6ctlparam *)NULL;
+               ip6cp = NULL;
        }
 
        if (ip6cp) {
index d10d928..46eacf2 100644 (file)
@@ -192,7 +192,7 @@ atm_physif_deregister(Cmn_unit *cup)
                atm_free(cvp);
                cvp = cvp->cv_next;
        }
-       cup->cu_vcc = (Cmn_vcc *)NULL;
+       cup->cu_vcc = NULL;
 
        crit_exit();
 
@@ -231,7 +231,7 @@ atm_physif_freenifs(struct atm_pif *pip)
                atm_free ((caddr_t)nip);
                nip = nipp;
        }
-       pip->pif_nif = (struct atm_nif *)NULL;
+       pip->pif_nif = NULL;
 
        crit_exit();
 
@@ -874,7 +874,7 @@ atm_netif_rtdel(struct radix_node *rn, void *arg)
 
                err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
                                rt_mask(rt), rt->rt_flags,
-                               (struct rtentry **) NULL);
+                               NULL);
                if (err) {
                        log(LOG_WARNING, "atm_netif_rtdel: error %d\n", err);
                }
index dceb07b..ff3180f 100644 (file)
@@ -138,14 +138,14 @@ typedef struct q_elem Qelem_t;
  */
 #define LINK2TAIL(u,t,h,l)                                     \
 {                                                              \
-       (u)->l = (t *)NULL;                                     \
+       (u)->l = NULL;                                          \
        /* Check for empty chain */                             \
-       if ((h) == (t *)NULL) {                                 \
+       if ((h) == NULL) {                                      \
                (h) = (u);                                      \
        } else {                                                \
                t       *tp;                                    \
                /* Loop until we find the end of chain */       \
-               for (tp = (h); tp->l != (t *)NULL; tp = tp->l)  \
+               for (tp = (h); tp->l != NULL; tp = tp->l)       \
                        ;                                       \
                tp->l = (u);                                    \
        }                                                       \
@@ -166,7 +166,7 @@ typedef struct q_elem Qelem_t;
        } else {                                                \
                t       *tp;                                    \
                /* Loop until we find the control block */      \
-               for (tp = (h); tp != (t *)NULL; tp = tp->l) {   \
+               for (tp = (h); tp != NULL; tp = tp->l) {        \
                        if (tp->l == (u))                       \
                                break;                          \
                }                                               \
@@ -175,7 +175,7 @@ typedef struct q_elem Qelem_t;
                        tp->l = (u)->l;                         \
                }                                               \
        }                                                       \
-       (u)->l = (t *)NULL;                                     \
+       (u)->l = NULL;                                          \
 }
 
 /*
@@ -196,7 +196,7 @@ typedef struct q_elem Qelem_t;
        } else {                                                \
                t       *tp;                                    \
                /* Loop until we find the control block */      \
-               for (tp = (h); tp != (t *)NULL; tp = tp->l) {   \
+               for (tp = (h); tp != NULL; tp = tp->l) {        \
                        if (tp->l == (u))                       \
                                break;                          \
                }                                               \
@@ -208,7 +208,7 @@ typedef struct q_elem Qelem_t;
                        /* It wasn't on the chain */            \
                        (f) = 0;                                \
        }                                                       \
-       (u)->l = (t *)NULL;                                     \
+       (u)->l = NULL;                                          \
 }
 
 #endif /* _NETATM_QUEUE_H */
index d304895..e234776 100644 (file)
@@ -961,8 +961,7 @@ unisig_ioctl(int code, caddr_t data, caddr_t arg1)
                /*
                 * Pass event to signalling manager state machine
                 */
-               err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET,
-                               (KBuffer *) NULL);
+               err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET, NULL);
 
                /*
                 * Clean up if there was an error
index a6b33e9..50a1e96 100644 (file)
@@ -1177,8 +1177,7 @@ unisig_vc_act12(struct unisig *usp, struct unisig_vccb *uvp,
        /*
         * Send the RELEASE message
         */
-       rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL,
-                       T_ATM_ABSENT);
+       rc = unisig_vc_clear_call(usp, uvp, NULL, T_ATM_ABSENT);
 
        return(rc);
 }
index edf2a0c..f826770 100644 (file)
@@ -2536,7 +2536,7 @@ key_delsah(struct secashead *sah)
                        LIST_REMOVE(sah, chain);
                if (sah->sa_route.ro_rt) {
                        RTFREE(sah->sa_route.ro_rt);
-                       sah->sa_route.ro_rt = (struct rtentry *)NULL;
+                       sah->sa_route.ro_rt = NULL;
                }
                KFREE(sah);
        }
@@ -6903,7 +6903,7 @@ key_sa_routechange(struct sockaddr *dst)
                if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len
                 && bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) {
                        RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)NULL;
+                       ro->ro_rt = NULL;
                }
        }
 
index 282c26a..a9d0584 100644 (file)
@@ -650,7 +650,7 @@ esp_output(
        struct enc_xform *espx;
        struct auth_hash *esph;
        int hlen, rlen, plen, padding, blks, alen, i, roff;
-       struct mbuf *mo = (struct mbuf *) NULL;
+       struct mbuf *mo = NULL;
        struct tdb_crypto *tc;
        struct secasvar *sav;
        struct secasindex *saidx;
index e7c03b8..66ae830 100644 (file)
@@ -272,8 +272,7 @@ ipx_ifinit(struct ifnet *ifp, struct ipx_ifaddr *ia,
         */
        lwkt_serialize_enter(ifp->if_serializer);
        if (ifp->if_ioctl != NULL &&
-           (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia,
-                                     (struct ucred *)NULL))) {
+           (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia, NULL))) {
                ia->ia_addr = oldaddr;
                lwkt_serialize_exit(ifp->if_serializer);
                return (error);
index 4f4cab5..b376185 100644 (file)
@@ -275,7 +275,7 @@ ipxipoutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
        /*
         * Output final datagram.
         */
-       error =  (ip_output(m, (struct mbuf *)NULL, ro, SO_BROADCAST, NULL, NULL));
+       error =  (ip_output(m, NULL, ro, SO_BROADCAST, NULL, NULL));
        if (error) {
                ifn->ifen_ifnet.if_oerrors++;
                ifn->ifen_ifnet.if_ierrors = error;
index 36be535..61c147e 100644 (file)
@@ -238,7 +238,7 @@ ipx_pcbconnect(struct ipxpcb *ipxp, struct sockaddr *nam, struct thread *td)
        if (ipx_pcblookup(&sipx->sipx_addr, ipxp->ipxp_lport, 0))
                return (EADDRINUSE);
        if (ipxp->ipxp_lport == 0)
-               ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+               ipx_pcbbind(ipxp, NULL, td);
 
        /* XXX just leave it zero if we can't find a route */
 
index 4a0f6c1..32b2cdb 100644 (file)
@@ -177,7 +177,7 @@ ipx_input(struct mbuf *m, struct ipxpcb *ipxp)
                m->m_data += sizeof(struct ipx);
        }
        if (ssb_appendaddr(&ipxp->ipxp_socket->so_rcv, (struct sockaddr *)&ipx_ipx,
-           m, (struct mbuf *)NULL) == 0)
+           m, NULL) == 0)
                goto bad;
        sorwakeup(ipxp->ipxp_socket);
        return;
@@ -290,7 +290,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0)
         */
        so = ipxp->ipxp_socket;
        if (so->so_options & SO_DONTROUTE)
-               return (ipx_outputfl(m, (struct route *)NULL,
+               return (ipx_outputfl(m, NULL,
                    (so->so_options & SO_BROADCAST) | IPX_ROUTETOIF));
        /*
         * Use cached route for previous datagram if
index ae89427..01509e6 100644 (file)
@@ -340,7 +340,7 @@ spx_input(struct mbuf *m, struct ipxpcb *ipxp)
                m_freem(m);
        }
        if (cb->s_force || (cb->s_flags & (SF_ACKNOW|SF_WIN|SF_RXT)))
-               spx_output(cb, (struct mbuf *)NULL);
+               spx_output(cb, NULL);
        cb->s_flags &= ~(SF_WIN|SF_RXT);
        return;
 
@@ -409,7 +409,7 @@ spx_reass(struct spxpcb *cb, struct spx *si, struct mbuf *si_m)
                                cb->s_snxt = si->si_ack;
                                cb->s_cwnd = CUNIT;
                                cb->s_force = 1 + SPXT_REXMT;
-                               spx_output(cb, (struct mbuf *)NULL);
+                               spx_output(cb, NULL);
                                cb->s_timer[SPXT_REXMT] = cb->s_rxtcur;
                                cb->s_rtt = 0;
                                if (cwnd >= 4 * CUNIT)
@@ -1127,7 +1127,7 @@ send:
                        spx_trace(SA_OUTPUT, cb->s_state, cb, si, 0);
 
                if (so->so_options & SO_DONTROUTE)
-                       error = ipx_outputfl(m, (struct route *)NULL, IPX_ROUTETOIF);
+                       error = ipx_outputfl(m, NULL, IPX_ROUTETOIF);
                else
                        error = ipx_outputfl(m, &cb->s_ipxpcb->ipxp_route, 0);
        }
@@ -1418,7 +1418,7 @@ spx_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 
        crit_enter();
        if (ipxp->ipxp_lport == 0) {
-               error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+               error = ipx_pcbbind(ipxp, NULL, td);
                if (error)
                        goto spx_connect_end;
        }
@@ -1441,7 +1441,7 @@ spx_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
         * cb->s_dport.
         */
        ipxp->ipxp_fport = 0;
-       error = spx_output(cb, (struct mbuf *)NULL);
+       error = spx_output(cb, NULL);
 spx_connect_end:
        crit_exit();
        return (error);
@@ -1499,7 +1499,7 @@ spx_listen(struct socket *so, struct thread *td)
        cb = ipxtospxpcb(ipxp);
 
        if (ipxp->ipxp_lport == 0)
-               error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+               error = ipx_pcbbind(ipxp, NULL, td);
        if (error == 0)
                cb->s_state = TCPS_LISTEN;
        return (error);
@@ -1520,7 +1520,7 @@ spx_rcvd(struct socket *so, int flags)
 
        crit_enter();
        cb->s_flags |= SF_RVD;
-       spx_output(cb, (struct mbuf *)NULL);
+       spx_output(cb, NULL);
        cb->s_flags &= ~SF_RVD;
        crit_exit();
        return (0);
@@ -1600,7 +1600,7 @@ spx_shutdown(struct socket *so)
        socantsendmore(so);
        cb = spx_usrclosed(cb);
        if (cb != NULL)
-               error = spx_output(cb, (struct mbuf *)NULL);
+               error = spx_output(cb, NULL);
        crit_exit();
        return (error);
 }
@@ -1677,7 +1677,7 @@ spx_close(struct spxpcb *cb)
        soisdisconnected(so);
        ipx_pcbdetach(ipxp);
        spxstat.spxs_closed++;
-       return ((struct spxpcb *)NULL);
+       return (NULL);
 }
 
 /*
@@ -1739,7 +1739,7 @@ spx_fasttimo(void)
                        cb->s_flags &= ~SF_DELACK;
                        cb->s_flags |= SF_ACKNOW;
                        spxstat.spxs_delack++;
-                       spx_output(cb, (struct mbuf *)NULL);
+                       spx_output(cb, NULL);
                }
            }
        }
@@ -1852,7 +1852,7 @@ spx_timers(struct spxpcb *cb, int timer)
                        win = 2;
                cb->s_cwnd = CUNIT;
                cb->s_ssthresh = win * CUNIT;
-               spx_output(cb, (struct mbuf *)NULL);
+               spx_output(cb, NULL);
                break;
 
        /*
@@ -1862,7 +1862,7 @@ spx_timers(struct spxpcb *cb, int timer)
        case SPXT_PERSIST:
                spxstat.spxs_persisttimeo++;
                spx_setpersist(cb);
-               spx_output(cb, (struct mbuf *)NULL);
+               spx_output(cb, NULL);
                break;
 
        /*
@@ -1877,7 +1877,7 @@ spx_timers(struct spxpcb *cb, int timer)
                        if (cb->s_idle >= SPXTV_MAXIDLE)
                                goto dropit;
                        spxstat.spxs_keepprobe++;
-                       spx_output(cb, (struct mbuf *)NULL);
+                       spx_output(cb, NULL);
                } else
                        cb->s_idle = 0;
                cb->s_timer[SPXT_KEEP] = SPXTV_KEEP;
index c2a0fd5..c56e3be 100644 (file)
@@ -2621,7 +2621,7 @@ key_delsah(struct secashead *sah)
 
        if (sah->sa_route.ro_rt) {
                RTFREE(sah->sa_route.ro_rt);
-               sah->sa_route.ro_rt = (struct rtentry *)NULL;
+               sah->sa_route.ro_rt = NULL;
        }
 
        /* remove from tree of SA index */
@@ -7262,7 +7262,7 @@ key_sa_routechange(struct sockaddr *dst)
                if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len
                 && bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) {
                        RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)NULL;
+                       ro->ro_rt = NULL;
                }
        }
 
index 129ce26..545bd67 100644 (file)
@@ -263,7 +263,7 @@ natm_usr_disconnect(struct socket *so)
     api.rxhand = npcb;
     if (ifp->if_ioctl != NULL) {
        lwkt_serialize_enter(ifp->if_serializer);
-       ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL);
+       ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL);
        lwkt_serialize_exit(ifp->if_serializer);
     }
 
@@ -565,7 +565,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
       lwkt_serialize_enter(ifp->if_serializer);
       if (ifp->if_ioctl == NULL || 
          ifp->if_ioctl(ifp, SIOCATMENA, (caddr_t) &api,
-                       (struct ucred *)NULL) != 0) {
+                       NULL) != 0) {
        lwkt_serialize_exit(ifp->if_serializer);
        npcb_free(npcb, NPCB_REMOVE);
         error = EIO;
@@ -596,7 +596,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
       api.rxhand = npcb;
       lwkt_serialize_enter(ifp->if_serializer);
       if (ifp->if_ioctl != NULL)
-         ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL);
+         ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL);
       lwkt_serialize_exit(ifp->if_serializer);
 
       npcb_free(npcb, NPCB_REMOVE);
@@ -667,7 +667,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
         ario.rawvalue = *((int *)nam);
         lwkt_serialize_enter(npcb->npcb_ifp->if_serializer);
         error = npcb->npcb_ifp->if_ioctl(npcb->npcb_ifp, SIOCXRAWATM,
-                                        (caddr_t) &ario, (struct ucred *)NULL);
+                                        (caddr_t) &ario, NULL);
         lwkt_serialize_exit(npcb->npcb_ifp->if_serializer);
        if (!error) {
           if (ario.rawvalue) 
@@ -760,7 +760,7 @@ natm_init(void)
   LIST_INIT(&natm_pcbs);
 
   netisr_register(NETISR_NATM, cpu0_portfn, pktinfo_portfn_cpu0,
-                 natmintr, NETISR_FLAG_NOTMPSAFE);
+                 natmintr, NETISR_FLAG_NOTMPSAFE);
 }
 
 /*
index 5a39892..d239955 100644 (file)
@@ -379,7 +379,7 @@ ncp_sock_disconnect(struct ncp_conn *conn) {
 #ifdef NCPBURST
        if (conn->bc_so) {
                so = conn->bc_so;
-               conn->bc_so = (struct socket *)NULL;
+               conn->bc_so = NULL;
                soshutdown(so, SHUT_RDWR);
                soclose(so, FNONBLOCK);
        }
index 17e0aab..0438da9 100644 (file)
@@ -172,7 +172,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
                        lwkt_serialize_enter(ifp->if_serializer);
                        error = ifp->if_ioctl(ifp, SIOCSIFDSTADDR, 
                                                        (caddr_t)ia,
-                                                       (struct ucred *)NULL);
+                                                       NULL);
                        lwkt_serialize_exit(ifp->if_serializer);
                        if (error)
                                return (error);
@@ -236,7 +236,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
                if (ifp->if_ioctl == 0)
                        return (EOPNOTSUPP);
                lwkt_serialize_enter(ifp->if_serializer);
-               error = ifp->if_ioctl(ifp, cmd, data, (struct ucred *)NULL);
+               error = ifp->if_ioctl(ifp, cmd, data, NULL);
                lwkt_serialize_exit(ifp->if_serializer);
                return (error);
        }
@@ -291,7 +291,7 @@ ns_ifinit(struct ifnet *ifp, struct ns_ifaddr *ia, struct sockaddr_ns *sns, int
                if (ifp->if_ioctl &&
                     (error = ifp->if_ioctl(ifp, SIOCSIFADDR, 
                                                (caddr_t)ia,
-                                               (struct ucred *)NULL))) {
+                                               NULL))) {
                        ia->ia_addr = oldaddr;
                        lwkt_serialize_exit(ifp->if_serializer);
                        crit_exit();
@@ -306,7 +306,7 @@ ns_ifinit(struct ifnet *ifp, struct ns_ifaddr *ia, struct sockaddr_ns *sns, int
                if (ifp->if_ioctl &&
                     (error = ifp->if_ioctl(ifp, SIOCSIFADDR, 
                                                (caddr_t)ia,
-                                               (struct ucred *)NULL))) {
+                                               NULL))) {
                        ia->ia_addr = oldaddr;
                        lwkt_serialize_exit(ifp->if_serializer);
                        crit_exit();
index 3c3e12e..20f1981 100644 (file)
@@ -551,7 +551,7 @@ smb_nbst_disconnect(struct smb_vc *vcp, struct thread *td)
                return ENOTCONN;
        if ((so = nbp->nbp_tso) != NULL) {
                nbp->nbp_flags &= ~NBF_CONNECTED;
-               nbp->nbp_tso = (struct socket *)NULL;
+               nbp->nbp_tso = NULL;
                soshutdown(so, SHUT_RDWR);
                soclose(so, FNONBLOCK);
        }
index 8515b14..1e180ac 100644 (file)
@@ -415,7 +415,7 @@ struct cmsgcred {
        (((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \
          _ALIGN(sizeof(struct cmsghdr)) > \
            (caddr_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
-           (struct cmsghdr *)NULL : \
+           NULL : \
            (struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len)))
 
 /*
@@ -425,7 +425,7 @@ struct cmsgcred {
 #define        CMSG_FIRSTHDR(mhdr) \
        ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
         (struct cmsghdr *)(mhdr)->msg_control : \
-        (struct cmsghdr *)NULL)
+        NULL)
 
 /* RFC 2292 additions */
        
index 3f78fd3..05cbe2a 100644 (file)
@@ -1835,7 +1835,7 @@ ntfs_runtocn(cn_t *cn,    struct ntfsmount *ntmp, u_int8_t *run, u_long len,
 void
 ntfs_toupper_init(void)
 {
-       ntfs_toupper_tab = (wchar *) NULL;
+       ntfs_toupper_tab = NULL;
        lockinit(&ntfs_toupper_lock, "ntfs_toupper", 0, 0);
        ntfs_toupper_usecount = 0;
 }
index f980748..36441ad 100644 (file)
@@ -244,7 +244,7 @@ exec_shell(const char *command, char *use_shell, char *use_name)
                err(1, "vfork");
        case 0:                         /* child */
                (void)sigsetmask(omask);
-               execl(use_shell, use_name, "-c", command, (char *)NULL);
+               execl(use_shell, use_name, "-c", command, NULL);
                warn("%s", use_shell);
                _exit(1);
        }
index 16e2423..ac27564 100644 (file)
@@ -326,7 +326,7 @@ writefile(time_t runtimer, char queue)
            mailname = pass_entry->pw_name;
     }
 
-    if (atinput != (char *) NULL)
+    if (atinput != NULL)
     {
        fpin = freopen(atinput, "r", stdin);
        if (fpin == NULL)
index ab417c3..1f25152 100644 (file)
@@ -1137,7 +1137,7 @@ main(int argc, char *argv[])
                        dup(p[0]);
                        close(p[0]);
                        close(p[1]);
-                       execl(_PATH_DC, "dc", "-x", (char *)NULL);
+                       execl(_PATH_DC, "dc", "-x", NULL);
                        err(1, "cannot find dc");
                }
        }
index 2fd2c6b..7315cd0 100644 (file)
@@ -374,7 +374,7 @@ opencal(void)
                }
                execl(_PATH_CPP, "cpp", "-P",
                    "-traditional", "-nostdinc",        /* GCC specific opts */
-                   "-I.", "-I", _PATH_INCLUDE, (char *)NULL);
+                   "-I.", "-I", _PATH_INCLUDE, NULL);
                warn(_PATH_CPP);
                _exit(EXIT_FAILURE);
        }
@@ -436,7 +436,7 @@ closecal(FILE *fp)
                        _exit(EXIT_FAILURE);
                }
                execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F",
-                   "\"Reminder Service\"", (char *)NULL);
+                   "\"Reminder Service\"", NULL);
                warn(_PATH_SENDMAIL);
                _exit(EXIT_FAILURE);
        }
index dac1234..d3ce1c9 100644 (file)
@@ -511,7 +511,7 @@ void break_sequence(void)
 void terminate(int status)
 {
     echo_stderr(-1);
-    if (report_file != NULL && report_fp != (FILE *) NULL) {
+    if (report_file != NULL && report_fp != NULL) {
 /*
  * Allow the last of the report string to be gathered before we terminate.
  */
@@ -535,7 +535,7 @@ void terminate(int status)
        if (verbose)
            fprintf (report_fp, "Closing \"%s\".\n", report_file);
        fclose (report_fp);
-       report_fp = (FILE *) NULL;
+       report_fp = NULL;
     }
 
 #if defined(get_term_param)
@@ -1230,16 +1230,16 @@ get_string(char *string)
 
        if (!report_gathering) {
            for (n = 0; n < n_reports; ++n) {
-               if ((report_string[n] != (char*) NULL) &&
+               if ((report_string[n] != NULL) &&
                    s - temp >= (report_len = strlen(report_string[n])) &&
                    strncmp(s - report_len, report_string[n], report_len) == 0) {
-                   time_t time_now   = time ((time_t*) NULL);
+                   time_t time_now   = time (NULL);
                    struct tm* tm_now = localtime (&time_now);
 
                    strftime (report_buffer, 20, "%b %d %H:%M:%S ", tm_now);
                    strcat (report_buffer, report_string[n]);
 
-                   report_string[n] = (char *) NULL;
+                   report_string[n] = NULL;
                    report_gathering = 1;
                    break;
                }
index 658ef33..2a86edd 100644 (file)
@@ -163,14 +163,14 @@ main(int argc, char **argv)
                /* protect p_shell -- it thinks NULL is /bin/sh */
                if (!arg[0])
                        usage();
-               if (p_shell(arg, pw, (ENTRY *)NULL) == -1)
+               if (p_shell(arg, pw, NULL) == -1)
                        exit(1);
        }
 
        if (op == NEWEXP) {
                if (uid)        /* only root can change expire */
                        baduser();
-               if (p_expire(arg, pw, (ENTRY *)NULL) == -1)
+               if (p_expire(arg, pw, NULL) == -1)
                        exit(1);
        }
 
index 54e3c43..8f8fcfe 100644 (file)
@@ -106,10 +106,10 @@ atot(char *p, time_t *store)
                        }
                }
        }
-       if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t))
+       if (!(t = strtok(NULL, " \t,")) || !isdigit(*t))
                goto bad;
        day = atoi(t);
-       if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t))
+       if (!(t = strtok(NULL, " \t,")) || !isdigit(*t))
                goto bad;
        year = atoi(t);
        if (day < 1 || day > 31 || month < 1 || month > 12)
index 22af52a..471351b 100644 (file)
@@ -278,7 +278,7 @@ main(int argc, char **argv)
                        need = l->l_lsize ? l->l_lsize * 2 : 90;
                        if ((l->l_line = realloc(l->l_line,
                            (unsigned)need * sizeof(CHAR))) == NULL)
-                               err(1, (char *)NULL);
+                               err(1, NULL);
                        l->l_lsize = need;
                }
                c = &l->l_line[l->l_line_len++];
@@ -394,13 +394,13 @@ flush_line(LINE *l)
                        sorted_size = l->l_lsize;
                        if ((sorted = realloc(sorted,
                            (unsigned)sizeof(CHAR) * sorted_size)) == NULL)
-                               err(1, (char *)NULL);
+                               err(1, NULL);
                }
                if (l->l_max_col >= count_size) {
                        count_size = l->l_max_col + 1;
                        if ((count = realloc(count,
                            (unsigned)sizeof(int) * count_size)) == NULL)
-                    &n