Generally use NULL instead of explicitly casting 0 to some pointer type.
authorSascha Wildner <saw@online.de>
Sun, 5 Apr 2009 20:33:01 +0000 (22:33 +0200)
committerSascha Wildner <saw@online.de>
Tue, 7 Apr 2009 07:42:41 +0000 (09:42 +0200)
240 files changed:
bin/date/netdate.c
bin/sh/miscbltin.c
bin/sh/trap.c
games/battlestar/com6.c
games/hack/hack.invent.c
games/hack/hack.main.c
games/hack/hack.wizard.c
games/larn/diag.c
games/larn/io.c
games/larn/main.c
games/larn/scores.c
games/larn/signal.c
games/rogue/rogue.h
games/rogue/spec_hit.c
games/sail/assorted.c
games/sail/dr_2.c
games/sail/dr_3.c
games/sail/machdep.h
games/sail/pl_1.c
games/sail/pl_2.c
games/sail/pl_3.c
games/sail/pl_4.c
games/sail/pl_5.c
games/sail/pl_6.c
games/sail/pl_7.c
games/sail/pl_main.c
lib/libatm/ip_addr.c
lib/libatm/timer.c
lib/libc/citrus/modules/citrus_iso2022.c
lib/libc/gen/err.c
lib/libc/gen/getnetgrent.c
lib/libc/gen/getvfsbyname.c
lib/libc/gen/getvfsent.c
lib/libc/gen/popen.c
lib/libc/gen/siginterrupt.c
lib/libc/gen/time.c
lib/libc/gen/wait.c
lib/libc/gen/waitpid.c
lib/libc/gmon/gmon.c
lib/libc/stdlib/malloc.c
lib/libc/stdlib/system.c
lib/libstand/cd9660.c
lib/libstand/ext2fs.c
lib/libstand/net.c
lib/libstand/netif.c
lib/libstand/open.c
lib/libstand/ufs.c
lib/libvgl/main.c
lib/libvgl/text.c
libexec/getty/main.c
libexec/getty/subr.c
libexec/rbootd/rbootd.c
libexec/rbootd/rmpproto.c
libexec/revnetgroup/parse_netgroup.c
libexec/rshd/rshd.c
libexec/rtld-elf/rtld.c
libexec/talkd/process.c
libexec/talkd/table.c
libexec/telnetd/slc.c
libexec/telnetd/sys_term.c
libexec/telnetd/telnetd.c
libexec/telnetd/utility.c
sbin/atm/atm/atm_show.c
sbin/disklabel/disklabel.c
sbin/disklabel64/disklabel64.c
sbin/dump/dumprmt.c
sbin/dumpon/dumpon.c
sbin/fsck/inode.c
sbin/fsck/main.c
sbin/fsck/utilities.c
sbin/init/init.c
sbin/mount_nfs/mount_nfs.c
sbin/mount_portal/pt_tcplisten.c
sbin/quotacheck/quotacheck.c
sbin/restore/main.c
sbin/slattach/slattach.c
share/man/man4/ifmib.4
share/man/man4/ttcp.4
sys/conf/nfsswapkernel.c
sys/crypto/sha2/sha2.c
sys/ddb/db_command.c
sys/ddb/db_input.c
sys/ddb/db_variables.c
sys/ddb/db_variables.h
sys/dev/disk/nata/ata-raid.c
sys/dev/netif/sr/if_sr.c
sys/dev/netif/wl/if_wl.c
sys/dev/serial/rp/rpreg.h
sys/dev/serial/stl/stallion.c
sys/dev/video/meteor/meteor.c
sys/kern/kern_acct.c
sys/kern/kern_prot.c
sys/kern/uipc_mbuf.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/vfs_subr.c
sys/net/i4b/driver/i4b_ing.c
sys/net/i4b/driver/i4b_ipr.c
sys/net/i4b/driver/i4b_isppp.c
sys/net/i4b/layer1/i4b_l1dmux.c
sys/net/if_var.h
sys/net/ppp_layer/ppp_tty.c
sys/net/raw_usrreq.c
sys/net/zlib.c
sys/netgraph7/ng_ksocket.c
sys/netinet/ip_icmp.c
sys/netinet/tcp_output.c
sys/netinet/tcp_usrreq.c
sys/netinet6/in6_ifattach.c
sys/netinet6/in6_pcb.c
sys/netinet6/ip6_mroute.c
sys/netinet6/ip6_output.c
sys/netinet6/nd6.c
sys/netproto/atalk/ddp_input.c
sys/netproto/atalk/ddp_usrreq.c
sys/netproto/atm/atm_if.c
sys/netproto/atm/spans/spans_subr.c
sys/netproto/atm/uni/unisig_if.c
sys/netproto/atm/uni/unisig_sigmgr_state.c
sys/netproto/atm/uni/unisig_vc_state.c
sys/netproto/ncp/ncp_sock.c
sys/netproto/ns/idp_usrreq.c
sys/netproto/ns/ns.c
sys/netproto/ns/ns_error.c
sys/netproto/ns/ns_ip.c
sys/netproto/ns/ns_pcb.c
sys/netproto/ns/spp_usrreq.c
sys/platform/pc32/i386/db_trace.c
sys/platform/pc64/amd64/db_trace.c
sys/platform/vkernel/i386/db_trace.c
sys/sys/semaphore.h
sys/vfs/fifofs/fifo_vnops.c
sys/vfs/gnu/ext2fs/ext2_balloc.c
sys/vfs/gnu/ext2fs/ext2_lookup.c
sys/vfs/gnu/ext2fs/ext2_quota.c
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/nfs/nfs_socket.c
sys/vfs/nfs/nfs_subs.c
sys/vfs/nfs/nfs_syscalls.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsm_subs.h
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/ufs/ffs_balloc.c
sys/vfs/ufs/ufs_lookup.c
sys/vfs/ufs/ufs_quota.c
sys/vm/vm_map.c
test/stress/fsx/fsx.c
tools/regression/fsx/fsx.c
usr.bin/chat/chat.c
usr.bin/doscmd/AsyncIO.h
usr.bin/doscmd/ParseBuffer.c
usr.bin/doscmd/doscmd.c
usr.bin/doscmd/mem.c
usr.bin/finger/net.c
usr.bin/login/login.c
usr.bin/netstat/inet.c
usr.bin/netstat/inet6.c
usr.bin/netstat/iso.c
usr.bin/netstat/route.c
usr.bin/netstat/unix.c
usr.bin/nfsstat/nfsstat.c
usr.bin/quota/quota.c
usr.bin/systat/ifstat.c
usr.bin/systat/main.c
usr.bin/talk/init_disp.c
usr.bin/talk/invite.c
usr.bin/talk/msgs.c
usr.bin/telnet/commands.c
usr.bin/telnet/network.c
usr.bin/telnet/sys_bsd.c
usr.bin/tftp/main.c
usr.bin/tip/libacu/acucommon.c
usr.bin/tip/tip/remcap.c
usr.bin/window/cmd4.c
usr.bin/window/lcmd1.c
usr.bin/window/lcmd2.c
usr.bin/window/main.c
usr.bin/window/win.c
usr.bin/window/wwchild.c
usr.bin/window/wwenviron.c
usr.bin/window/wwiomux.c
usr.bin/window/wwtty.c
usr.sbin/ac/ac.c
usr.sbin/atm/atmarpd/atmarp_config.c
usr.sbin/atm/atmarpd/atmarp_scsp.c
usr.sbin/atm/atmarpd/atmarp_subr.c
usr.sbin/atm/atmarpd/atmarpd.c
usr.sbin/atm/scspd/scsp_cafsm.c
usr.sbin/atm/scspd/scsp_config.c
usr.sbin/atm/scspd/scsp_config_lex.c
usr.sbin/atm/scspd/scsp_config_parse.y
usr.sbin/atm/scspd/scsp_hfsm.c
usr.sbin/atm/scspd/scsp_input.c
usr.sbin/atm/scspd/scsp_log.c
usr.sbin/atm/scspd/scsp_msg.c
usr.sbin/atm/scspd/scsp_output.c
usr.sbin/atm/scspd/scsp_print.c
usr.sbin/atm/scspd/scsp_socket.c
usr.sbin/atm/scspd/scsp_subr.c
usr.sbin/atm/scspd/scsp_timer.c
usr.sbin/atm/scspd/scspd.c
usr.sbin/cron/cron/cron.c
usr.sbin/cron/cron/do_command.c
usr.sbin/cron/lib/compat.c
usr.sbin/devinfo/devinfo.c
usr.sbin/edquota/edquota.c
usr.sbin/faithd/faithd.c
usr.sbin/faithd/tcp.c
usr.sbin/fdformat/fdformat.c
usr.sbin/inetd/builtins.c
usr.sbin/inetd/inetd.c
usr.sbin/lpr/common_source/common.c
usr.sbin/lpr/common_source/startdaemon.c
usr.sbin/lpr/lpc/lpc.c
usr.sbin/lpr/lpd/lpd.c
usr.sbin/lpr/lpd/printjob.c
usr.sbin/mrouted/main.c
usr.sbin/mrouted/mtrace.c
usr.sbin/newsyslog/newsyslog.c
usr.sbin/pciconf/pciconf.c
usr.sbin/pppd/main.c
usr.sbin/repquota/repquota.c
usr.sbin/rmt/rmt.c
usr.sbin/rpc.statd/statd.c
usr.sbin/rpc.ypupdated/ypupdated_main.c
usr.sbin/rpc.ypxfrd/ypxfrd_main.c
usr.sbin/timed/timed/master.c
usr.sbin/timed/timed/measure.c
usr.sbin/timed/timed/readmsg.c
usr.sbin/timed/timed/slave.c
usr.sbin/timed/timed/timed.c
usr.sbin/timed/timedc/cmds.c
usr.sbin/timed/timedc/timedc.c
usr.sbin/traceroute/traceroute.c
usr.sbin/traceroute6/traceroute6.c

index c4f01c4..f5e6163 100644 (file)
@@ -137,7 +137,7 @@ loop:
 
        FD_ZERO(&ready);
        FD_SET(s, &ready);
-       found = select(FD_SETSIZE, &ready, (fd_set *)0, (fd_set *)0, &tout);
+       found = select(FD_SETSIZE, &ready, NULL, NULL, &tout);
 
        length = sizeof(errn);
        if (!getsockopt(s,
index 9776879..6420901 100644 (file)
@@ -328,10 +328,10 @@ static const struct limits limits[] = {
        { "locked memory",      "kbytes",       RLIMIT_MEMLOCK, 1024, 'l' },
 #endif
 #ifdef RLIMIT_NPROC
-       { "max user processes", (char *)0,      RLIMIT_NPROC,      1, 'u' },
+       { "max user processes", NULL,           RLIMIT_NPROC,      1, 'u' },
 #endif
 #ifdef RLIMIT_NOFILE
-       { "open files",         (char *)0,      RLIMIT_NOFILE,     1, 'n' },
+       { "open files",         NULL,           RLIMIT_NOFILE,     1, 'n' },
 #endif
 #ifdef RLIMIT_VMEM
        { "virtual mem size",   "kbytes",       RLIMIT_VMEM,    1024, 'v' },
@@ -343,9 +343,9 @@ static const struct limits limits[] = {
        { "sbsize",             "bytes",        RLIMIT_SBSIZE,     1, 'b' },
 #endif
 #ifdef RLIMIT_POSIXLOCK
-       { "posixlocks",         (char *)0,      RLIMIT_POSIXLOCK,  1, 'k' },
+       { "posixlocks",         NULL,           RLIMIT_POSIXLOCK,  1, 'k' },
 #endif
-       { (char *) 0,           (char *)0,      0,                 0, '\0' }
+       { NULL,                 NULL,           0,                 0, '\0' }
 };
 
 int
index a767e9d..9744732 100644 (file)
@@ -319,7 +319,7 @@ getsigaction(int signo, sig_t *sigact)
 {
        struct sigaction sa;
 
-       if (sigaction(signo, (struct sigaction *)0, &sa) == -1)
+       if (sigaction(signo, NULL, &sa) == -1)
                return 0;
        *sigact = (sig_t) sa.sa_handler;
        return 1;
index 662c229..945a57b 100644 (file)
@@ -121,7 +121,7 @@ post(unsigned int ch)
 
        s = sigblock(sigmask(SIGINT));
 
-       gettimeofday(&tv, (struct timezone *)0);        /* can't call time */
+       gettimeofday(&tv, NULL);        /* can't call time */
        tvsec = (time_t) tv.tv_sec;
        date = ctime(&tvsec);
        date[24] = '\0';
index c02d57e..bae7718 100644 (file)
@@ -385,7 +385,7 @@ getobj(const char *let, const char *word)
                        continue;
                }
                if(index(quitchars,ilet))
-                       return((struct obj *)0);
+                       return(NULL);
                if(ilet == '-') {
                        return(allownone ? &zeroobj : (struct obj *) 0);
                }
index 5a42a89..909ba3c 100644 (file)
@@ -292,7 +292,7 @@ not_recovered:
                          (!(Fast & ~INTRINSIC) && (!Fast || rn2(3)))) {
                                movemon();
                                if(!rn2(70))
-                                   makemon((struct permonst *)0, 0, 0);
+                                   makemon(NULL, 0, 0);
                        }
                        if(Glib) glibr();
                        p_timeout();
index f3a04c3..977a174 100644 (file)
@@ -137,7 +137,7 @@ inrange(struct monst *mtmp)
                    case 0:
                        /* create a nasty monster from a deep level */
                        /* (for the moment, 'nasty' is not implemented) */
-                       makemon((struct permonst *)0, u.ux, u.uy);
+                       makemon(NULL, u.ux, u.uy);
                        break;
                    case 1:
                        pline("\"Destroy the thief, my pets!\"");
index 63b1a47..ff8a8b3 100644 (file)
@@ -32,7 +32,7 @@ diag(void)
        cursors();  lwclose();
        if (lcreat(diagfile) < 0)       /*      open the diagnostic file        */
                {
-               lcreat((char*)0); lprcat("\ndiagnostic failure\n"); return(-1);
+               lcreat(NULL); lprcat("\ndiagnostic failure\n"); return(-1);
                }
 
        write(1,"\nDiagnosing . . .\n",18);
@@ -113,7 +113,7 @@ diag(void)
        for (i=0; i<16; i++)  { lprintf("  %5d",(long)rndcount[i]); if (i==7) lprc('\n'); }
 
        lprcat("\n\n");                 lwclose();
-       lcreat((char*)0);               lprcat("Done Diagnosing . . .");
+       lcreat(NULL);           lprcat("Done Diagnosing . . .");
        return(0);
        }
 /*
@@ -166,7 +166,7 @@ savegame(char *fname)
        ointerest();
        if (lcreat(fname) < 0)
                {
-               lcreat((char*)0); lprintf("\nCan't open file <%s> to save game\n",fname);
+               lcreat(NULL); lprintf("\nCan't open file <%s> to save game\n",fname);
                nosignal=0;  return(-1);
                }
 
@@ -198,7 +198,7 @@ savegame(char *fname)
 #ifndef VT100
        setscroll();
 #endif /* VT100 */
-       lcreat((char*)0);  nosignal=0;
+       lcreat(NULL);  nosignal=0;
        return(0);
        }
 
@@ -211,7 +211,7 @@ restoregame(char *fname)
        cursors(); lprcat("\nRestoring . . .");  lflush();
        if (lopen(fname) <= 0)
                {
-               lcreat((char*)0); lprintf("\nCan't open file <%s>to restore game\n",fname);
+               lcreat(NULL); lprintf("\nCan't open file <%s>to restore game\n",fname);
                nap(2000); c[GOLD]=c[BANKACCOUNT]=0;  died(-265); return;
                }
 
@@ -265,7 +265,7 @@ restoregame(char *fname)
        if (strcmp(fname,ckpfile) == 0)
                {
                if (lappend(fname) < 0) fcheat();  else { lprc(' '); lwclose(); }
-               lcreat((char*)0);
+               lcreat(NULL);
                }
        else if (unlink(fname) < 0) fcheat(); /* can't unlink save file */
 /*     for the greedy cheater checker  */
index 5678c84..457ca52 100644 (file)
@@ -171,7 +171,7 @@ newgame(void)
        long *p,*pe;
        for (p=c,pe=c+100; p<pe; *p++ =0);
        time(&initialtime);             srandomdev();
-       lcreat((char*)0);       /* open buffering for output to terminal */
+       lcreat(NULL);   /* open buffering for output to terminal */
        }
 
 /*
@@ -437,7 +437,7 @@ lgetl(void)
  *     lcreat(filename)                        Create a new file for write
  *             char *filename;
  *
- *     lcreat((char*)0); means to the terminal
+ *     lcreat(NULL); means to the terminal
  *     Returns -1 if error, otherwise the file descriptor opened.
  */
 int
index 58c0a25..06e1bd8 100644 (file)
@@ -113,7 +113,7 @@ main(int argc, char **argv)
        inbuffer = malloc((5*MAXIBUF)>>2);      /* output buffer */
        if ((lpbuf==0) || (inbuffer==0)) died(-285); /* malloc() failure */
 
-       lcreat((char*)0);       newgame();              /*      set the initial clock  */ hard= -1;
+       lcreat(NULL);   newgame();              /*      set the initial clock  */ hard= -1;
 
 #ifdef VT100
 /*
index 807d52a..78bf8a0 100644 (file)
@@ -112,7 +112,7 @@ readboard(void)
        if (lopen(scorefile)<0)
          { lprcat("Can't read scoreboard\n"); lflush(); return(-1); }
        lrfill((char*)sco,sizeof(sco));         lrfill((char*)winr,sizeof(winr));
-       lrclose();  lcreat((char*)0);  return(0);
+       lrclose();  lcreat(NULL);  return(0);
        }
 
 /*
@@ -127,7 +127,7 @@ writeboard(void)
        if (lcreat(scorefile)<0)
          { lprcat("Can't write scoreboard\n"); lflush(); return(-1); }
        lwrite((char*)sco,sizeof(sco));         lwrite((char*)winr,sizeof(winr));
-       lwclose();  lcreat((char*)0);  return(0);
+       lwclose();  lcreat(NULL);  return(0);
        }
 
 /*
@@ -293,7 +293,7 @@ void
 showscores(void)
        {
        int i,j;
-       lflush();  lcreat((char*)0);  if (readboard()<0) return;
+       lflush();  lcreat(NULL);  if (readboard()<0) return;
        i=winshou();    j=shou(0);
        if (i+j == 0) lprcat(esb); else lprc('\n');
        lflush();
@@ -308,7 +308,7 @@ void
 showallscores(void)
        {
        int i,j;
-       lflush();  lcreat((char*)0);  if (readboard()<0) return;
+       lflush();  lcreat(NULL);  if (readboard()<0) return;
        c[WEAR] = c[WIELD] = c[SHIELD] = -1;  /* not wielding or wearing anything */
        for (i=0; i<MAXPOTION; i++) potionname[i] = potionhide[i];
        for (i=0; i<MAXSCROLL; i++) scrollname[i] = scrollhide[i];
@@ -522,7 +522,7 @@ invalid:
                        {
                        if (lcreat(logfile)<0) /* and can't create new log file */
                        {
-                               lcreat((char*)0);
+                               lcreat(NULL);
                                lprcat("\nCan't open record file:  I can't post your score.\n");
                                sncbr();  resetscroll();  lflush();  exit(1);
                                }
@@ -596,7 +596,7 @@ diedlog(void)
        int n;
        char *p;
        struct stat stbuf;
-       lcreat((char*)0);
+       lcreat(NULL);
        if (lopen(logfile)<0)
                {
                lprintf("Can't locate log file <%s>\n",logfile);
@@ -668,7 +668,7 @@ addone:
        if (lappend(playerids) < 0) return(-1); /* can't open file for append */
        lprintf("%d\n%s",(long)++high,name);  /* new id # and name */
        lwclose();
-       lcreat((char*)0);       /* re-open terminal channel */
+       lcreat(NULL);   /* re-open terminal channel */
        return(high);
        }
 #endif /* UIDSCORE */
index 6b72fd1..a69f986 100644 (file)
@@ -55,7 +55,7 @@ static void
 tstop(void) /* control Y       */
        {
        if (nosignal)   return;  /* nothing if inhibited */
-       lcreat((char*)0);  clearvt100();        lflush();         signal(SIGTSTP,SIG_DFL);
+       lcreat(NULL);  clearvt100();    lflush();         signal(SIGTSTP,SIG_DFL);
 #ifdef SIGVTALRM
        /* looks like BSD4.2 or higher - must clr mask for signal to take effect*/
        sigsetmask(sigblock(0)& ~BIT(SIGTSTP));
index 98ff79c..6930f51 100644 (file)
@@ -254,8 +254,8 @@ struct obj {                                /* comment is monster meaning */
 
 typedef struct obj object;
 
-#define INIT_AW (object*)0,(object*)0
-#define INIT_RINGS (object*)0,(object*)0
+#define INIT_AW NULL,NULL
+#define INIT_RINGS NULL,NULL
 #define INIT_HP 12
 #define INIT_STR 16,16
 #define INIT_EXP 1,0
index 7c12aeb..c5b5cc4 100644 (file)
@@ -148,7 +148,7 @@ freeze(object *monster)
                        for (i = 0; i < 50; i++) {
                                mv_mons();
                        }
-                       killed_by((object *)0, HYPOTHERMIA);
+                       killed_by(NULL, HYPOTHERMIA);
                }
                message(you_can_move_again, 1);
                monster->m_flags &= (~FREEZING_ROGUE);
index f26cd73..1d682d9 100644 (file)
@@ -103,7 +103,7 @@ table(int rig, int shot, int hittable,
                rigg[3] -= rhits;
        }
        if (rig && !rigg[2] && (!rigg[3] || rigg[3] == -1))
-               makesignal(on, "dismasted!", (struct ship *)0);
+               makesignal(on, "dismasted!", NULL);
        if (portside(from, on, 0)) {
                guns = on->specs->gunR;
                car = on->specs->carR;
@@ -180,7 +180,7 @@ table(int rig, int shot, int hittable,
                        message = "main topmast and mizzen mast shattered";
                        break;
                }
-               makesignal(on, message, (struct ship *)0);
+               makesignal(on, message, NULL);
        } else if (roll == 6) {
                switch (Hhit) {
                case 0:
@@ -206,7 +206,7 @@ table(int rig, int shot, int hittable,
                        message = "shot holes below the water line";
                        break;
                }
-               makesignal(on, message, (struct ship *)0);
+               makesignal(on, message, NULL);
        }
        if (!hull)
                strike(on, from);
index b7a15f6..79fca21 100644 (file)
@@ -98,13 +98,13 @@ checkup(void)
                        foreachship(sq)
                                cleansnag(sp, sq, 1);
                if (sink != 1) {
-                       makesignal(sp, "exploding!", (struct ship *)0);
+                       makesignal(sp, "exploding!", NULL);
                        foreachship(sq) {
                                if (sp != sq && sq->file->dir && range(sp, sq) < 4)
                                        table(RIGGING, L_EXPLODE, sp->specs->guns/13, sq, sp, 6);
                        }
                } else
-                       makesignal(sp, "sinking!", (struct ship *)0);
+                       makesignal(sp, "sinking!", NULL);
        }
 }
 
index d4f6a6d..e5a0228 100644 (file)
@@ -271,8 +271,7 @@ sendbp(struct ship *from, struct ship *to, int sections, char isdefense)
                Write(isdefense ? W_DBP : W_OBP, from,
                        n, turn, to->file->index, sections);
                if (isdefense)
-                       makesignal(from, "repelling boarders",
-                               (struct ship *)0);
+                       makesignal(from, "repelling boarders", NULL);
                else
                        makesignal(from, "boarding the %s (%c%c)", to);
        }
index 4ce6ad3..d244035 100644 (file)
                sigset_t sigset;                                        \
                sigemptyset(&sigset);                                   \
                sigaddset(&sigset, SIGALRM);                            \
-               sigprocmask(SIG_BLOCK, &sigset, (sigset_t *)0);         \
+               sigprocmask(SIG_BLOCK, &sigset, NULL);                  \
        } while (0)
 #define        unblockalarm() \
        do {                                                            \
                sigset_t sigset;                                        \
                sigemptyset(&sigset);                                   \
                sigaddset(&sigset, SIGALRM);                            \
-               sigprocmask(SIG_UNBLOCK, &sigset, (sigset_t *)0);       \
+               sigprocmask(SIG_UNBLOCK, &sigset, NULL);                \
        } while (0)
index b6f73d5..c689ee4 100644 (file)
@@ -58,27 +58,27 @@ leave(int conditions)
 
        if (done_curses) {
                Signal("It looks like you've had it!",
-                       (struct ship *)0);
+                       NULL);
                switch (conditions) {
                case LEAVE_QUIT:
                        break;
                case LEAVE_CAPTURED:
                        Signal("Your ship was captured.",
-                               (struct ship *)0);
+                               NULL);
                        break;
                case LEAVE_HURRICAN:
                        Signal("Hurricane!  All ships destroyed.",
-                               (struct ship *)0);
+                               NULL);
                        break;
                case LEAVE_DRIVER:
-                       Signal("The driver died.", (struct ship *)0);
+                       Signal("The driver died.", NULL);
                        break;
                case LEAVE_SYNC:
-                       Signal("Synchronization error.", (struct ship *)0);
+                       Signal("Synchronization error.", NULL);
                        break;
                default:
                        Signal("A funny thing happened (%d).",
-                               (struct ship *)0, conditions);
+                               NULL, conditions);
                }
        } else {
                switch (conditions) {
@@ -103,7 +103,7 @@ leave(int conditions)
                write_log(ms);
                if (conditions != LEAVE_SYNC) {
                        makesignal(ms, "Captain %s relinquishing.",
-                               (struct ship *)0, mf->captain);
+                               NULL, mf->captain);
                        Write(W_END, ms, 0, 0, 0, 0);
                        Sync();
                }
@@ -127,7 +127,7 @@ child(void)
 
        signal(SIGCHLD, SIG_IGN);
        do {
-               pid = wait3((int *)&status, WNOHANG, (struct rusage *)0);
+               pid = wait3((int *)&status, WNOHANG, NULL);
                if (pid < 0 || (pid > 0 && !WIFSTOPPED(status)))
                        hasdriver = 0;
        } while (pid > 0);
index 0c8b5c1..b512ddb 100644 (file)
@@ -43,7 +43,7 @@ play(void)
        struct ship *sp;
 
        for (;;) {
-               switch (sgetch("~\b", (struct ship *)0, 0)) {
+               switch (sgetch("~\b", NULL, 0)) {
                case 'm':
                        acceptmove();
                        break;
@@ -57,7 +57,7 @@ play(void)
                        unfoulplayer();
                        break;
                case 'v':
-                       Signal("%s", (struct ship *)0, version);
+                       Signal("%s", NULL, version);
                        break;
                case 'b':
                        acceptboard();
@@ -75,7 +75,7 @@ play(void)
                        repair();
                        break;
                case 'B':
-                       Signal("'Hands to stations!'", (struct ship *)0);
+                       Signal("'Hands to stations!'", NULL);
                        unboard(ms, ms, 1);     /* cancel DBP's */
                        unboard(ms, ms, 0);     /* cancel offense */
                        break;
@@ -91,10 +91,10 @@ play(void)
                        mf->loadR = L_EMPTY;
                        mf->readyL = R_EMPTY;
                        mf->readyR = R_EMPTY;
-                       Signal("Broadsides unloaded", (struct ship *)0);
+                       Signal("Broadsides unloaded", NULL);
                        break;
                case 'q':
-                       Signal("Type 'Q' to quit", (struct ship *)0);
+                       Signal("Type 'Q' to quit", NULL);
                        break;
                case 'Q':
                        leave(LEAVE_QUIT);
@@ -106,7 +106,7 @@ play(void)
                        break;
                case 'i':
                        if ((sp = closestenemy(ms, 0, 1)) == 0)
-                               Signal("No more ships left.", (struct ship *)0);
+                               Signal("No more ships left.", NULL);
                        else
                                eyeball(sp);
                        break;
index 7c3a42c..b3397d9 100644 (file)
@@ -95,7 +95,7 @@ acceptcombat(void)
                        closest, r ? "right" : "left");
                if (load > L_CHAIN && target < 6) {
                        switch (sgetch("Aim for hull or rigging? ",
-                               (struct ship *)0, 1)) {
+                               NULL, 1)) {
                        case 'r':
                                shootat = RIGGING;
                                break;
@@ -105,13 +105,13 @@ acceptcombat(void)
                        default:
                                shootat = -1;
                                Signal("'Avast there! Hold your fire.'",
-                                       (struct ship *)0);
+                                       NULL);
                        }
                } else {
-                       if (sgetch("Fire? ", (struct ship *)0, 1) == 'n') {
+                       if (sgetch("Fire? ", NULL, 1) == 'n') {
                                shootat = -1;
                                Signal("Belay that! Hold your fire.",
-                                       (struct ship *)0);
+                                       NULL);
                        } else
                                shootat = RIGGING;
                }
@@ -193,9 +193,9 @@ acceptcombat(void)
                        table(shootat, load, hit, closest, ms, roll);
                }
                Signal("Damage inflicted on the %s:",
-                       (struct ship *)0, closest->shipname);
+                       NULL, closest->shipname);
                Signal("\t%d HULL, %d GUNS, %d CREW, %d RIGGING",
-                       (struct ship *)0, hhits, ghits, chits, rhits);
+                       NULL, hhits, ghits, chits, rhits);
                if (!r) {
                        mf->loadL = L_EMPTY;
                        mf->readyL = R_EMPTY;
@@ -206,7 +206,7 @@ acceptcombat(void)
                continue;
        cant:
                Signal("Unable to fire %s broadside",
-                       (struct ship *)0, r ? "right" : "left");
+                       NULL, r ? "right" : "left");
        }
        blockalarm();
        draw_stat();
@@ -231,10 +231,10 @@ grapungrap(void)
                            || ms->nationality == capship(sp)->nationality) {
                                Write(W_GRAP, ms, sp->file->index, 0, 0, 0);
                                Write(W_GRAP, sp, player, 0, 0, 0);
-                               Signal("Attempt succeeds!", (struct ship *)0);
+                               Signal("Attempt succeeds!", NULL);
                                makesignal(ms, "grappled with %s (%c%c)", sp);
                        } else
-                               Signal("Attempt fails.", (struct ship *)0);
+                               Signal("Attempt fails.", NULL);
                        break;
                case 'u':
                        for (i = grappled2(ms, sp); --i >= 0;) {
@@ -243,13 +243,13 @@ grapungrap(void)
                                    || die() < 3) {
                                        cleangrapple(ms, sp, 0);
                                        Signal("Attempt succeeds!",
-                                               (struct ship *)0);
+                                               NULL);
                                        makesignal(ms,
                                                "ungrappling with %s (%c%c)",
                                                sp);
                                } else
                                        Signal("Attempt fails.",
-                                               (struct ship *)0);
+                                               NULL);
                        }
                        break;
                }
@@ -270,10 +270,10 @@ unfoulplayer(void)
                for (i = fouled2(ms, to); --i >= 0;) {
                        if (die() <= 2) {
                                cleanfoul(ms, to, 0);
-                               Signal("Attempt succeeds!", (struct ship *)0);
+                               Signal("Attempt succeeds!", NULL);
                                makesignal(ms, "Unfouling %s (%c%c)", to);
                        } else
-                               Signal("Attempt fails.", (struct ship *)0);
+                               Signal("Attempt fails.", NULL);
                }
        }
 }
index 390c0b9..0549c92 100644 (file)
@@ -49,19 +49,19 @@ changesail(void)
        if (mc->crew3 && rig) {
                if (!full) {
                        if (sgetch("Increase to Full sails? ",
-                               (struct ship *)0, 1) == 'y') {
+                               NULL, 1) == 'y') {
                                changed = 1;
                                Write(W_FS, ms, 1, 0, 0, 0);
                        }
                } else {
                        if (sgetch("Reduce to Battle sails? ",
-                               (struct ship *)0, 1) == 'y') {
+                               NULL, 1) == 'y') {
                                Write(W_FS, ms, 0, 0, 0, 0);
                                changed = 1;
                        }
                }
        } else if (!rig)
-               Signal("Sails rent to pieces", (struct ship *)0);
+               Signal("Sails rent to pieces", NULL);
 }
 
 void
@@ -119,7 +119,7 @@ eyeball(struct ship *ship)
 
        if (ship->file->dir != 0) {
                Signal("Sail ho! (range %d, %s)",
-                       (struct ship *)0, range(ms, ship), saywhat(ship, 0));
+                       NULL, range(ms, ship), saywhat(ship, 0));
                i = portside(ms, ship, 1) - mf->dir;
                if (i <= 0)
                        i += 8;
index fd179d4..2a08803 100644 (file)
@@ -55,7 +55,7 @@ acceptmove(void)
        char *p;
 
        if (!mc->crew3 || snagged(ms) || !windspeed) {
-               Signal("Unable to move", (struct ship *)0);
+               Signal("Unable to move", NULL);
                return;
        }
 
@@ -76,7 +76,7 @@ acceptmove(void)
                                dir = 1;
                        if (last == 't') {
                                Signal("Ship can't turn that fast.",
-                                       (struct ship *)0);
+                                       NULL);
                                *p-- = '\0';
                        }
                        last = 't';
@@ -104,7 +104,7 @@ acceptmove(void)
                case '5': case '6': case '7':
                        if (last == '0') {
                                Signal("Can't move that fast.",
-                                       (struct ship *)0);
+                                       NULL);
                                *p-- = '\0';
                        }
                        last = '0';
@@ -116,18 +116,18 @@ acceptmove(void)
                        break;
                default:
                        if (!isspace(*p)) {
-                               Signal("Input error.", (struct ship *)0);
+                               Signal("Input error.", NULL);
                                *p-- = '\0';
                        }
                }
        if ((ta < 0 && moved) || (vma < 0 && moved)
            || (af && turnfirst(buf) && moved)) {
-               Signal("Movement error.", (struct ship *)0);
+               Signal("Movement error.", NULL);
                if (ta < 0 && moved) {
                        if (mf->FS == 1) {
                                Write(W_FS, ms, 0, 0, 0, 0);
                                Signal("No hands to set full sails.",
-                                       (struct ship *)0);
+                                       NULL);
                        }
                } else if (ma >= 0)
                        buf[1] = '\0';
@@ -136,7 +136,7 @@ acceptmove(void)
                if (mf->FS == 1) {
                        Write(W_FS, ms, 0, 0, 0, 0);
                        Signal("No hands to set full sails.",
-                               (struct ship *)0);
+                               NULL);
                }
        }
        if (*buf)
@@ -144,7 +144,7 @@ acceptmove(void)
        else
                strcpy(movebuf, "d");
        Writestr(W_MOVE, ms, movebuf);
-       Signal("Helm: %s.", (struct ship *)0, movebuf);
+       Signal("Helm: %s.", NULL, movebuf);
 }
 
 void
@@ -192,7 +192,7 @@ acceptboard(void)
        }
        if (crew[2]) {
                c = sgetch("How many sections to repel boarders? ",
-                       (struct ship *)0, 1);
+                       NULL, 1);
                parties(crew, ms, 1, c);
        }
        blockalarm();
@@ -224,7 +224,7 @@ parties(int crew[3], struct ship *to, char isdefense, char buf)
                        }
                        if (buf > '0')
                                Signal("Sending all crew sections.",
-                                       (struct ship *)0);
+                                       NULL);
                        Write(isdefense ? W_DBP : W_OBP, ms,
                                j, turn, to->file->index, men);
                        if (isdefense) {
@@ -236,7 +236,7 @@ parties(int crew[3], struct ship *to, char isdefense, char buf)
                                                wmove(slot_w, 2, 1 + k);
                                mvwaddstr(slot_w, 3, 0, "DBP");
                                makesignal(ms, "repelling boarders",
-                                       (struct ship *)0);
+                                       NULL);
                        } else {
                                wmove(slot_w, 0, 0);
                                for (k=0; k < NBP; k++)
@@ -251,6 +251,6 @@ parties(int crew[3], struct ship *to, char isdefense, char buf)
                        wrefresh(slot_w);
                        unblockalarm();
                } else
-                       Signal("Sending no crew sections.", (struct ship *)0);
+                       Signal("Sending no crew sections.", NULL);
        }
 }
index ffa702d..adc68e5 100644 (file)
@@ -51,10 +51,10 @@ repair(void)
        ? (ptr->x += count, count = 0) : (count -= m - ptr->x, ptr->x = m))
 
        if (repaired || loaded || fired || changed || turned()) {
-               Signal("No hands free to repair", (struct ship *)0);
+               Signal("No hands free to repair", NULL);
                return;
        }
-       c = sgetch("Repair (hull, guns, rigging)? ", (struct ship *)0, 1);
+       c = sgetch("Repair (hull, guns, rigging)? ", NULL, 1);
        switch (c) {
                case 'h':
                        repairs = &mf->RH;
@@ -66,7 +66,7 @@ repair(void)
                        repairs = &mf->RR;
                        break;
                default:
-                       Signal("Avast heaving!", (struct ship *)0);
+                       Signal("Avast heaving!", NULL);
                        return;
        }
        if (++*repairs >= 3) {
@@ -118,7 +118,7 @@ repair(void)
                        break;
                }
                if (count == 2) {
-                       Signal("Repairs completed.", (struct ship *)0);
+                       Signal("Repairs completed.", NULL);
                        *repairs = 2;
                } else {
                        *repairs = 0;
@@ -151,14 +151,14 @@ loadplayer(void)
        int loadL, loadR, ready, load;
 
        if (!mc->crew3) {
-               Signal("Out of crew", (struct ship *)0);
+               Signal("Out of crew", NULL);
                return;
        }
        loadL = mf->loadL;
        loadR = mf->loadR;
        if (!loadL && !loadR) {
                c = sgetch("Load which broadside (left or right)? ",
-                       (struct ship *)0, 1);
+                       NULL, 1);
                if (c == 'r')
                        loadL = 1;
                else
@@ -166,7 +166,7 @@ loadplayer(void)
        }
        if ((!loadL && loadR) || (loadL && !loadR)) {
                c = sgetch("Reload with (round, double, chain, grape)? ",
-                       (struct ship *)0, 1);
+                       NULL, 1);
                switch (c) {
                case 'r':
                        load = L_ROUND;
@@ -186,7 +186,7 @@ loadplayer(void)
                        break;
                default:
                        Signal("Broadside not loaded.",
-                               (struct ship *)0);
+                               NULL);
                        return;
                }
                if (!loadR) {
index bc2696c..93475e1 100644 (file)
@@ -216,7 +216,7 @@ sgetstr(const char *pr, char *buf, int n)
        int c;
        char *p = buf;
 
-       prompt(pr, (struct ship *)0);
+       prompt(pr, NULL);
        sc_buf = buf;
        for (;;) {
                *p = 0;
index 04ba3e6..e0a0b26 100644 (file)
@@ -51,7 +51,7 @@ pl_main(void)
                exit(1);
        }
        initialize();
-       Signal("Aye aye, Sir", (struct ship *)0);
+       Signal("Aye aye, Sir", NULL);
        play();
        return 0;                       /* for lint,  play() never returns */
 }
index 3acdd1f..5dc5246 100644 (file)
@@ -88,7 +88,7 @@ get_ip_addr(char *p)
                 * IP address is in dotted decimal format
                 */
                if ((sin.sin_addr.s_addr = inet_addr(p)) == -1) {
-                       return((struct sockaddr_in *)0);
+                       return(NULL);
                }
        } else {
                /*
@@ -97,7 +97,7 @@ get_ip_addr(char *p)
                ip_host = gethostbyname(p);
                if (!ip_host ||
                                ip_host->h_addrtype != AF_INET) {
-                       return((struct sockaddr_in *)0);
+                       return(NULL);
                }
                sin.sin_addr.s_addr = *(u_long *)ip_host->h_addr_list[0];
        }
index fdf070e..a5abc85 100644 (file)
@@ -204,7 +204,7 @@ init_timer(void)
        timeval.it_interval.tv_usec = 0;
 
        if (setitimer(ITIMER_REAL, &timeval,
-                       (struct itimerval *)0) == -1) {
+                       NULL) == -1) {
                rc = errno;
                (void)signal(SIGALRM, SIG_DFL);
        }
index 6416c8a..d7e2d66 100644 (file)
@@ -1176,7 +1176,7 @@ sideok:
        len = (size_t)(p - tmp);
        if (n < len) {
                if (result)
-                       *result = (char *)0;
+                       *result = NULL;
                *nresult = (size_t)-1;
                return E2BIG;
        }
index b155574..7b72d0d 100644 (file)
@@ -95,7 +95,7 @@ void
 verrc(int eval, int code, const char *fmt, va_list ap)
 {
        if (err_file == 0)
-               err_set_file((FILE *)0);
+               err_set_file(NULL);
        fprintf(err_file, "%s: ", _getprogname());
        if (fmt != NULL) {
                vfprintf(err_file, fmt, ap);
@@ -120,7 +120,7 @@ void
 verrx(int eval, const char *fmt, va_list ap)
 {
        if (err_file == 0)
-               err_set_file((FILE *)0);
+               err_set_file(NULL);
        fprintf(err_file, "%s: ", _getprogname());
        if (fmt != NULL)
                vfprintf(err_file, fmt, ap);
@@ -160,7 +160,7 @@ void
 vwarnc(int code, const char *fmt, va_list ap)
 {
        if (err_file == 0)
-               err_set_file((FILE *)0);
+               err_set_file(NULL);
        fprintf(err_file, "%s: ", _getprogname());
        if (fmt != NULL) {
                vfprintf(err_file, fmt, ap);
@@ -182,7 +182,7 @@ void
 vwarnx(const char *fmt, va_list ap)
 {
        if (err_file == 0)
-               err_set_file((FILE *)0);
+               err_set_file(NULL);
        fprintf(err_file, "%s: ", _getprogname());
        if (fmt != NULL)
                vfprintf(err_file, fmt, ap);
index 08fd6ca..ad1a162 100644 (file)
@@ -130,7 +130,7 @@ static struct {
        NULL,
        NULL,
 };
-static FILE *netf = (FILE *)0;
+static FILE *netf = NULL;
 
 static int parse_netgrp(const char *);
 static struct linelist *read_for_group(const char *);
@@ -156,7 +156,7 @@ setnetgrent(const char *group)
        if (group == NULL || !strlen(group))
                return;
 
-       if (grouphead.gr == (struct netgrp *)0 ||
+       if (grouphead.gr == NULL ||
                strcmp(group, grouphead.grname)) {
                endnetgrent();
 #ifdef YP
@@ -246,10 +246,10 @@ endnetgrent(void)
                free(olp->l_line);
                free((char *)olp);
        }
-       linehead = (struct linelist *)0;
+       linehead = NULL;
        if (grouphead.grname) {
                free(grouphead.grname);
-               grouphead.grname = (char *)0;
+               grouphead.grname = NULL;
        }
        gp = grouphead.gr;
        while (gp) {
@@ -263,8 +263,8 @@ endnetgrent(void)
                        free(ogp->ng_str[NG_DOM]);
                free((char *)ogp);
        }
-       grouphead.gr = (struct netgrp *)0;
-       nextgrp = (struct netgrp *)0;
+       grouphead.gr = NULL;
+       nextgrp = NULL;
 #ifdef YP
        _netgr_yp_enabled = 0;
 #endif
@@ -428,8 +428,8 @@ parse_netgrp(const char *group)
                        break;
                lp = lp->l_next;
        }
-       if (lp == (struct linelist *)0 &&
-           (lp = read_for_group(group)) == (struct linelist *)0)
+       if (lp == NULL &&
+           (lp = read_for_group(group)) == NULL)
                return (1);
        if (lp->l_parsed) {
 #ifdef DEBUG
@@ -539,7 +539,7 @@ read_for_group(const char *group)
                                        strlen(group), &result, &resultlen)) {
                                free(result);
                                if (_use_only_yp)
-                                       return ((struct linelist *)0);
+                                       return (NULL);
                                else {
                                        _netgr_yp_enabled = 0;
                                        continue;
index 23b6d2b..d79605f 100644 (file)
@@ -55,14 +55,14 @@ getvfsbyname(const char *fsname, struct vfsconf *vfcp)
        name[1] = VFS_GENERIC;
        name[2] = VFS_MAXTYPENUM;
        buflen = sizeof(maxtypenum);
-       if (sysctl(name, 3, &maxtypenum, &buflen, (void *)0, (size_t)0) < 0)
+       if (sysctl(name, 3, &maxtypenum, &buflen, NULL, (size_t)0) < 0)
                return (-1);
 
        name[2] = VFS_CONF;
        buflen = sizeof(*vfcp);
        for (cnt = 0; cnt < maxtypenum; cnt++) {
                name[3] = cnt;
-               if (sysctl(name, 4, vfcp, &buflen, (void *)0, (size_t)0) < 0) {
+               if (sysctl(name, 4, vfcp, &buflen, NULL, (size_t)0) < 0) {
                        if (errno == EOPNOTSUPP)
                                continue;
                        return (-1);
index 96d589d..eaa6742 100644 (file)
@@ -31,7 +31,7 @@ initvfs(void)
        size_t size = 0;
        int rv;
 
-       rv = sysctl(mib, 2, (void *)0, &size, (void *)0, (size_t)0);
+       rv = sysctl(mib, 2, NULL, &size, NULL, (size_t)0);
        if(rv < 0)
                return 0;
 
@@ -41,7 +41,7 @@ initvfs(void)
        if(!_vfslist)
                return 0;
 
-       rv = sysctl(mib, 2, _vfslist, &size, (void *)0, (size_t)0);
+       rv = sysctl(mib, 2, _vfslist, &size, NULL, (size_t)0);
        if(rv < 0) {
                free(_vfslist);
                _vfslist = 0;
index 94118dd..b7eb1d9 100644 (file)
@@ -193,7 +193,7 @@ pclose(FILE *iop)
        fclose(iop);
 
        do {
-               pid = _wait4(cur->pid, &pstat, 0, (struct rusage *)0);
+               pid = _wait4(cur->pid, &pstat, 0, NULL);
        } while (pid == -1 && errno == EINTR);
 
        free(cur);
index a6ed2bb..56dc8c3 100644 (file)
@@ -52,7 +52,7 @@ siginterrupt(int sig, int flag)
        struct sigaction sa;
        int ret;
 
-       if ((ret = _sigaction(sig, (struct sigaction *)0, &sa)) < 0)
+       if ((ret = _sigaction(sig, NULL, &sa)) < 0)
                return (ret);
        if (flag) {
                sigaddset(&_sigintr, sig);
@@ -61,5 +61,5 @@ siginterrupt(int sig, int flag)
                sigdelset(&_sigintr, sig);
                sa.sa_flags |= SA_RESTART;
        }
-       return (_sigaction(sig, &sa, (struct sigaction *)0));
+       return (_sigaction(sig, &sa, NULL));
 }
index 326ab59..91f770d 100644 (file)
@@ -40,7 +40,7 @@ time(time_t *t)
        struct timeval tt;
        time_t retval;
 
-       if (gettimeofday(&tt, (struct timezone *)0) < 0)
+       if (gettimeofday(&tt, NULL) < 0)
                retval = -1;
        else
                retval = tt.tv_sec;
index c5eca6e..4469b6b 100644 (file)
@@ -46,7 +46,7 @@
 pid_t
 __wait(int *istat)
 {
-       return (_wait4(WAIT_ANY, istat, 0, (struct rusage *)0));
+       return (_wait4(WAIT_ANY, istat, 0, NULL));
 }
 
 __weak_reference(__wait, wait);
index acc56f8..68620fc 100644 (file)
@@ -46,7 +46,7 @@
 pid_t
 __waitpid(pid_t pid, int *istat, int options)
 {
-       return (_wait4(pid, istat, options, (struct rusage *)0));
+       return (_wait4(pid, istat, options, NULL));
 }
 
 __weak_reference(__waitpid, waitpid);
index 3189f86..47bfa18 100644 (file)
@@ -232,7 +232,7 @@ moncontrol(int mode)
                p->state = GMON_PROF_ON;
        } else {
                /* stop */
-               profil((char *)0, 0, 0, 0);
+               profil(NULL, 0, 0, 0);
                p->state = GMON_PROF_OFF;
        }
 }
index 71fedc0..86fca39 100644 (file)
@@ -285,7 +285,7 @@ static char *malloc_func;
 
 /* Macro for mmap */
 #define MMAP(size) \
-       mmap((void *)0, (size), PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, \
+       mmap(NULL, (size), PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, \
            -1, (off_t)0)
 
 /*
index cff8da8..1ef4fb1 100644 (file)
@@ -81,7 +81,7 @@ __system(const char *command)
        default:                        /* parent */
                savedpid = pid;
                do {
-                       pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0);
+                       pid = _wait4(savedpid, &pstat, 0, NULL);
                } while (pid == -1 && errno == EINTR);
                break;
        }
index 53feaa6..77ceb2c 100644 (file)
@@ -448,7 +448,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
        blkoff = fp->f_off % ISO_DEFAULT_BLOCK_SIZE;
 
        if (blkno != fp->f_buf_blkno) {
-               if (fp->f_buf == (char *)0)
+               if (fp->f_buf == NULL)
                        fp->f_buf = malloc(ISO_DEFAULT_BLOCK_SIZE);
 
                twiddle();
index fc0f16a..61b790c 100644 (file)
@@ -660,7 +660,7 @@ block_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p)
                }
 
                if (fp->f_blkno[level] != ind_block_num) {
-                       if (fp->f_blk[level] == (char *)0)
+                       if (fp->f_blk[level] == NULL)
                                fp->f_blk[level] =
                                        malloc(fs->fs_bsize);
                        twiddle();
@@ -714,7 +714,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
                if (error)
                        goto done;
 
-               if (fp->f_buf == (char *)0)
+               if (fp->f_buf == NULL)
                        fp->f_buf = malloc(fs->fs_bsize);
 
                if (disk_block == 0) {
@@ -794,8 +794,8 @@ ext2fs_close(struct open_file *f)
        struct file *fp = (struct file *)f->f_fsdata;
        int level;
 
-       f->f_fsdata = (void *)0;
-       if (fp == (struct file *)0)
+       f->f_fsdata = NULL;
+       if (fp == NULL)
                return (0);
 
        for (level = 0; level < NIADDR; level++) {
index f3b0035..52e26b4 100644 (file)
@@ -259,7 +259,7 @@ ip_convertaddr(char *p)
 #define IP_ANYADDR     0
        n_long addr = 0, n;
 
-       if (p == (char *)0 || *p == '\0')
+       if (p == NULL || *p == '\0')
                return IP_ANYADDR;
        p = number(p, &n);
        addr |= (n << 24) & 0xff000000;
index 12b092d..29ac20c 100644 (file)
@@ -278,7 +278,7 @@ netif_open(void *machdep_hint)
        
        /* find a free socket */
        for (fd = 0, s = sockets; fd < SOPEN_MAX; fd++, s++)
-               if (s->io_netif == (struct netif *)0)
+               if (s->io_netif == NULL)
                        goto fnd;
        errno = EMFILE;
        return (-1);
@@ -308,7 +308,7 @@ netif_close(int sock)
                return(-1);
        }
        netif_detach(sockets[sock].io_netif);
-       sockets[sock].io_netif = (struct netif *)0;
+       sockets[sock].io_netif = NULL;
 
        return(0);
 }
index 90b603e..5547c8e 100644 (file)
@@ -103,15 +103,15 @@ open(const char *fname, int mode)
 
     f = &files[fd];
     f->f_flags = mode + 1;
-    f->f_dev = (struct devsw *)0;
-    f->f_ops = (struct fs_ops *)0;
+    f->f_dev = NULL;
+    f->f_ops = NULL;
     f->f_offset = 0;
     f->f_devdata = NULL;
     f->f_fsdata = NULL;
     file = NULL;
     error = devopen(f, fname, &file);
     if (error ||
-       (((f->f_flags & F_NODEV) == 0) && f->f_dev == (struct devsw *)0))
+       (((f->f_flags & F_NODEV) == 0) && f->f_dev == NULL))
        goto err;
 
     /* see if we opened a raw device; otherwise, 'file' is the file name. */
index 3f2afa1..a47a5aa 100644 (file)
@@ -250,7 +250,7 @@ block_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p)
                }
 
                if (fp->f_blkno[level] != ind_block_num) {
-                       if (fp->f_blk[level] == (char *)0)
+                       if (fp->f_blk[level] == NULL)
                                fp->f_blk[level] =
                                        malloc(fs->fs_bsize);
                        twiddle();
@@ -310,7 +310,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
                if (rc)
                        return (rc);
 
-               if (fp->f_buf == (char *)0)
+               if (fp->f_buf == NULL)
                        fp->f_buf = malloc(fs->fs_bsize);
 
                if (disk_block == 0) {
index 864d535..d9cfbfa 100644 (file)
@@ -278,7 +278,7 @@ VGLInit(int mode)
     VGLEnd();
     return -9;
   }
-  VGLTextSetFontFile((byte*)0);
+  VGLTextSetFontFile(NULL);
   VGLClear(VGLDisplay, 0);
   return 0;
 }
index 61c7293..5c91125 100644 (file)
@@ -48,7 +48,7 @@ FILE *fd;
     free(VGLTextFont);
   }
 
-  if ((VGLTextFont=(VGLText*)malloc(sizeof(VGLText))) == (VGLText*)0)
+  if ((VGLTextFont=(VGLText*)malloc(sizeof(VGLText))) == NULL)
        return 1;
 
   if (filename==NULL) {
@@ -57,7 +57,7 @@ FILE *fd;
     VGLTextFont->BitmapArray = VGLFont;
   }
   else {
-    if ((fd=fopen(filename, "r"))==(FILE*)0)
+    if ((fd=fopen(filename, "r"))==NULL)
       return 1;
     fread(&VGLTextFont->Width, 1 , 1, fd);
     fread(&VGLTextFont->Height, 1 , 1, fd);
index 942fb98..cd77f4c 100644 (file)
@@ -388,7 +388,7 @@ main(int argc, char **argv)
                                exit(1);
                        }
                        signal(SIGINT, SIG_DFL);
-                       for (i = 0; environ[i] != (char *)0; i++)
+                       for (i = 0; environ[i] != NULL; i++)
                                env[i] = environ[i];
                        makeenv(&env[i]);
 
index bcb33aa..287fe44 100644 (file)
@@ -734,7 +734,7 @@ makeenv(char *env[])
                if (*p)
                        *ep++ = p;
        }
-       *ep = (char *)0;
+       *ep = NULL;
 }
 
 /*
index a4484c1..6f8f432 100644 (file)
@@ -304,7 +304,7 @@ DoTimeout()
        RMPCONN *rtmp;
        struct timeval now;
 
-       (void) gettimeofday(&now, (struct timezone *)0);
+       (void) gettimeofday(&now, NULL);
 
        /*
         *  For each active connection, if RMP_TIMEOUT seconds have passed
index 5bc87e3..31985ed 100644 (file)
@@ -582,7 +582,7 @@ SendPacket(rconn)
        /*
         *  Last time this connection was active.
         */
-       (void) gettimeofday(&rconn->tstamp, (struct timezone *)0);
+       (void) gettimeofday(&rconn->tstamp, NULL);
 
        if (DbgFp != NULL)                      /* display packet */
                DispPkt(rconn,DIR_SENT);
index 3e09974..5b90887 100644 (file)
@@ -73,14 +73,14 @@ struct netgrp {
 #define NG_USER                1       /* User name */
 #define NG_DOM         2       /* and Domain name */
 
-static struct linelist *linehead = (struct linelist *)0;
-static struct netgrp   *nextgrp = (struct netgrp *)0;
+static struct linelist *linehead = NULL;
+static struct netgrp   *nextgrp = NULL;
 static struct {
        struct netgrp   *gr;
        char            *grname;
 } grouphead = {
-       (struct netgrp *)0,
-       (char *)0,
+       NULL,
+       NULL,
 };
 static int parse_netgrp(char *);
 static struct linelist *read_for_group(char *);
@@ -100,7 +100,7 @@ __setnetgrent(char *group)
        if (group == NULL || !strlen(group))
                return;
 
-       if (grouphead.gr == (struct netgrp *)0 ||
+       if (grouphead.gr == NULL ||
                strcmp(group, grouphead.grname)) {
                __endnetgrent();
                if (parse_netgrp(group))
@@ -147,10 +147,10 @@ __endnetgrent(void)
                free(olp->l_line);
                free((char *)olp);
        }
-       linehead = (struct linelist *)0;
+       linehead = NULL;
        if (grouphead.grname) {
                free(grouphead.grname);
-               grouphead.grname = (char *)0;
+               grouphead.grname = NULL;
        }
        gp = grouphead.gr;
        while (gp) {
@@ -164,7 +164,7 @@ __endnetgrent(void)
                        free(ogp->ng_str[NG_DOM]);
                free((char *)ogp);
        }
-       grouphead.gr = (struct netgrp *)0;
+       grouphead.gr = NULL;
 }
 
 /*
@@ -190,8 +190,8 @@ parse_netgrp(char *group)
                        break;
                lp = lp->l_next;
        }
-       if (lp == (struct linelist *)0 &&
-           (lp = read_for_group(group)) == (struct linelist *)0)
+       if (lp == NULL &&
+           (lp = read_for_group(group)) == NULL)
                return (1);
        if (lp->l_parsed) {
 #ifdef DEBUG
@@ -357,5 +357,5 @@ read_for_group(char *group)
 #endif
                        return (lp);
        }
-       return ((struct linelist *)0);
+       return (NULL);
 }
index 5721999..e53d148 100644 (file)
@@ -500,8 +500,8 @@ fail:
                                                break;
                                } else
 #endif
-                                       if (select(nfd, &ready, (fd_set *)0,
-                                         (fd_set *)0, (struct timeval *)0) < 0)
+                                       if (select(nfd, &ready, NULL,
+                                         NULL, NULL) < 0)
                                                break;
                                if (FD_ISSET(s, &ready)) {
                                        int     ret;
index 9e677ca..eddf1dc 100644 (file)
@@ -1970,7 +1970,7 @@ dladdr(const void *addr, Dl_info *info)
     }
     info->dli_fname = obj->path;
     info->dli_fbase = obj->mapbase;
-    info->dli_saddr = (void *)0;
+    info->dli_saddr = NULL;
     info->dli_sname = NULL;
 
     /*
index 88ceb46..17f160c 100644 (file)
@@ -116,7 +116,7 @@ process_request(mp, rp)
 
        case LEAVE_INVITE:
                ptr = find_request(mp);
-               if (ptr != (CTL_MSG *)0) {
+               if (ptr != NULL) {
                        rp->id_num = htonl(ptr->id_num);
                        rp->answer = SUCCESS;
                } else
@@ -125,7 +125,7 @@ process_request(mp, rp)
 
        case LOOK_UP:
                ptr = find_match(mp);
-               if (ptr != (CTL_MSG *)0) {
+               if (ptr != NULL) {
                        rp->id_num = htonl(ptr->id_num);
                        rp->addr = ptr->addr;
                        rp->addr.sa_family = htons(ptr->addr.sa_family);
@@ -164,7 +164,7 @@ do_announce(mp, rp)
 #define        satosin(sa)     ((struct sockaddr_in *)(sa))
        hp = gethostbyaddr(&satosin(&mp->ctl_addr)->sin_addr,
                sizeof (struct in_addr), AF_INET);
-       if (hp == (struct hostent *)0) {
+       if (hp == NULL) {
                rp->answer = MACHINE_UNKNOWN;
                return;
        }
index 5fea450..9ab5cfe 100644 (file)
@@ -55,8 +55,6 @@
 
 #define MAX_ID 16000   /* << 2^15 so I don't have sign troubles */
 
-#define NIL ((TABLE_ENTRY *)0)
-
 extern int debug;
 struct timeval tp;
 struct timezone txp;
@@ -70,7 +68,7 @@ struct table_entry {
        TABLE_ENTRY *last;
 };
 
-TABLE_ENTRY *table = NIL;
+TABLE_ENTRY *table = NULL;
 
 void delete (TABLE_ENTRY *);
 CTL_MSG *find_request();
@@ -93,7 +91,7 @@ find_match(request)
        current_time = tp.tv_sec;
        if (debug)
                print_request("find_match", request);
-       for (ptr = table; ptr != NIL; ptr = ptr->next) {
+       for (ptr = table; ptr != NULL; ptr = ptr->next) {
                if ((ptr->time - current_time) > MAX_LIFE) {
                        /* the entry is too old */
                        if (debug)
@@ -109,7 +107,7 @@ find_match(request)
                     ptr->request.type == LEAVE_INVITE)
                        return (&ptr->request);
        }
-       return ((CTL_MSG *)0);
+       return (NULL);
 }
 
 /*
@@ -131,7 +129,7 @@ find_request(request)
         */
        if (debug)
                print_request("find_request", request);
-       for (ptr = table; ptr != NIL; ptr = ptr->next) {
+       for (ptr = table; ptr != NULL; ptr = ptr->next) {
                if ((ptr->time - current_time) > MAX_LIFE) {
                        /* the entry is too old */
                        if (debug)
@@ -151,7 +149,7 @@ find_request(request)
                        return (&ptr->request);
                }
        }
-       return ((CTL_MSG *)0);
+       return (NULL);
 }
 
 void
@@ -168,16 +166,16 @@ insert_table(request, response)
        response->id_num = htonl(request->id_num);
        /* insert a new entry into the top of the list */
        ptr = (TABLE_ENTRY *)malloc(sizeof(TABLE_ENTRY));
-       if (ptr == NIL) {
+       if (ptr == NULL) {
                syslog(LOG_ERR, "insert_table: Out of memory");
                _exit(1);
        }
        ptr->time = current_time;
        ptr->request = *request;
        ptr->next = table;
-       if (ptr->next != NIL)
+       if (ptr->next != NULL)
                ptr->next->last = ptr;
-       ptr->last = NIL;
+       ptr->last = NULL;
        table = ptr;
 }
 
@@ -208,13 +206,13 @@ delete_invite(id_num)
        ptr = table;
        if (debug)
                syslog(LOG_DEBUG, "delete_invite(%d)", id_num);
-       for (ptr = table; ptr != NIL; ptr = ptr->next) {
+       for (ptr = table; ptr != NULL; ptr = ptr->next) {
                if (ptr->request.id_num == id_num)
                        break;
                if (debug)
                        print_request("", &ptr->request);
        }
-       if (ptr != NIL) {
+       if (ptr != NULL) {
                delete(ptr);
                return (SUCCESS);
        }
@@ -233,9 +231,9 @@ delete(ptr)
                print_request("delete", &ptr->request);
        if (table == ptr)
                table = ptr->next;
-       else if (ptr->last != NIL)
+       else if (ptr->last != NULL)
                ptr->last->next = ptr->next;
-       if (ptr->next != NIL)
+       if (ptr->next != NULL)
                ptr->next->last = ptr->last;
        free((char *)ptr);
 }
index 06aea4a..568d8b7 100644 (file)
@@ -41,7 +41,7 @@
 /*
  * local variables
  */
-static unsigned char   *def_slcbuf = (unsigned char *)0;
+static unsigned char   *def_slcbuf = NULL;
 static int             def_slclen = 0;
 static int             slcchange;      /* change to slc is requested */
 static unsigned char   *slcptr;        /* pointer into slc buffer */
@@ -447,10 +447,10 @@ do_opt_slc(unsigned char *ptr, int len)
                 * save this slc buffer if it is the first, otherwise dump
                 * it.
                 */
-               if (def_slcbuf == (unsigned char *)0) {
+               if (def_slcbuf == NULL) {
                        def_slclen = len;
                        def_slcbuf = (unsigned char *)malloc((unsigned)len);
-                       if (def_slcbuf == (unsigned char *)0)
+                       if (def_slcbuf == NULL)
                                return;  /* too bad */
                        memmove(def_slcbuf, ptr, len);
                }
@@ -471,7 +471,7 @@ deferslc(void)
                do_opt_slc(def_slcbuf, def_slclen);
                (void) end_slc(0);
                free(def_slcbuf);
-               def_slcbuf = (unsigned char *)0;
+               def_slcbuf = NULL;
                def_slclen = 0;
        }
 
index 60cb0de..569731b 100644 (file)
@@ -273,11 +273,11 @@ spcset(int func, cc_t *valp, cc_t **valpp)
        case SLC_AYT:
        case SLC_EOR:
                *valp = (cc_t)0;
-               *valpp = (cc_t *)0;
+               *valpp = NULL;
                return(SLC_DEFAULT);
        default:
                *valp = (cc_t)0;
-               *valpp = (cc_t *)0;
+               *valpp = NULL;
                return(SLC_NOSUPPORT);
        }
 }
@@ -288,7 +288,7 @@ spcset(int func, cc_t *valp, cc_t **valpp)
 #define        setval(a, b)    *valp = termbuf.c_cc[a]; \
                        *valpp = &termbuf.c_cc[a]; \
                        return(b);
-#define        defval(a) *valp = ((cc_t)a); *valpp = (cc_t *)0; return(SLC_DEFAULT);
+#define        defval(a) *valp = ((cc_t)a); *valpp = NULL; return(SLC_DEFAULT);
 
 int
 spcset(int func, cc_t *valp, cc_t **valpp)
@@ -868,7 +868,7 @@ getptyslave(void)
 # ifdef        TIOCNOTTY
        t = open(_PATH_TTY, O_RDWR);
        if (t >= 0) {
-               (void) ioctl(t, TIOCNOTTY, (char *)0);
+               (void) ioctl(t, TIOCNOTTY, NULL);
                (void) close(t);
        }
 # endif
@@ -1094,7 +1094,7 @@ addarg(char **argv, const char *val)
                if (argv == NULL)
                        return(NULL);
                *argv++ = (char *)10;
-               *argv = (char *)0;
+               *argv = NULL;
        }
        for (cpp = argv; *cpp; cpp++)
                ;
index 744a0ba..10d810b 100644 (file)
@@ -758,7 +758,7 @@ telnet(int f, int p, char *host)
                int t;
                t = open(_PATH_TTY, O_RDWR);
                if (t >= 0) {
-                       (void) ioctl(t, TIOCNOTTY, (char *)0);
+                       (void) ioctl(t, TIOCNOTTY, NULL);
                        (void) close(t);
                }
        }
@@ -839,8 +839,7 @@ telnet(int f, int p, char *host)
                if (!SYNCHing) {
                        FD_SET(f, &xbits);
                }
-               if ((c = select(nfd, &ibits, &obits, &xbits,
-                                               (struct timeval *)0)) < 1) {
+               if ((c = select(nfd, &ibits, &obits, &xbits, NULL)) < 1) {
                        if (c == -1) {
                                if (errno == EINTR) {
                                        continue;
index db9d52e..473834d 100644 (file)
@@ -96,7 +96,7 @@ stilloob(int s)
        FD_ZERO(&excepts);
        FD_SET(s, &excepts);
        memset((char *)&timeout, 0, sizeof timeout);
-       value = select(s+1, (fd_set *)0, (fd_set *)0, &excepts, &timeout);
+       value = select(s+1, NULL, NULL, &excepts, &timeout);
     } while ((value == -1) && (errno == EINTR));
 
     if (value < 0) {
index 7ee3a60..c183649 100644 (file)
@@ -398,7 +398,7 @@ void
 show_ip_vcc(int argc, char **argv, __unused const struct cmd *cmdp)
 {
        int                     buf_len, ip_info_len, rc;
-       char                    *if_name = (char *)0;
+       char                    *if_name = NULL;
        struct atminfreq        air;
        struct air_ip_vcc_rsp   *ip_info, *ip_info_base;
        struct sockaddr_in      *sin;
index 75baf14..bec4f33 100644 (file)
@@ -815,9 +815,9 @@ editit(void)
                sigsetmask(omask);
                setgid(getgid());
                setuid(getuid());
-               if ((ed = getenv("EDITOR")) == (char *)0)
+               if ((ed = getenv("EDITOR")) == NULL)
                        ed = DEFEDITOR;
-               execlp(ed, ed, tmpfil, (char *)0);
+               execlp(ed, ed, tmpfil, NULL);
                err(1, "%s", ed);
        }
        while ((xpid = wait(&status)) >= 0)
index d6b1b01..d765994 100644 (file)
@@ -822,9 +822,9 @@ editit(void)
                sigsetmask(omask);
                setgid(getgid());
                setuid(getuid());
-               if ((ed = getenv("EDITOR")) == (char *)0)
+               if ((ed = getenv("EDITOR")) == NULL)
                        ed = DEFEDITOR;
-               execlp(ed, ed, tmpfil, (char *)0);
+               execlp(ed, ed, tmpfil, NULL);
                err(1, "%s", ed);
        }
        while ((xpid = wait(&status)) >= 0)
index e914772..677a6d8 100644 (file)
@@ -167,8 +167,7 @@ rmtgetconn(void)
        msg("%s", "");
 #ifdef KERBEROS
        if (dokerberos)
-               rmtape = krcmd(&rmtpeer, sp->s_port, tuser, rmt, &errfd,
-                              (char *)0);
+               rmtape = krcmd(&rmtpeer, sp->s_port, tuser, rmt, &errfd, NULL);
        else
 #endif
                rmtape = rcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name,
index ca2bcce..36cad43 100644 (file)
@@ -88,8 +88,7 @@ main(int argc, char **argv)
        mib[0] = CTL_KERN;
        mib[1] = KERN_DUMPDEV;
 
-       rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev,
-                   sizeof stab.st_rdev);
+       rv = sysctl(mib, 2, NULL, NULL, &stab.st_rdev, sizeof stab.st_rdev);
        if (rv) {
                err(EX_OSERR, "sysctl: kern.dumpdev");
        }
index 15a0020..16f1fbf 100644 (file)
@@ -416,7 +416,7 @@ getinoinfo(ufs1_ino_t inumber)
                return (inp);
        }
        errx(EEXIT, "cannot find inode %d", inumber);
-       return ((struct inoinfo *)0);
+       return (NULL);
 }
 
 /*
index 1159dc0..8e5e4ac 100644 (file)
@@ -312,9 +312,9 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child)
                        printf("\n");
                }
        }
-       zlnhead = (struct zlncnt *)0;
-       duplist = (struct dups *)0;
-       muldup = (struct dups *)0;
+       zlnhead = NULL;
+       duplist = NULL;
+       muldup = NULL;
        inocleanup();
        if (fsmodified) {
                sblock.fs_time = time(NULL);
index fd35817..19b1f4a 100644 (file)
@@ -137,7 +137,7 @@ bufinit(void)
        long bufcnt, i;
        char *bufp;
 
-       pbp = pdirbp = (struct bufarea *)0;
+       pbp = pdirbp = NULL;
        bufp = malloc((unsigned int)sblock.fs_bsize);
        if (bufp == 0)
                errx(EEXIT, "cannot allocate buffer pool");
@@ -273,7 +273,7 @@ ckfini(int markclean)
        }
        if (bufhead.b_size != cnt)
                errx(EEXIT, "panic: lost %d buffers", bufhead.b_size - cnt);
-       pbp = pdirbp = (struct bufarea *)0;
+       pbp = pdirbp = NULL;
        if (sblock.fs_clean != markclean) {
                sblock.fs_clean = markclean;
                sbdirty();
index b0095c5..0a749f1 100644 (file)
@@ -310,8 +310,8 @@ invalid:
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = 0;
        sa.sa_handler = SIG_IGN;
-       sigaction(SIGTTIN, &sa, (struct sigaction *)0);
-       sigaction(SIGTTOU, &sa, (struct sigaction *)0);
+       sigaction(SIGTTIN, &sa, NULL);
+       sigaction(SIGTTOU, &sa, NULL);
 
        /*
         * Paranoia.
@@ -762,8 +762,8 @@ runcom(void)
                sigemptyset(&sa.sa_mask);
                sa.sa_flags = 0;
                sa.sa_handler = SIG_IGN;
-               sigaction(SIGTSTP, &sa, (struct sigaction *)0);
-               sigaction(SIGHUP, &sa, (struct sigaction *)0);
+               sigaction(SIGTSTP, &sa, NULL);
+               sigaction(SIGHUP, &sa, NULL);
 
                setctty(_PATH_CONSOLE);
 
@@ -1456,7 +1456,7 @@ death(void)
                clang = 0;
                alarm(DEATH_WATCH);
                do
-                       if ((pid = waitpid(-1, (int *)0, 0)) != -1)
+                       if ((pid = waitpid(-1, NULL, 0)) != -1)
                                collect_child(pid);
                while (clang == 0 && errno != ECHILD);
 
@@ -1506,8 +1506,8 @@ runshutdown(void)
                sigemptyset(&sa.sa_mask);
                sa.sa_flags = 0;
                sa.sa_handler = SIG_IGN;
-               sigaction(SIGTSTP, &sa, (struct sigaction *)0);
-               sigaction(SIGHUP, &sa, (struct sigaction *)0);
+               sigaction(SIGTSTP, &sa, NULL);
+               sigaction(SIGHUP, &sa, NULL);
 
                if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1)
                    warning("can't open %s: %m", _PATH_CONSOLE);
index 571a051..9453be8 100644 (file)
@@ -118,11 +118,11 @@ struct mntopt mopts[] = {
 
 struct nfs_args nfsdefargs = {
        NFS_ARGSVERSION,
-       (struct sockaddr *)0,
+       NULL,
        sizeof (struct sockaddr_in),
        SOCK_DGRAM,
        0,
-       (u_char *)0,
+       NULL,
        0,
        NFSMNT_RESVPORT,
        NFS_WSIZE,
@@ -134,7 +134,7 @@ struct nfs_args nfsdefargs = {
        NFS_DEFRAHEAD,
        0,
        NFS_DEADTHRESH,
-       (char *)0,
+       NULL,
        /* args version 4 */
        NFS_MINATTRTIMO,
        NFS_MAXATTRTIMO,
@@ -538,7 +538,7 @@ main(int argc, char **argv)
                         */
                        if (kret == KSUCCESS &&
                            ktick.kt.length <= (RPCAUTH_MAXSIZ-3*NFSX_UNSIGNED)
-                           && gettimeofday(&ktv, (struct timezone *)0) == 0) {
+                           && gettimeofday(&ktv, NULL) == 0) {
                            ncd.ncd_authtype = RPCAUTH_KERB4;
                            ncd.ncd_authstr = (u_char *)&ktick;
                            ncd.ncd_authlen = nfsm_rndup(ktick.kt.length) +
index 522cfc7..68256e9 100644 (file)
@@ -157,7 +157,7 @@ portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso,
                sain.sin_addr.s_addr = INADDR_ANY;
                if (bind(so, (struct sockaddr *) &sain, sizeof(sain)) == 0) {
                        listen(so, 1);
-                       if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) {
+                       if ((sock = accept(so, NULL, NULL)) == -1) {
                                syslog(LOG_ERR, "accept: %m");
                                close(so);
                                return (errno);
@@ -184,7 +184,7 @@ portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso,
                sain.sin_addr = *ipp[0];
                if (bind(so, (struct sockaddr *) &sain, sizeof(sain)) == 0) {
                        listen(so, 1);
-                       if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) {
+                       if ((sock = accept(so, NULL, NULL)) == -1) {
                                syslog(LOG_ERR, "accept: %m");
                                close(so);
                                return (errno);
index bf96ada..7835557 100644 (file)
@@ -267,7 +267,7 @@ chkquota(char *fsname, char *mntpt, struct quotaname *qnp)
                                continue;
                        if (qnp->flags & HASGRP) {
                                fup = addid((u_long)dp->di_gid, GRPQUOTA,
-                                   (char *)0);
+                                   NULL);
                                fup->fu_curinodes++;
                                if (mode == IFREG || mode == IFDIR ||
                                    mode == IFLNK)
@@ -275,7 +275,7 @@ chkquota(char *fsname, char *mntpt, struct quotaname *qnp)
                        }
                        if (qnp->flags & HASUSR) {
                                fup = addid((u_long)dp->di_uid, USRQUOTA,
-                                   (char *)0);
+                                   NULL);
                                fup->fu_curinodes++;
                                if (mode == IFREG || mode == IFDIR ||
                                    mode == IFLNK)
index 4bcc368..1f665d1 100644 (file)
@@ -209,7 +209,7 @@ main(int argc, char **argv)
                         * This is a level zero dump tape.
                         */
                        vprintf(stdout, "Begin level 0 restore\n");
-                       initsymtable((char *)0);
+                       initsymtable(NULL);
                        extractdirs(1);
                        vprintf(stdout, "Calculate extraction list.\n");
                        treescan(".", ROOTINO, nodeupdates);
@@ -243,7 +243,7 @@ main(int argc, char **argv)
        case 't':
                setup();
                extractdirs(0);
-               initsymtable((char *)0);
+               initsymtable(NULL);
                while (argc--) {
                        canon(*argv++, name, sizeof(name));
                        ino = dirlookup(name);
@@ -258,7 +258,7 @@ main(int argc, char **argv)
        case 'x':
                setup();
                extractdirs(1);
-               initsymtable((char *)0);
+               initsymtable(NULL);
                while (argc--) {
                        canon(*argv++, name, sizeof(name));
                        ino = dirlookup(name);
index f98727c..cd3880d 100644 (file)
@@ -72,7 +72,7 @@ static void acquire_line(void);               /* get tty device as controlling terminal */
 static void usage(void);
 
 int    fd = -1;
-char   *dev = (char *)0;       /* path name of the tty (e.g. /dev/tty01) */
+char   *dev = NULL;    /* path name of the tty (e.g. /dev/tty01) */
 char    *dvname;                /* basename of dev */
 int     locked = 0;             /* uucp lock active */
 int    flow_control = 0;       /* non-zero to enable hardware flow control. */
@@ -174,7 +174,7 @@ main(int argc, char **argv)
            warnx("too many args, first='%s'", argv[optind]);
        if (optind > (argc - 1))
            warnx("not enough args");
-       if (dev == (char *)0) {
+       if (dev == NULL) {
                usage();
                exit_handler(2);
        }
index 009c67a..4e3b167 100644 (file)
@@ -110,7 +110,7 @@ get_ifmib_general(int row, struct ifmibdata *ifmd)
 
        len = sizeof(*ifmd);
 
-       return sysctl(name, 6, ifmd, &len, (void *)0, 0);
+       return sysctl(name, 6, ifmd, &len, NULL, 0);
 }
 .Ed
 .Pp
index 11331c4..cf5f5ea 100644 (file)
@@ -195,7 +195,7 @@ phase would ordinarily have included a call to
 .Fn write ,
 one substitutes:
 .Pp
-.Dl "sendto(sock, buf, len, MSG_EOF, (struct sockaddr *)0, 0)"
+.Dl "sendto(sock, buf, len, MSG_EOF, NULL, 0)"
 .Pp
 In this case, the reply is sent immediately, but as in the client
 case, the socket is no longer useful for anything and should be
index 28833c5..7161369 100644 (file)
@@ -67,8 +67,8 @@ struct nfs_diskless nfs_diskless = {
        },
        { 0x10, 0x2, { 0x0, 0x0, 0x83, 0x68, 0x30, 0x12, } },
        {
-         (struct sockaddr *)0, SOCK_DGRAM, 0, (nfsv2fh_t *)0,
-         0, 8192, 8192, 10, 100, (char *)0,
+         NULL, SOCK_DGRAM, 0, NULL,
+         0, 8192, 8192, 10, 100, NULL,
        },
        {
                0xf,
@@ -107,8 +107,8 @@ struct nfs_diskless nfs_diskless = {
        { 0x10, 0x2, { 0x8, 0x1, 0x83, 0x68, 0x30, 0x5, } },
        "happy",
        {
-         (struct sockaddr *)0, SOCK_DGRAM, 0, (nfsv2fh_t *)0,
-         0, 8192, 8192, 10, 100, (char *)0,
+         NULL, SOCK_DGRAM, 0, NULL,
+         0, 8192, 8192, 10, 100, NULL,
        },
        {
                0x0,
index c8507ab..a6ecc16 100644 (file)
@@ -39,6 +39,7 @@
  */
 
 
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/systm.h>
@@ -319,7 +320,7 @@ static const char *sha2_hex_digits = "0123456789abcdef";
 
 /*** SHA-256: *********************************************************/
 void SHA256_Init(SHA256_CTX* context) {
-       if (context == (SHA256_CTX*)0) {
+       if (context == NULL) {
                return;
        }
        bcopy(sha256_initial_hash_value, context->state, SHA256_DIGEST_LENGTH);
@@ -511,7 +512,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
        }
 
        /* Sanity check: */
-       assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0);
+       assert(context != NULL && data != NULL);
 
        usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
        if (usedspace > 0) {
@@ -555,10 +556,10 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
        unsigned int    usedspace;
 
        /* Sanity check: */
-       assert(context != (SHA256_CTX*)0);
+       assert(context != NULL);
 
        /* If no digest buffer is passed, we don't bother doing this: */
-       if (digest != (sha2_byte*)0) {
+       if (digest != NULL) {
                usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
 #if BYTE_ORDER == LITTLE_ENDIAN
                /* Convert FROM host byte order */
@@ -618,9 +619,9 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
        int             i;
 
        /* Sanity check: */
-       assert(context != (SHA256_CTX*)0);
+       assert(context != NULL);
 
-       if (buffer != (char*)0) {
+       if (buffer != NULL) {
                SHA256_Final(digest, context);
 
                for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
@@ -647,7 +648,7 @@ char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_S
 
 /*** SHA-512: *********************************************************/
 void SHA512_Init(SHA512_CTX* context) {
-       if (context == (SHA512_CTX*)0) {
+       if (context == NULL) {
                return;
        }
        bcopy(sha512_initial_hash_value, context->state, SHA512_DIGEST_LENGTH);
@@ -833,7 +834,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
        }
 
        /* Sanity check: */
-       assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0);
+       assert(context != NULL && data != NULL);
 
        usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
        if (usedspace > 0) {
@@ -917,10 +918,10 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
        sha2_word64     *d = (sha2_word64*)digest;
 
        /* Sanity check: */
-       assert(context != (SHA512_CTX*)0);
+       assert(context != NULL);
 
        /* If no digest buffer is passed, we don't bother doing this: */
-       if (digest != (sha2_byte*)0) {
+       if (digest != NULL) {
                SHA512_Last(context);
 
                /* Save the hash data for output: */
@@ -947,9 +948,9 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
        int             i;
 
        /* Sanity check: */
-       assert(context != (SHA512_CTX*)0);
+       assert(context != NULL);
 
-       if (buffer != (char*)0) {
+       if (buffer != NULL) {
                SHA512_Final(digest, context);
 
                for (i = 0; i < SHA512_DIGEST_LENGTH; i++) {
@@ -976,7 +977,7 @@ char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_S
 
 /*** SHA-384: *********************************************************/
 void SHA384_Init(SHA384_CTX* context) {
-       if (context == (SHA384_CTX*)0) {
+       if (context == NULL) {
                return;
        }
        bcopy(sha384_initial_hash_value, context->state, SHA512_DIGEST_LENGTH);
@@ -992,10 +993,10 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
        sha2_word64     *d = (sha2_word64*)digest;
 
        /* Sanity check: */
-       assert(context != (SHA384_CTX*)0);
+       assert(context != NULL);
 
        /* If no digest buffer is passed, we don't bother doing this: */
-       if (digest != (sha2_byte*)0) {
+       if (digest != NULL) {
                SHA512_Last((SHA512_CTX*)context);
 
                /* Save the hash data for output: */
@@ -1022,9 +1023,9 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
        int             i;
 
        /* Sanity check: */
-       assert(context != (SHA384_CTX*)0);
+       assert(context != NULL);
 
-       if (buffer != (char*)0) {
+       if (buffer != NULL) {
                SHA384_Final(digest, context);
 
                for (i = 0; i < SHA384_DIGEST_LENGTH; i++) {
index 8425c91..becb3b2 100644 (file)
@@ -238,7 +238,7 @@ db_command(struct command **last_cmdp, struct command *cmd_table,
            modif[0] = '\0';
        }
        else if (t == tEXCL) {
-           db_fncall((db_expr_t)0, (boolean_t)0, (db_expr_t)0, (char *)0);
+           db_fncall((db_expr_t)0, (boolean_t)0, (db_expr_t)0, NULL);
            return;
        }
        else if (t != tIDENT) {
@@ -373,7 +373,7 @@ static struct command db_show_all_cmds[] = {
        { "threads",    db_show_all_threads,    0,      0 },
 #endif
        { "procs",      db_ps,                  0,      0 },
-       { (char *)0 }
+       { NULL }
 };
 
 static struct command db_show_cmds[] = {
@@ -386,7 +386,7 @@ static struct command db_show_cmds[] = {
 #if 0
        { "port",       ipc_port_print,         0,      0 },
 #endif
-       { (char *)0, }
+       { NULL, }
 };
 
 static struct command db_command_table[] = {
@@ -419,7 +419,7 @@ static struct command db_command_table[] = {
        { "ps",         db_ps,                  0,      0 },
        { "gdb",        db_gdb,                 0,      0 },
        { "reset",      db_reset,               0,      0 },
-       { (char *)0, }
+       { NULL, }
 };
 
 static struct command  *db_last_command = 0;
index fe48a62..ca27e93 100644 (file)
@@ -343,14 +343,14 @@ db_check_interrupt(void)
                return;
 
            case CTRL('c'):
-               db_error((char *)0);
+               db_error(NULL);
                /*NOTREACHED*/
 
            case CTRL('s'):
                do {
                    c = cnmaygetc();
                    if (c == CTRL('c'))
-                       db_error((char *)0);
+                       db_error(NULL);
                } while (c != CTRL('q'));
                break;
 
index f886901..04c6a88 100644 (file)
@@ -47,10 +47,10 @@ static int  db_set_variable (db_expr_t value);
 #endif
 
 static struct db_variable db_vars[] = {
-       { "radix",      &db_radix, FCN_NULL },
-       { "maxoff",     &db_maxoff, FCN_NULL },
-       { "maxwidth",   &db_max_width, FCN_NULL },
-       { "tabstops",   &db_tab_stop_width, FCN_NULL },
+       { "radix",      &db_radix, NULL },
+       { "maxoff",     &db_maxoff, NULL },
+       { "maxwidth",   &db_max_width, NULL },
+       { "tabstops",   &db_tab_stop_width, NULL },
 };
 static struct db_variable *db_evars = 
                db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
@@ -113,7 +113,7 @@ db_read_variable(struct db_variable *vp, db_expr_t *valuep)
 {
        db_varfcn_t     *func = vp->fcn;
 
-       if (func == FCN_NULL)
+       if (func == NULL)
            *valuep = *(vp->valuep);
        else
            (*func)(vp, valuep, DB_VAR_GET);
@@ -124,7 +124,7 @@ db_write_variable(struct db_variable *vp, db_expr_t *valuep)
 {
        db_varfcn_t     *func = vp->fcn;
 
-       if (func == FCN_NULL)
+       if (func == NULL)
            *(vp->valuep) = *valuep;
        else
            (*func)(vp, valuep, DB_VAR_SET);
index 4af6017..808e7e2 100644 (file)
@@ -56,8 +56,6 @@ struct db_variable {
 #define DB_VAR_GET     0
 #define DB_VAR_SET     1
 
-#define        FCN_NULL        ((db_varfcn_t *)0)
-
 #ifdef _KERNEL
 
 extern struct db_variable      db_regs[];      /* machine registers */
index 36b0f5c..1d50afe 100644 (file)
@@ -261,7 +261,7 @@ ata_raid_flush(struct ar_softc *rdp, struct bio *bp)
     int disk, error;
 
     error = 0;
-    bp->bio_driver_info = (void *)0;
+    bp->bio_driver_info = NULL;
 
     for (disk = 0; disk < rdp->total_disks; disk++) {
        if ((dev = rdp->disks[disk].dev) != NULL)
index 3ac584f..5ad77fb 100644 (file)
@@ -2459,7 +2459,7 @@ sr_modemck(void *arg)
        for (card = 0; card < NSR; card++) {
                hc = &sr_hardc[card];
 
-               if (hc->sc == (void *)0)
+               if (hc->sc == NULL)
                        continue;
 
                Card[cards++] = hc;
index 985f297..cbb00f1 100644 (file)
@@ -1139,7 +1139,7 @@ wlread(struct wl_softc *sc, u_short fd_p)
        if (!(bytes_in_mbuf -= bytes)) {
            MGET(tm->m_next, MB_DONTWAIT, MT_DATA);
            tm = tm->m_next;
-           if (tm == (struct mbuf *)0) {
+           if (tm == NULL) {
                m_freem(m);
                if_printf(ifp, "read(): No mbuf nth\n");
                if (wlhwrst(sc) != TRUE) {
@@ -1843,7 +1843,7 @@ wlxmt(struct wl_softc *sc, struct mbuf *m)
            outw(PIOR0(base), tbd_p);  /* address of act_count */
            outw(PIOP0(base), inw(PIOP0(base)) + count);
            xmtdata_p += len;
-           if ((tm_p = tm_p->m_next) == (struct mbuf *)0)
+           if ((tm_p = tm_p->m_next) == NULL)
                break;
            if (count & 1) {
                /* go to the next descriptor */
@@ -1870,7 +1870,7 @@ wlxmt(struct wl_softc *sc, struct mbuf *m)
                    continue;
                }
            }
-       } else if ((tm_p = tm_p->m_next) == (struct mbuf *)0)
+       } else if ((tm_p = tm_p->m_next) == NULL)
            break;
        count = tm_p->m_len;
        mb_p = mtod(tm_p, u_char *);
@@ -2327,8 +2327,8 @@ wlhdwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp)
        count += tm_p->m_len;
        if (tm_p->m_len & 1)
            break;
-    } while ((tm_p = tm_p->m_next) != (struct mbuf *)0);
-    if ( (tm_p == (struct mbuf *)0) ||
+    } while ((tm_p = tm_p->m_next) != NULL);
+    if ( (tm_p == NULL) ||
         count > HDW_THRESHOLD) {
        *countp = (*tm_pp)->m_len;
        *mb_pp = mtod((*tm_pp), u_char *);
@@ -2346,7 +2346,7 @@ wlhdwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp)
        if (count > HDW_THRESHOLD)
                        break;
        cp += len;
-       if (tm_p->m_next == (struct mbuf *)0)
+       if (tm_p->m_next == NULL)
            break;
        tm_p = tm_p->m_next;
     }
@@ -2368,7 +2368,7 @@ wlsftwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp)
        bcopy(mtod(tm_p, u_char *), cp, len = tm_p->m_len);
        count += len;
        cp += len;
-       if (tm_p->m_next == (struct mbuf *)0)
+       if (tm_p->m_next == NULL)
            break;
        tm_p = tm_p->m_next;
     }
index e3673b5..1c8dc50 100644 (file)
@@ -141,7 +141,6 @@ typedef unsigned int DWordIO_t;
 
 #define NULLDEV -1                 /* identifies non-existant device */
 #define NULLCTL -1                 /* identifies non-existant controller */
-#define NULLCTLPTR (CONTROLLER_T *)0 /* identifies non-existant controller */
 #define NULLAIOP -1                /* identifies non-existant AIOP */
 #define NULLCHAN -1                /* identifies non-existant channel */
 
@@ -786,7 +785,7 @@ Comments: This function must be called once for every channel structure
 */
 #define sInitChanDefaults(ChP) \
 { \
-   (ChP)->CtlP = NULLCTLPTR; \
+   (ChP)->CtlP = NULL; \
    (ChP)->AiopNum = NULLAIOP; \
    (ChP)->ChanID = AIOPID_NULL; \
    (ChP)->ChanNum = NULLCHAN; \
index 71a2da0..06e5111 100644 (file)
@@ -1781,7 +1781,7 @@ void stlintr(void *arg)
 
 static void stlpciintr(void *arg)
 {
-       stlintr((void *)0);
+       stlintr(NULL);
 }
 
 #endif
index 2fb6c5a..a475f13 100644 (file)
@@ -524,7 +524,7 @@ met_probe (pcici_t tag, pcidi_t type)
        case SAA7116_PHILIPS_ID:        /* meteor */
                return("Philips SAA 7116");
        };
-       return ((char *)0);
+       return (NULL);
 }
 
        /* interrupt handling routine 
@@ -1177,7 +1177,7 @@ meteor_open(struct dev_open_args *ap)
        mtr->frames_captured = 0;
        mtr->even_fields_captured = 0;
        mtr->odd_fields_captured = 0;
-       mtr->proc = (struct proc *)0;
+       mtr->proc = NULL;
        set_fps(mtr, 30);
 #ifdef METEOR_TEST_VIDEO
        mtr->video.addr = 0;
@@ -1216,7 +1216,7 @@ meteor_close(struct dev_close_args *ap)
         */
        mtr->base->cap_cntl = 0x8ff0;
        mtr->flags &= ~(METEOR_CAP_MASK|METEOR_WANT_MASK);
-       mtr->proc = (struct proc *)0;
+       mtr->proc = NULL;
 
 #ifdef METEOR_DEALLOC_PAGES
        if (mtr->bigbuf != NULL) {
@@ -1388,7 +1388,7 @@ meteor_ioctl(struct dev_ioctl_args *ap)
                if (mtr->signal) {
                  mtr->proc = curproc;  /* might be NULL */
                } else {
-                 mtr->proc = (struct proc *)0;
+                 mtr->proc = NULL;
                }
                break;
        case METEORGSIGNAL:
index dc3b4f1..14f9d36 100644 (file)
@@ -261,7 +261,7 @@ acct_process(struct proc *p)
         */
        return (vn_rdwr(UIO_WRITE, vp, (caddr_t)&acct, sizeof (acct),
            (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, p->p_ucred,
-           (int *)0));
+           NULL));
 }
 
 /*
index 732659d..3589400 100644 (file)
@@ -1126,7 +1126,7 @@ sys_setlogin(struct setlogin_args *uap)
        if ((error = priv_check_cred(p->p_ucred, PRIV_ROOT, PRISON_ROOT)))
                return (error);
        error = copyinstr((caddr_t) uap->namebuf, (caddr_t) logintmp,
-           sizeof(logintmp), (size_t *)0);
+           sizeof(logintmp), NULL);
        if (error == ENAMETOOLONG)
                error = EINVAL;
        else if (!error)
index 90a9f77..7e5a4e1 100644 (file)
@@ -1369,7 +1369,7 @@ m_adj(struct mbuf *mp, int req_len)
                count = 0;
                for (;;) {
                        count += m->m_len;
-                       if (m->m_next == (struct mbuf *)0)
+                       if (m->m_next == NULL)
                                break;
                        m = m->m_next;
                }
index cd2d27c..76bfdc6 100644 (file)
@@ -613,7 +613,7 @@ restart:
                                   top == NULL ? M_PKTHDR : 0, &mlen);
                        if (top == NULL) {
                                m->m_pkthdr.len = 0;
-                               m->m_pkthdr.rcvif = (struct ifnet *)0;
+                               m->m_pkthdr.rcvif = NULL;
                        }
                        len = min(min(mlen, resid), space);
                        if (resid < MINCLSIZE) {
index adb6390..ac6c1e1 100644 (file)
@@ -233,7 +233,7 @@ sonewconn(struct socket *head, int connstatus)
        struct pru_attach_info ai;
 
        if (head->so_qlen > 3 * head->so_qlimit / 2)
-               return ((struct socket *)0);
+               return (NULL);
        so = soalloc(1);
        if (so == NULL)
                return (NULL);
@@ -254,7 +254,7 @@ sonewconn(struct socket *head, int connstatus)
            /* Directly call function since we're already at protocol level. */
            (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, &ai)) {
                sodealloc(so);
-               return ((struct socket *)0);
+               return (NULL);
        }
 
        if (connstatus) {
index 5c31d01..de1c93a 100644 (file)
@@ -1496,7 +1496,7 @@ db_show_locked_vnodes(struct mount *mp, void *data __unused)
 
        TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) {
                if (vn_islocked(vp))
-                       vprint((char *)0, vp);
+                       vprint(NULL, vp);
        }
        return(0);
 }
@@ -1833,7 +1833,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *nep,
                MALLOC(nfs_pub.np_index, char *, namelen, M_TEMP,
                    M_WAITOK);
                error = copyinstr(argp->ex_indexfile, nfs_pub.np_index,
-                   namelen, (size_t *)0);
+                   namelen, NULL);
                if (!error) {
                        /*
                         * Check for illegal filenames.
index beac90a..e0f434a 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     last edit-date: [Tue Jan  1 10:43:58 2002]
  *
- *---------------------------------------------------------------------------*/ 
+ *---------------------------------------------------------------------------*/
 
 #include "use_i4bing.h"
 
@@ -84,7 +84,7 @@ struct ing_softc {
        struct ifqueue  sc_fastq;       /* interactive traffic          */
        int             sc_dialresp;    /* dialresponse                 */
        int             sc_lastdialresp;/* last dialresponse            */
-       
+
 #if I4BINGACCT
        struct callout  sc_timeout;
        int             sc_iinb;        /* isdn driver # of inbytes     */
@@ -94,18 +94,18 @@ struct ing_softc {
        int             sc_linb;        /* last # of bytes rx'd         */
        int             sc_loutb;       /* last # of bytes tx'd         */
        int             sc_fn;          /* flag, first null acct        */
-#endif 
+#endif
 
        int             sc_inpkt;       /* incoming packets             */
-       int             sc_outpkt;      /* outgoing packets             */      
+       int             sc_outpkt;      /* outgoing packets             */
 
        struct ifqueue  xmitq_hipri;    /* hi-priority transmit queue */
        struct ifqueue  xmitq;    /* transmit queue */
-               
+
        node_p          node;           /* back pointer to node */
        char            nodename[NG_NODESIZ]; /* store our node name */
        hook_p          debughook;
-       hook_p          hook;   
+       hook_p          hook;
 
        u_int           packets_in;     /* packets in from downstream */
        u_int           packets_out;    /* packets out towards downstream */
@@ -237,19 +237,19 @@ i4bingattach(void *dummy)
        int ret;
 
        kprintf("i4bing: %d i4b NetGraph ISDN B-channel device(s) attached\n", NI4BING);
-       
+
        for(i=0; i < NI4BING; sc++, i++)
        {
                sc->sc_unit = i;
-               
+
                ing_init_linktab(i);
 
                NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
 
                sc->sc_state = ST_IDLE;
-               
+
                sc->sc_fastq.ifq_maxlen = I4BINGMAXQLEN;
-               
+
 #if I4BINGACCT
                callout_init(&sc->sc_timeout);
                sc->sc_iinb = 0;
@@ -262,13 +262,13 @@ i4bingattach(void *dummy)
 #endif
 
                sc->sc_inpkt = 0;
-               sc->sc_outpkt = 0;              
+               sc->sc_outpkt = 0;
 
                sc->sc_updown = SOFT_ENA;       /* soft enabled */
 
                sc->sc_dialresp = DSTAT_NONE;   /* no response */
                sc->sc_lastdialresp = DSTAT_NONE;
-               
+
                /* setup a netgraph node */
 
                if ((ret = ng_make_node_common(&typestruct, &sc->node)))
@@ -280,7 +280,7 @@ i4bingattach(void *dummy)
 
                sc->xmitq.ifq_maxlen = IFQ_MAXLEN;
                sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN;
-                               
+
                /* name the netgraph node */
 
                ksprintf(sc->nodename, "%s%d", NG_ING_NODE_TYPE, sc->sc_unit);
@@ -303,15 +303,15 @@ ing_timeout(struct ing_softc *sc)
        bchan_statistics_t bs;
        int unit = sc->sc_unit;
 
-       /* get # of bytes in and out from the HSCX driver */ 
-       
+       /* get # of bytes in and out from the HSCX driver */
+
        (*isdn_linktab[unit]->bch_stat)
                (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
 
        sc->sc_ioutb += bs.outbytes;
        sc->sc_iinb += bs.inbytes;
-       
-       if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn) 
+
+       if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
        {
                int ri = (sc->sc_iinb - sc->sc_linb)/I4BINGACCTINTVL;
                int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BINGACCTINTVL;
@@ -320,7 +320,7 @@ ing_timeout(struct ing_softc *sc)
                        sc->sc_fn = 0;
                else
                        sc->sc_fn = 1;
-                       
+
                sc->sc_linb = sc->sc_iinb;
                sc->sc_loutb = sc->sc_ioutb;
 
@@ -342,7 +342,7 @@ ingclearqueue(struct ifqueue *iq)
 {
        int x;
        struct mbuf *m;
-       
+
        for(;;)
        {
                crit_enter();
@@ -354,7 +354,7 @@ ingclearqueue(struct ifqueue *iq)
                else
                        break;
        }
-}      
+}
 #endif
 
 /*===========================================================================*
@@ -376,8 +376,8 @@ ing_connect(int unit, void *cdp)
        NDBGL4(L4_DIALST, "ing%d: setting dial state to ST_CONNECTED", unit);
 
        sc->sc_dialresp = DSTAT_NONE;
-       sc->sc_lastdialresp = DSTAT_NONE;       
-       
+       sc->sc_lastdialresp = DSTAT_NONE;
+
 #if I4BINGACCT
        sc->sc_iinb = 0;
        sc->sc_ioutb = 0;
@@ -390,10 +390,10 @@ ing_connect(int unit, void *cdp)
 #endif
 
        sc->sc_state = ST_CONNECTED;
-       
+
        crit_exit();
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from L4 handler at disconnect time
  *---------------------------------------------------------------------------*/
@@ -418,13 +418,13 @@ ing_disconnect(int unit, void *cdp)
 
        i4b_l4_accounting(BDRV_ING, cd->driver_unit, ACCT_FINAL,
                 sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-       
-       sc->sc_cdp = (call_desc_t *)0;  
+
+       sc->sc_cdp = NULL;
 
        NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
 
        sc->sc_dialresp = DSTAT_NONE;
-       sc->sc_lastdialresp = DSTAT_NONE;       
+       sc->sc_lastdialresp = DSTAT_NONE;
 
        sc->sc_state = ST_IDLE;
 }
@@ -448,7 +448,7 @@ ing_dialresponse(int unit, int status, cause_t cause)
 /*             ingclearqueues(sc); */
        }
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     interface soft up/down
  *---------------------------------------------------------------------------*/
@@ -458,7 +458,7 @@ ing_updown(int unit, int updown)
        struct ing_softc *sc = &ing_softc[unit];
        sc->sc_updown = updown;
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from the HSCX interrupt handler
  *     when a new frame (mbuf) has been received and was put on
@@ -470,7 +470,7 @@ ing_rx_data_rdy(int unit)
 {
        struct ing_softc *sc = &ing_softc[unit];
        struct mbuf *m;
-       
+
        if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
                return;
 
@@ -481,7 +481,7 @@ ing_rx_data_rdy(int unit)
        m->m_pkthdr.rcvif = NULL;
 
        sc->sc_inpkt++;
-       
+
        ng_queue_data(sc->hook, m, NULL);
 }
 
@@ -499,7 +499,7 @@ ing_tx_queue_empty(int unit)
 
        if(sc->sc_state != ST_CONNECTED)
                return;
-               
+
        for(;;)
        {
                IF_DEQUEUE(&sc->xmitq_hipri, m);
@@ -510,7 +510,7 @@ ing_tx_queue_empty(int unit)
                        if(m == NULL)
                                break;
                }
-       
+
 #if I4BINGACCT
                sc->sc_outb += m->m_pkthdr.len;
 #endif
@@ -574,7 +574,7 @@ ing_init_linktab(int unit)
        ing_drvr_linktab[unit].line_connected = ing_connect;
        ing_drvr_linktab[unit].line_disconnected = ing_disconnect;
        ing_drvr_linktab[unit].dial_response = ing_dialresponse;
-       ing_drvr_linktab[unit].updown_ind = ing_updown; 
+       ing_drvr_linktab[unit].updown_ind = ing_updown;
 }
 
 /*===========================================================================*
@@ -649,7 +649,7 @@ ng_ing_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr,
                                char *p;
                                int pos = 0;
 
-                               NG_MKRESPONSE(resp, msg, 
+                               NG_MKRESPONSE(resp, msg,
                                    sizeof(struct ng_mesg) + NG_TEXTRESPONSE,
                                    M_INTWAIT | M_NULLOK);
 
@@ -679,7 +679,7 @@ ng_ing_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr,
                                pos = ksprintf(arg, "state = %s (%d)\n", p, sc->sc_state);
 #if I4BINGACCT
                                pos += ksprintf(arg + pos, "%d bytes in, %d bytes out\n", sc->sc_inb, sc->sc_outb);
-#endif                     
+#endif
                                pos += ksprintf(arg + pos, "%d pkts in, %d pkts out\n", sc->sc_inpkt, sc->sc_outpkt);
 
                                resp->header.arglen = pos + 1;
@@ -699,7 +699,7 @@ ng_ing_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr,
                        {
                                struct ngingstat *stats;
 
-                               NG_MKRESPONSE(resp, msg, sizeof(*stats), 
+                               NG_MKRESPONSE(resp, msg, sizeof(*stats),
                                    M_INTWAIT | M_NULLOK);
 
                                if (!resp)
@@ -754,13 +754,13 @@ ng_ing_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
 {
        struct ing_softc *sc = hook->node->private;
        struct ifqueue  *xmitq_p;
-       
+
        if(hook->private == NULL)
        {
                NG_FREE_DATA(m, meta);
                return(ENETDOWN);
        }
-       
+
        if(sc->sc_state == ST_IDLE || sc->sc_state == ST_DIALING)
        {
                i4b_l4_dialout(BDRV_ING, sc->sc_unit);
@@ -768,7 +768,7 @@ ng_ing_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
        }
 
        sc->sc_outpkt++;
-       
+
        /*
        * Now queue the data for when it can be sent
        */
@@ -839,7 +839,7 @@ static int
 ng_ing_disconnect(hook_p hook)
 {
        struct ing_softc *sc = hook->node->private;
-       
+
        if(hook->private == NULL) {
                sc->debughook = NULL;
        }
index 2333f6f..a307c2f 100644 (file)
@@ -55,7 +55,7 @@
  *     sc->sc_inb              # of incoming bytes after decompression
  *     sc->sc_outb             # of outgoing bytes before compression
  *
- *---------------------------------------------------------------------------*/ 
+ *---------------------------------------------------------------------------*/
 
 #include "use_i4bipr.h"
 
@@ -88,7 +88,7 @@
 #include <netinet/ip.h>
 
 #ifdef IPR_VJ
-#include <net/slcompress.h>       
+#include <net/slcompress.h>
 #define IPR_COMPRESS IFF_LINK0  /* compress TCP traffic */
 #define IPR_AUTOCOMP IFF_LINK1  /* auto-enable TCP compression */
 
  * CAUTION: i have re-defined IPR_VJ_USEBUFFER because it makes problems
  *          with 2 i4b's back to back running cvs over ssh, cvs simply
  *          aborts because it gets bad data. Everything else (telnet/ftp?etc)
- *          functions fine. 
+ *          functions fine.
  *---------------------------------------------------------------------------*/
 #define IPR_VJ_USEBUFFER       /* define to use an allocated separate buffer*/
                                /* undef to uncompress in the mbuf itself    */
@@ -149,7 +149,7 @@ struct ipr_softc {
        struct ifqueue  sc_fastq;       /* interactive traffic          */
        int             sc_dialresp;    /* dialresponse                 */
        int             sc_lastdialresp;/* last dialresponse            */
-       
+
 #if I4BIPRACCT
        int             sc_iinb;        /* isdn driver # of inbytes     */
        int             sc_ioutb;       /* isdn driver # of outbytes    */
@@ -158,7 +158,7 @@ struct ipr_softc {
        int             sc_linb;        /* last # of bytes rx'd         */
        int             sc_loutb;       /* last # of bytes tx'd         */
        int             sc_fn;          /* flag, first null acct        */
-#endif 
+#endif
 
        struct callout  sc_timeout;
 
@@ -217,7 +217,7 @@ i4biprattach(void *dummy)
 #else
        kprintf("i4bipr: %d IP over raw HDLC ISDN device(s) attached\n", NI4BIPR);
 #endif
-       
+
        for(i=0; i < NI4BIPR; sc++, i++)
        {
                ipr_init_linktab(i);
@@ -225,7 +225,7 @@ i4biprattach(void *dummy)
                NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
 
                sc->sc_state = ST_IDLE;
-               
+
                if_initname(&(sc->sc_if), "ipr", i);
 
 #ifdef IPR_VJ
@@ -257,8 +257,8 @@ i4biprattach(void *dummy)
                sc->sc_if.if_noproto = 0;
 
 #if I4BIPRACCT
-               sc->sc_if.if_timer = 0; 
-               sc->sc_if.if_watchdog = iprwatchdog;    
+               sc->sc_if.if_timer = 0;
+               sc->sc_if.if_watchdog = iprwatchdog;
                sc->sc_iinb = 0;
                sc->sc_ioutb = 0;
                sc->sc_inb = 0;
@@ -282,7 +282,7 @@ i4biprattach(void *dummy)
                sc->sc_updown = SOFT_ENA;       /* soft enabled */
                sc->sc_dialresp = DSTAT_NONE;   /* no response */
                sc->sc_lastdialresp = DSTAT_NONE;
-               
+
                if_attach(&sc->sc_if, NULL);
                bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int));
        }
@@ -298,14 +298,14 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
        struct ipr_softc *sc;
        int unit;
        struct ip *ip;
-       
+
        crit_enter();
 
        sc = ifp->if_softc;
        unit = sc->sc_unit;
 
        /* check for IP */
-       
+
        if(dst->sa_family != AF_INET)
        {
                kprintf(IPR_FMT "af%d not supported\n", IPR_ARG(sc), dst->sa_family);
@@ -317,7 +317,7 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
        }
 
        /* check interface state = UP */
-       
+
        if(!(ifp->if_flags & IFF_UP))
        {
                NDBGL4(L4_IPRDBG, "ipr%d: interface is DOWN!", unit);
@@ -328,7 +328,7 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
        }
 
        /* dial if necessary */
-       
+
        if(sc->sc_state == ST_IDLE || sc->sc_state == ST_DIALING)
        {
 
@@ -352,7 +352,7 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
                                sc->sc_dialresp = DSTAT_NONE;
                                crit_exit();
                                sc->sc_if.if_oerrors++;
-                               return(EHOSTUNREACH);                           
+                               return(EHOSTUNREACH);
                                break;
 
                        case DSTAT_INONLY:      /* no dialout allowed*/
@@ -362,7 +362,7 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
                                sc->sc_dialresp = DSTAT_NONE;
                                crit_exit();
                                sc->sc_if.if_oerrors++;
-                               return(EHOSTUNREACH);                           
+                               return(EHOSTUNREACH);
                                break;
                }
 #endif
@@ -382,7 +382,7 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
 #endif
 
        /* update access time */
-       
+
        microtime(&sc->sc_if.if_lastchange);
 
        /*
@@ -392,9 +392,9 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
         */
 
        ip = mtod(m, struct ip *);              /* get ptr to ip header */
-        
+
        /* check for space in choosen send queue */
-       
+
        if (netisr_queue(NETISR_IP, m))
        {
                NDBGL4(L4_IPRDBG, "ipr%d: send queue full!", unit);
@@ -402,9 +402,9 @@ i4biproutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
                sc->sc_if.if_oerrors++;
                return(ENOBUFS);
        }
-       
+
        NDBGL4(L4_IPRDBG, "ipr%d: add packet to send queue!", unit);
-       
+
        ipr_tx_queue_empty(unit);
 
        crit_exit();
@@ -438,7 +438,7 @@ i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data, struct ucred *cr)
        int error = 0;
 
        crit_enter();
-       
+
        switch (cmd)
        {
                case SIOCAIFADDR:       /* add interface address */
@@ -472,7 +472,7 @@ i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data, struct ucred *cr)
                        {
                                /* enable debug messages */
                        }
-                       
+
                        microtime(&sc->sc_if.if_lastchange);
                        break;
 
@@ -490,7 +490,7 @@ i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data, struct ucred *cr)
 
 #if 0
        /* not needed for FreeBSD, done in sl_compress_init() (-hm) */
-       
+
                        /* need to add an ioctl:        set VJ max slot ID
                         * #define IPRIOCSMAXCID        _IOW('I', XXX, int)
                         */
@@ -546,7 +546,7 @@ iprclearqueues(struct ipr_softc *sc)
                        break;
        }
 }
-        
+
 #if I4BIPRACCT
 /*---------------------------------------------------------------------------*
  *     watchdog routine
@@ -557,16 +557,16 @@ iprwatchdog(struct ifnet *ifp)
        struct ipr_softc *sc = ifp->if_softc;
        int unit = sc->sc_unit;
        bchan_statistics_t bs;
-       
-       /* get # of bytes in and out from the HSCX driver */ 
-       
+
+       /* get # of bytes in and out from the HSCX driver */
+
        (*isdn_linktab[unit]->bch_stat)
                (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
 
        sc->sc_ioutb += bs.outbytes;
        sc->sc_iinb += bs.inbytes;
-       
-       if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn) 
+
+       if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
        {
                int ri = (sc->sc_iinb - sc->sc_linb)/I4BIPRACCTINTVL;
                int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BIPRACCTINTVL;
@@ -575,14 +575,14 @@ iprwatchdog(struct ifnet *ifp)
                        sc->sc_fn = 0;
                else
                        sc->sc_fn = 1;
-                       
+
                sc->sc_linb = sc->sc_iinb;
                sc->sc_loutb = sc->sc_ioutb;
 
                i4b_l4_accounting(BDRV_IPR, unit, ACCT_DURING,
                         sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
        }
-       sc->sc_if.if_timer = I4BIPRACCTINTVL;   
+       sc->sc_if.if_timer = I4BIPRACCTINTVL;
 }
 #endif /* I4BIPRACCT */
 
@@ -597,7 +597,7 @@ static void
 i4bipr_connect_startio(struct ipr_softc *sc)
 {
        crit_enter();
-       
+
        if(sc->sc_state == ST_CONNECTED_W)
        {
                sc->sc_state = ST_CONNECTED_A;
@@ -606,7 +606,7 @@ i4bipr_connect_startio(struct ipr_softc *sc)
 
        crit_exit();
 }
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from L4 handler at connect time
  *---------------------------------------------------------------------------*/
@@ -625,8 +625,8 @@ ipr_connect(int unit, void *cdp)
        sc->sc_state = ST_CONNECTED_W;
 
        sc->sc_dialresp = DSTAT_NONE;
-       sc->sc_lastdialresp = DSTAT_NONE;       
-       
+       sc->sc_lastdialresp = DSTAT_NONE;
+
 #if I4BIPRACCT
        sc->sc_iinb = 0;
        sc->sc_ioutb = 0;
@@ -677,7 +677,7 @@ ipr_connect(int unit, void *cdp)
        /* we don't need any negotiation - pass event back right now */
        i4b_l4_negcomplete(sc->sc_cdp);
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from L4 handler at disconnect time
  *---------------------------------------------------------------------------*/
@@ -706,13 +706,13 @@ ipr_disconnect(int unit, void *cdp)
 
        i4b_l4_accounting(BDRV_IPR, cd->driver_unit, ACCT_FINAL,
                 sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-       
-       sc->sc_cdp = (call_desc_t *)0;  
+
+       sc->sc_cdp = NULL;
 
        NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
 
        sc->sc_dialresp = DSTAT_NONE;
-       sc->sc_lastdialresp = DSTAT_NONE;       
+       sc->sc_lastdialresp = DSTAT_NONE;
 
        sc->sc_if.if_flags &= ~IFF_RUNNING;
        sc->sc_state = ST_IDLE;
@@ -737,7 +737,7 @@ ipr_dialresponse(int unit, int status, cause_t cause)
                iprclearqueues(sc);
        }
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     interface soft up/down
  *---------------------------------------------------------------------------*/
@@ -747,7 +747,7 @@ ipr_updown(int unit, int updown)
        struct ipr_softc *sc = &ipr_softc[unit];
        sc->sc_updown = updown;
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from the HSCX interrupt handler
  *     when a new frame (mbuf) has been received and was put on
@@ -762,11 +762,11 @@ ipr_rx_data_rdy(int unit)
 #ifdef IPR_VJ
 #ifdef IPR_VJ_USEBUFFER
        u_char *cp = sc->sc_cbuf;
-#endif 
+#endif
        int len, c;
 #endif
        static const uint32_t af = AF_INET;
-       
+
        if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
                return;
 
@@ -789,7 +789,7 @@ ipr_rx_data_rdy(int unit)
        {
                unsigned char *mp = m->m_data;
                int i;
-               
+
                sc->sc_first_pkt = 0;
 
                for(i = 0; i < m->m_len; i++, mp++)
@@ -798,13 +798,13 @@ ipr_rx_data_rdy(int unit)
                            ((*mp & 0x0f) >= 0x05) )
                        {
                                m->m_data = mp;
-                               m->m_pkthdr.len -= i;                           
+                               m->m_pkthdr.len -= i;
                                break;
                        }
                }
        }
 #endif
-               
+
        sc->sc_if.if_ipackets++;
        sc->sc_if.if_ibytes += m->m_pkthdr.len;
 
@@ -818,7 +818,7 @@ ipr_rx_data_rdy(int unit)
 #ifdef IPR_VJ_USEBUFFER
 /* XXX */      m_copydata(m, 0, len, cp);
 #endif
-               
+
                if(c & 0x80)
                {
                        c = TYPE_COMPRESSED_TCP;
@@ -828,8 +828,8 @@ ipr_rx_data_rdy(int unit)
 #ifdef IPR_VJ_USEBUFFER
                        *cp &= 0x4f;            /* XXX */
 #else
-                       *(mtod(m, u_char *)) &= 0x4f;                   
-#endif                 
+                       *(mtod(m, u_char *)) &= 0x4f;
+#endif
                }
 
                /*
@@ -846,7 +846,7 @@ ipr_rx_data_rdy(int unit)
 #else
                        len = sl_uncompress_tcp((u_char **)&m->m_data, len,
                                        (u_int)c, &sc->sc_compr);
-#endif                 
+#endif
 
                        if(len <= 0)
                        {
@@ -914,7 +914,7 @@ error:
        if (netisr_queue(NETISR_IP, m)) {
                NDBGL4(L4_IPRDBG, "ipr%d: ipintrq full!", unit);
                sc->sc_if.if_ierrors++;
-               sc->sc_if.if_iqdrops++;         
+               sc->sc_if.if_iqdrops++;
        }
 }
 
@@ -929,14 +929,14 @@ ipr_tx_queue_empty(int unit)
        static const uint32_t af = AF_INET;
        struct ipr_softc *sc = &ipr_softc[unit];
        struct mbuf *m;
-#ifdef IPR_VJ  
-       struct ip *ip;  
+#ifdef IPR_VJ
+       struct ip *ip;
 #endif
        int x = 0;
 
        if(sc->sc_state != ST_CONNECTED_A)
                return;
-               
+
        for(;;)
        {
                 IF_DEQUEUE(&sc->sc_fastq, m);
@@ -955,12 +955,12 @@ ipr_tx_queue_empty(int unit)
 
                if (sc->sc_if.if_bpf)
                        bpf_ptap(sc->sc_if.if_bpf, m, &af, sizeof(af));
-       
+
 #if I4BIPRACCT
                sc->sc_outb += m->m_pkthdr.len; /* size before compression */
 #endif
 
-#ifdef IPR_VJ  
+#ifdef IPR_VJ
                if((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP)
                {
                        if(sc->sc_if.if_flags & IPR_COMPRESS)
@@ -1034,7 +1034,7 @@ ipr_init_linktab(int unit)
        ipr_drvr_linktab[unit].line_connected = ipr_connect;
        ipr_drvr_linktab[unit].line_disconnected = ipr_disconnect;
        ipr_drvr_linktab[unit].dial_response = ipr_dialresponse;
-       ipr_drvr_linktab[unit].updown_ind = ipr_updown; 
+       ipr_drvr_linktab[unit].updown_ind = ipr_updown;
 }
 
 /*===========================================================================*/
index a1a044b..43a3af4 100644 (file)
@@ -12,7 +12,7 @@
  *   2. 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.
- *   
+ *
  *   THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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
@@ -66,7 +66,7 @@
 #include <net/sppp/if_sppp.h>
 
 
-#include "use_bpf.h"     
+#include "use_bpf.h"
 #include <sys/time.h>
 #include <net/bpf.h>
 
@@ -82,7 +82,7 @@
 #define        ISPPP_FMT       "%s: "
 #define        ISPPP_ARG(sc)   ((sc)->sc_if.if_xname)
 #define IFP2UNIT(ifp)  ((struct i4bisppp_softc *)ifp->if_softc)->sc_unit
-               
+
 #  define IOCTL_CMD_T u_long
 
 PDEVSTATIC void i4bispppattach(void *);
@@ -90,7 +90,7 @@ PSEUDO_SET(i4bispppattach, i4b_isppp);
 
 #define I4BISPPPACCT           1       /* enable accounting messages */
 #define        I4BISPPPACCTINTVL       2       /* accounting msg interval in secs */
-#define I4BISPPPDISCDEBUG      1       
+#define I4BISPPPDISCDEBUG      1
 
 #define PPP_HDRLEN             4       /* 4 octetts PPP header length  */
 
@@ -181,7 +181,7 @@ i4bispppattach(void *dummy)
 
        for(i = 0; i < NI4BISPPP; sc++, i++) {
                i4bisppp_init_linktab(i);
-               
+
                sc->sc_if.if_softc = sc;
 
                if_initname(&(sc->sc_if), "isp", i);
@@ -216,8 +216,8 @@ i4bispppattach(void *dummy)
                sc->sc_if.if_noproto = 0;
 
 #if I4BISPPPACCT
-               sc->sc_if.if_timer = 0; 
-               sc->sc_if.if_watchdog = i4bisppp_watchdog;      
+               sc->sc_if.if_timer = 0;
+               sc->sc_if.if_watchdog = i4bisppp_watchdog;
                sc->sc_iinb = 0;
                sc->sc_ioutb = 0;
                sc->sc_inb = 0;
@@ -333,13 +333,13 @@ i4bisppp_watchdog(struct ifnet *ifp)
        struct i4bisppp_softc *sc = ifp->if_softc;
        int unit = IFP2UNIT(ifp);
        bchan_statistics_t bs;
-       
+
        (*isdn_linktab[unit]->bch_stat)
                (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
 
        sc->sc_ioutb += bs.outbytes;
        sc->sc_iinb += bs.inbytes;
-       
+
        if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
        {
                int ri = (sc->sc_iinb - sc->sc_linb)/I4BISPPPACCTINTVL;
@@ -349,14 +349,14 @@ i4bisppp_watchdog(struct ifnet *ifp)
                        sc->sc_fn = 0;
                else
                        sc->sc_fn = 1;
-                       
+
                sc->sc_linb = sc->sc_iinb;
                sc->sc_loutb = sc->sc_ioutb;
 
                i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_DURING,
                         sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
        }
-       sc->sc_if.if_timer = I4BISPPPACCTINTVL;         
+       sc->sc_if.if_timer = I4BISPPPACCTINTVL;
 
 #if 0 /* old stuff, keep it around */
        kprintf(ISPPP_FMT "transmit timeout\n", ISPPP_ARG(sc));
@@ -407,8 +407,8 @@ i4bisppp_tlf(struct sppp *sp)
 {
        struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
 /*     call_desc_t *cd = sc->sc_cdp;   */
-        struct ifnet *ifp = (struct ifnet *)sp;        
-       
+        struct ifnet *ifp = (struct ifnet *)sp;
+
        if(sc->sc_state != ST_CONNECTED)
                return;
 
@@ -426,7 +426,7 @@ static void
 i4bisppp_state_changed(struct sppp *sp, int new_state)
 {
        struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-       
+
        i4b_l4_ifstate_changed(sc->sc_cdp, new_state);
 }
 
@@ -438,7 +438,7 @@ static void
 i4bisppp_negotiation_complete(struct sppp *sp)
 {
        struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-       
+
        i4b_l4_negcomplete(sc->sc_cdp);
 }
 
@@ -469,7 +469,7 @@ i4bisppp_connect(int unit, void *cdp)
        sc->sc_loutb = 0;
        sc->sc_if.if_timer = I4BISPPPACCTINTVL;
 #endif
-       
+
 #if 0 /* never used ??? */
        callout_stop(&sc->sc_timeout);
 #endif
@@ -506,13 +506,13 @@ i4bisppp_disconnect(int unit, void *cdp)
 
        i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_FINAL,
                 sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-       
+
        if (sc->sc_state == ST_CONNECTED)
        {
 #if 0 /* never used ??? */
                callout_stop(&sc->sc_timeout);
 #endif
-               sc->sc_cdp = (call_desc_t *)0;  
+               sc->sc_cdp = NULL;
                /* do this here because pp_down calls i4bisppp_tlf */
                sc->sc_state = ST_IDLE;
                sp->pp_down(sp);        /* tell PPP we have hung up */
@@ -536,7 +536,7 @@ i4bisppp_dialresponse(int unit, int status, cause_t cause)
        if(status != DSTAT_NONE)
        {
                struct mbuf *m;
-               
+
                NDBGL4(L4_ISPDBG, "isp%d: clearing queues", unit);
 
                if(!(sppp_isempty(&sc->sc_if)))
@@ -545,7 +545,7 @@ i4bisppp_dialresponse(int unit, int status, cause_t cause)
                                m_freem(m);
                }
 
-               sc->sc_cdp = (call_desc_t *)0;
+               sc->sc_cdp = NULL;
                /* do this here because pp_down calls i4bisppp_tlf */
                sc->sc_state = ST_IDLE;
                 /*
@@ -558,7 +558,7 @@ i4bisppp_dialresponse(int unit, int status, cause_t cause)
                sp->pp_down(sp);
        }
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     interface up/down
  *---------------------------------------------------------------------------*/
@@ -567,7 +567,7 @@ i4bisppp_updown(int unit, int updown)
 {
        /* could probably do something useful here */
 }
-       
+
 /*---------------------------------------------------------------------------*
  *     this routine is called from the HSCX interrupt handler
  *     when a new frame (mbuf) has been received and was put on
@@ -578,7 +578,7 @@ i4bisppp_rx_data_rdy(int unit)
 {
        struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
        struct mbuf *m;
-       
+
        if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
                return;
 
@@ -595,7 +595,7 @@ i4bisppp_rx_data_rdy(int unit)
 #if I4BISPPPACCT
        sc->sc_inb += m->m_pkthdr.len;
 #endif
-       
+
 #ifdef I4BISPPPDEBUG
        kprintf("i4bisppp_rx_data_ready: received packet!\n");
 #endif
@@ -615,7 +615,7 @@ i4bisppp_rx_data_rdy(int unit)
 static void
 i4bisppp_tx_queue_empty(int unit)
 {
-       i4bisppp_start(&i4bisppp_softc[unit].sc_if);    
+       i4bisppp_start(&i4bisppp_softc[unit].sc_if);
 }
 
 /*---------------------------------------------------------------------------*
@@ -677,8 +677,8 @@ i4bisppp_init_linktab(int unit)
        i4bisppp_drvr_linktab[unit].bch_activity = i4bisppp_activity;
        i4bisppp_drvr_linktab[unit].line_connected = i4bisppp_connect;
        i4bisppp_drvr_linktab[unit].line_disconnected = i4bisppp_disconnect;
-       i4bisppp_drvr_linktab[unit].dial_response = i4bisppp_dialresponse;      
-       i4bisppp_drvr_linktab[unit].updown_ind = i4bisppp_updown;       
+       i4bisppp_drvr_linktab[unit].dial_response = i4bisppp_dialresponse;
+       i4bisppp_drvr_linktab[unit].updown_ind = i4bisppp_updown;
 }
 
 /*===========================================================================*/
index 6b27b34..be53bae 100644 (file)
@@ -295,7 +295,7 @@ i4b_l1_mph_status_ind(int drv_unit, int status, int parm, struct i4b_l1mux_func
 
        if(status == STI_ATTACH)
        {
-               if (l1mux_func_p == (struct i4b_l1mux_func *)0)
+               if (l1mux_func_p == NULL)
                        panic("i4b_l1_mph_status_ind: i4b_l1mux_func pointer is NULL\n");
 
                if(numl1units < MAXL1UNITS)
index 9c0d933..9eb7d54 100644 (file)
@@ -262,7 +262,7 @@ typedef void if_init_f_t (void *);
 #define        if_lastchange   if_data.ifi_lastchange
 #define if_recvquota   if_data.ifi_recvquota
 #define        if_xmitquota    if_data.ifi_xmitquota
-#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
+#define if_rawoutput(if, m, sa) if_output(if, m, sa, NULL)
 
 /* for compatibility with other BSDs */
 #define        if_list         if_link
index 59688a7..b03b982 100644 (file)
@@ -412,7 +412,7 @@ pppwrite(struct tty *tp, struct uio *uio, int flag)
     m0->m_len -= PPP_HDRLEN;
 
     /* call the upper layer to "transmit" it... */
-    error = pppoutput(&sc->sc_if, m0, &dst, (struct rtentry *)0);
+    error = pppoutput(&sc->sc_if, m0, &dst, NULL);
     crit_exit();
     return (error);
 }
index 3e98646..dc05009 100644 (file)
@@ -103,7 +103,7 @@ raw_input(struct mbuf *m0, const struct sockproto *proto,
                        n = m_copypacket(m, MB_DONTWAIT);
                        if (n != NULL) {
                                if (ssb_appendaddr(&last->so_rcv, src, n,
-                                                (struct mbuf *)0) == 0) {
+                                                NULL) == 0) {
                                        /* should notify about lost packet */
                                        m_freem(n);
                                } else {
@@ -114,7 +114,7 @@ raw_input(struct mbuf *m0, const struct sockproto *proto,
                last = rp->rcb_socket;
        }
        if (last) {
-               if (ssb_appendaddr(&last->so_rcv, src, m, (struct mbuf *)0) == 0)
+               if (ssb_appendaddr(&last->so_rcv, src, m, NULL) == 0)
                        m_freem(m);
                else
                        sorwakeup(last);
index d7bade3..bb6bb15 100644 (file)
@@ -1074,7 +1074,7 @@ deflate(z_streamp strm, int flush)
                   but not a zero length. */
                _tr_stored_type_only(s);
             } else { /* FULL_FLUSH or SYNC_FLUSH */
-                _tr_stored_block(s, (char*)0, 0L, 0);
+                _tr_stored_block(s, NULL, 0L, 0);
                 /* For a full flush, this empty block will be recognized
                  * as a special marker by inflate_sync().
                  */
@@ -1950,7 +1950,7 @@ local static_tree_desc  static_d_desc =
 {static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
 
 local static_tree_desc  static_bl_desc =
-{(ct_data *)0, extra_blbits, 0,      BL_CODES, MAX_BL_BITS};
+{NULL, extra_blbits, 0,      BL_CODES, MAX_BL_BITS};
 
 /* ===========================================================================
  * Local (static) routines in this file.
@@ -2737,7 +2737,7 @@ _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int eof)
        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
 
     } else {
-        Assert(buf != (char*)0, "lost buf");
+        Assert(buf != NULL, "lost buf");
        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
     }
 
@@ -2752,7 +2752,7 @@ _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int eof)
     if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {
 #  endif
         /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
-        if (buf == (charf*)0) error ("block vanished");
+        if (buf == NULL) error ("block vanished");
 
         copy_block(s, buf, (unsigned)stored_len, 0); /* without header */
         s->compressed_len = stored_len << 3;
@@ -2761,9 +2761,9 @@ _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int eof)
 #endif /* STORED_FILE_OK */
 
 #ifdef FORCE_STORED
-    if (buf != (char*)0) { /* force stored block */
+    if (buf != NULL) { /* force stored block */
 #else
-    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+    if (stored_len+4 <= opt_lenb && buf != NULL) {
                        /* 4: two words for the lengths */
 #endif
         /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
index 3ad98aa..8680bbe 100644 (file)
@@ -1100,7 +1100,7 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2)
 
                /* Try to get next packet from socket */
                if ((error = soreceive(so, (so->so_state & SS_ISCONNECTED) ?
-                   NULL : &sa, &auio, &m, (struct mbuf **)0, &flags)) != 0)
+                   NULL : &sa, &auio, &m, NULL, &flags)) != 0)
                        break;
 
                /* See if we got anything */
index 808c826..c571c74 100644 (file)
@@ -573,7 +573,7 @@ reflect:
                icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
                rtredirect((struct sockaddr *)&icmpsrc,
                  (struct sockaddr *)&icmpdst,
-                 (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST,
+                 NULL, RTF_GATEWAY | RTF_HOST,
                  (struct sockaddr *)&icmpgw);
                kpfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
 #ifdef IPSEC
@@ -772,7 +772,7 @@ icmp_send(struct mbuf *m, struct mbuf *opts, struct route *rt)
        icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
        m->m_data -= hlen;
        m->m_len += hlen;
-       m->m_pkthdr.rcvif = (struct ifnet *)0;
+       m->m_pkthdr.rcvif = NULL;
 #ifdef ICMPPRINTFS
        if (icmpprintfs) {
                char buf[sizeof "aaa.bbb.ccc.ddd"];
index 115b086..d60f90e 100644 (file)
@@ -731,7 +731,7 @@ send:
                        m->m_data += max_linkhdr;
                m->m_len = hdrlen;
        }
-       m->m_pkthdr.rcvif = (struct ifnet *)0;
+       m->m_pkthdr.rcvif = NULL;
        if (isipv6) {
                ip6 = mtod(m, struct ip6_hdr *);
                th = (struct tcphdr *)(ip6 + 1);
index 92e6376..9f555b8 100644 (file)
@@ -407,7 +407,7 @@ tcp6_usr_listen(struct socket *so, struct thread *td)
                        inp->inp_vflag |= INP_IPV4;
                else
                        inp->inp_vflag &= ~INP_IPV4;
-               error = in6_pcbbind(inp, (struct sockaddr *)0, td);
+               error = in6_pcbbind(inp, NULL, td);
        }
        if (error == 0)
                tp->t_state = TCPS_LISTEN;
@@ -1084,7 +1084,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
        int error;
 
        if (inp->inp_lport == 0) {
-               error = in6_pcbbind(inp, (struct sockaddr *)0, td);
+               error = in6_pcbbind(inp, NULL, td);
                if (error)
                        return error;
        }
index 57565df..b9759cd 100644 (file)
@@ -816,7 +816,7 @@ in6_ifdetach(struct ifnet *ifp)
                                (struct sockaddr *)&ia->ia_addr,
                                (struct sockaddr *)&ia->ia_addr,
                                (struct sockaddr *)&ia->ia_prefixmask,
-                               rtflags, (struct rtentry **)0);
+                               rtflags, NULL);
                }
 
                /* remove from the linked list */
index 01dd609..b93711d 100644 (file)
@@ -384,7 +384,7 @@ in6_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct thread *td)
        }
        if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) {
                if (inp->inp_lport == 0) {
-                       error = in6_pcbbind(inp, (struct sockaddr *)0, td);
+                       error = in6_pcbbind(inp, NULL, td);
                        if (error)
                                return (error);
                }
index 4a748c6..825697f 100644 (file)
@@ -863,7 +863,7 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src)
        if (s) {
                if (ssb_appendaddr(&s->so_rcv,
                                 (struct sockaddr *)src,
-                                mm, (struct mbuf *)0) != 0) {
+                                mm, NULL) != 0) {
                        sorwakeup(s);
                        return 0;
                }
index ae788df..e919315 100644 (file)
@@ -1067,7 +1067,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct route_in6 *ro,
                        }
                        m_cat(m, m_frgpart);
                        m->m_pkthdr.len = len + hlen + sizeof(*ip6f);
-                       m->m_pkthdr.rcvif = (struct ifnet *)0;
+                       m->m_pkthdr.rcvif = NULL;
                        ip6f->ip6f_reserved = 0;
                        ip6f->ip6f_ident = id;
                        ip6f->ip6f_nxt = nextproto;
index c38caf9..6c95e9c 100644 (file)
@@ -996,8 +996,7 @@ nd6_free(struct rtentry *rt)
         * caches, and disable the route entry not to be used in already
         * cached routes.
         */
-       rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0,
-                 rt_mask(rt), 0, (struct rtentry **)0);
+       rtrequest(RTM_DELETE, rt_key(rt), NULL, rt_mask(rt), 0, NULL);
 
        return (next);
 }
index 40757cd..926cb9d 100644 (file)
@@ -279,7 +279,7 @@ ddp_input(struct mbuf *m, struct ifnet *ifp, struct elaphdr *elh, int phase)
        && ( satosat(&forwro.ro_dst)->sat_addr.s_net != to.sat_addr.s_net
          || satosat(&forwro.ro_dst)->sat_addr.s_node != to.sat_addr.s_node )) {
            RTFREE( forwro.ro_rt );
-           forwro.ro_rt = (struct rtentry *)0;
+           forwro.ro_rt = NULL;
        }
 
        /*
@@ -287,8 +287,8 @@ ddp_input(struct mbuf *m, struct ifnet *ifp, struct elaphdr *elh, int phase)
         * Then get a new route.
         * XXX this could cause a 'route leak'. check this!
         */
-       if ( forwro.ro_rt == (struct rtentry *)0
-       || forwro.ro_rt->rt_ifp == (struct ifnet *)0 ) {
+       if ( forwro.ro_rt == NULL
+       || forwro.ro_rt->rt_ifp == NULL ) {
            forwro.ro_dst.sa_len = sizeof( struct sockaddr_at );
            forwro.ro_dst.sa_family = AF_APPLETALK;
            satosat(&forwro.ro_dst)->sat_addr.s_net = to.sat_addr.s_net;
@@ -369,7 +369,7 @@ ddp_input(struct mbuf *m, struct ifnet *ifp, struct elaphdr *elh, int phase)
      * If we found one, deliver th epacket to the socket
      */
     if (ssb_appendaddr( &ddp->ddp_socket->so_rcv, (struct sockaddr *)&from,
-           m, (struct mbuf *)0 ) == 0 ) {
+           m, NULL ) == 0 ) {
        /* 
         * If the socket is full (or similar error) dump the packet.
         */
index 5390b52..af1e7be 100644 (file)
@@ -360,15 +360,15 @@ at_pcbconnect(struct ddpcb *ddp, struct sockaddr *addr, struct thread *td)
                satosat( &ro->ro_dst )->sat_addr.s_node !=
                sat->sat_addr.s_node )) {
            RTFREE( ro->ro_rt );
-           ro->ro_rt = (struct rtentry *)0;
+           ro->ro_rt = NULL;
        }
     }
 
     /*
      * If we've got no route for this interface, try to find one.
      */
-    if ( ro->ro_rt == (struct rtentry *)0 ||
-        ro->ro_rt->rt_ifp == (struct ifnet *)0 ) {
+    if ( ro->ro_rt == NULL ||
+        ro->ro_rt->rt_ifp == NULL ) {
        ro->ro_dst.sa_len = sizeof( struct sockaddr_at );
        ro->ro_dst.sa_family = AF_APPLETALK;
        if ( hintnet ) {
@@ -397,7 +397,7 @@ at_pcbconnect(struct ddpcb *ddp, struct sockaddr *addr, struct thread *td)
 
     ddp->ddp_fsat = *sat;
     if ( ddp->ddp_lsat.sat_port == ATADDR_ANYPORT ) {
-       return(at_pcbsetaddr(ddp, (struct sockaddr *)0, td));
+       return(at_pcbsetaddr(ddp, NULL, td));
     }
     return( 0 );
 }
index 5c59bba..d10d928 100644 (file)
@@ -1100,7 +1100,7 @@ atm_pifname(char *name)
         * Break down name
         */
        if (atm_ifparse(name, n, sizeof(n), &unit))
-               return ((struct atm_pif *)0);
+               return (NULL);
 
        /*
         * Look for the physical interface
@@ -1139,7 +1139,7 @@ atm_nifname(char *name)
         * Break down name
         */
        if (atm_ifparse(name, n, sizeof(n), &unit))
-               return ((struct atm_nif *)0);
+               return (NULL);
 
        /*
         * Search thru each physical interface
index 42b0653..1eb62f4 100644 (file)
@@ -221,7 +221,7 @@ spans_open_vcc(struct spans *spp, Atm_connvc *cvp)
                         */
                        DEQUEUE(svp, struct spans_vccb, sv_sigelem,
                                        spp->sp_vccq);
-                       cvp->cvc_vcc = (struct vccb *)0;
+                       cvp->cvc_vcc = NULL;
                        atm_free((caddr_t)svp);
                        return(err);
                } else {
index 900aac6..d177075 100644 (file)
@@ -366,8 +366,7 @@ unisig_detach(struct atm_pif *pip)
         * Pass the detach event to the signalling manager
         * state machine
         */
-       err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_DETACH,
-                       (KBuffer *)0);
+       err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_DETACH, NULL);
 
        /*
         * Log the fact that we've detached
index ece9eab..d578058 100644 (file)
@@ -395,9 +395,7 @@ unisig_sigmgr_act04(struct unisig *usp, KBuffer *m)
        /*
         * Try to establish an SSCF session.
         */
-       err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ,
-                       usp->us_conn,
-                       (void *)0);
+       err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ, usp->us_conn, NULL);
        if (err)
                panic("unisig_sigmgr_act04: SSCF_UNI_ESTABLISH_REQ");
 
@@ -708,9 +706,7 @@ unisig_sigmgr_act13(struct unisig *usp, KBuffer *m)
        /*
         * Establish the SSCF session
         */
-       err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ,
-                       usp->us_conn,
-                       (void *)0);
+       err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ, usp->us_conn, NULL);
        if (err)
                panic("unisig_sigmgr_act13: SSCF_UNI_ESTABLISH_REQ");
 
@@ -748,7 +744,7 @@ unisig_sigmgr_act14(struct unisig *usp, KBuffer *m)
        /*
         * Locate the signalling channel's VCCB
         */
-       sig_vccb = (struct unisig_vccb *)0;
+       sig_vccb = NULL;
        if (usp->us_conn && usp->us_conn->co_connvc)
                sig_vccb = (struct unisig_vccb *)
                                usp->us_conn->co_connvc->cvc_vcc;
index 5dc108e..a6b33e9 100644 (file)
@@ -1274,8 +1274,7 @@ unisig_vc_act14(struct unisig *usp, struct unisig_vccb *uvp,
                /*
                 * Resend the RELEASE message
                 */
-               rc = unisig_send_release(usp, uvp,
-                               (struct unisig_msg *)0, T_ATM_ABSENT);
+               rc = unisig_send_release(usp, uvp, NULL, T_ATM_ABSENT);
                if (rc)
                        return(rc);
 
index d024384..5a39892 100644 (file)
@@ -366,13 +366,13 @@ ncp_sock_disconnect(struct ncp_conn *conn) {
        conn->flags &= ~(NCPFL_SOCONN | NCPFL_ATTACHED | NCPFL_LOGGED);
        if (conn->ncp_so) {
                so = conn->ncp_so;
-               conn->ncp_so = (struct socket *)0;
+               conn->ncp_so = NULL;
                soshutdown(so, SHUT_RDWR);
                soclose(so, FNONBLOCK);
        }
        if (conn->wdg_so) {
                so = conn->wdg_so;
-               conn->wdg_so = (struct socket *)0;
+               conn->wdg_so = NULL;
                soshutdown(so, SHUT_RDWR);
                soclose(so, FNONBLOCK);
        }
index c5f4d69..14ffeb1 100644 (file)
@@ -110,7 +110,7 @@ idp_input(struct mbuf *m, ...)
                m->m_data += sizeof (struct idp);
        }
        if (ssb_appendaddr(&nsp->nsp_socket->so_rcv, (struct sockaddr *)&idp_ns,
-           m, (struct mbuf *)0) == 0)
+           m, NULL) == 0)
                goto bad;
        sorwakeup(nsp->nsp_socket);
        return;
@@ -223,7 +223,7 @@ idp_output(struct mbuf *m0, struct socket *so, ...)
         * Output datagram.
         */
        if (so->so_options & SO_DONTROUTE)
-               return (ns_output(m, (struct route *)0,
+               return (ns_output(m, NULL,
                    (so->so_options & SO_BROADCAST) | NS_ROUTETOIF));
        /*
         * Use cached route for previous datagram if
@@ -262,7 +262,7 @@ idp_output(struct mbuf *m0, struct socket *so, ...)
                } else {
                re_route:
                        RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)0;
+                       ro->ro_rt = NULL;
                }
        }
        nsp->nsp_lastdst = idp->idp_dna;
index 182d796..17e0aab 100644 (file)
@@ -88,14 +88,14 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
        switch (cmd) {
 
        case SIOCGIFADDR:
-               if (ia == (struct ns_ifaddr *)0)
+               if (ia == NULL)
                        return (EADDRNOTAVAIL);
                *(struct sockaddr_ns *)&ifr->ifr_addr = ia->ia_addr;
                return (0);
 
 
        case SIOCGIFBRDADDR:
-               if (ia == (struct ns_ifaddr *)0)
+               if (ia == NULL)
                        return (EADDRNOTAVAIL);
                if ((ifp->if_flags & IFF_BROADCAST) == 0)
                        return (EINVAL);
@@ -103,7 +103,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
                return (0);
 
        case SIOCGIFDSTADDR:
-               if (ia == (struct ns_ifaddr *)0)
+               if (ia == NULL)
                        return (EADDRNOTAVAIL);
                if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
                        return (EINVAL);
@@ -132,7 +132,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
 
        case SIOCSIFADDR:
        case SIOCSIFDSTADDR:
-               if (ia == (struct ns_ifaddr *)0) {
+               if (ia == NULL) {
                        oia = ifa_create(sizeof(*ia), M_WAITOK);
                        if ((ia = ns_ifaddr) != NULL) {
                                for ( ; ia->ia_next; ia = ia->ia_next)
index a190d66..286687f 100644 (file)
@@ -165,7 +165,7 @@ ns_error(struct mbuf *om, int type, int param)
                nip->idp_sum = ns_cksum(m, sizeof(*ep));
        } else
                nip->idp_sum = 0xffff;
-       ns_output(m, (struct route *)0, 0);
+       ns_output(m, NULL, 0);
 
 freeit:
        m_freem(om);
@@ -314,6 +314,6 @@ ns_echo(struct mbuf *m)
                idp->idp_sum = ns_cksum(m,
                    (int)(((ntohs(idp->idp_len) - 1)|1)+1));
        }
-       ns_output(m, (struct route *)0, NS_FORWARDING);
+       ns_output(m, NULL, NS_FORWARDING);
        return(0);
 }
index 440426f..852f94f 100644 (file)
@@ -284,7 +284,7 @@ nsipoutput_serialized(struct ifnet_en *ifn, struct mbuf *m,
        /*
         * Output final datagram.
         */
-       error =  (ip_output(m, (struct mbuf *)0, ro, SO_BROADCAST, NULL));
+       error =  (ip_output(m, NULL, ro, SO_BROADCAST, NULL));
        if (error) {
                ifn->ifen_ifnet.if_oerrors++;
                ifn->ifen_ifnet.if_ierrors = error;
@@ -383,10 +383,10 @@ nsip_route(struct mbuf *m)
         */
        ifr.ifr_name[4] = '0' + nsipif_units - 1;
        ifr.ifr_dstaddr = * (struct sockaddr *) ns_dst;
-       ns_control((struct socket *)0, (int)SIOCSIFDSTADDR, (caddr_t)&ifr,
+       ns_control(NULL, (int)SIOCSIFDSTADDR, (caddr_t)&ifr,
                        (struct ifnet *)ifn, NULL);
        satons_addr(ifr.ifr_addr).x_host = ns_thishost;
-       return (ns_control((struct socket *)0, (int)SIOCSIFADDR, (caddr_t)&ifr,
+       return (ns_control(NULL, (int)SIOCSIFADDR, (caddr_t)&ifr,
                        (struct ifnet *)ifn, NULL));
 }
 
index f4fca20..e7c650b 100644 (file)
@@ -164,14 +164,14 @@ ns_pcbconnect(struct nspcb *nsp, struct sockaddr *nam)
        flush:
                        if (ro->ro_rt)
                                RTFREE(ro->ro_rt);
-                       ro->ro_rt = (struct rtentry *)0;
+                       ro->ro_rt = NULL;
                        nsp->nsp_laddr.x_net = ns_zeronet;
                }
        }/* else cached route is ok; do nothing */
        nsp->nsp_lastdst = sns->sns_addr;
        if ((nsp->nsp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
-           (ro->ro_rt == (struct rtentry *)0 ||
-            ro->ro_rt->rt_ifp == (struct ifnet *)0)) {
+           (ro->ro_rt == NULL ||
+            ro->ro_rt->rt_ifp == NULL)) {
                    /* No route yet, so try to acquire one */
                    ro->ro_dst.sa_family = AF_NS;
                    ro->ro_dst.sa_len = sizeof(ro->ro_dst);
@@ -185,7 +185,7 @@ ns_pcbconnect(struct nspcb *nsp, struct sockaddr *nam)
                 * our src addr is taken from the i/f, else punt.
                 */
 
-               ia = (struct ns_ifaddr *)0;
+               ia = NULL;
                /*
                 * If we found a route, use the address
                 * corresponding to the outgoing interface
index 2b2e5a1..5539cd8 100644 (file)
@@ -276,7 +276,7 @@ spp_input(struct mbuf *m, ...)
                m_freem(m);
        }
        if (cb->s_force || (cb->s_flags & (SF_ACKNOW|SF_WIN|SF_RXT)))
-               spp_output(cb, (struct mbuf *)0);
+               spp_output(cb, NULL);
        cb->s_flags &= ~(SF_WIN|SF_RXT);
        return;
 
@@ -345,7 +345,7 @@ spp_reass(struct sppcb *cb, struct spidp *si, struct mbuf *si_m)
                                cb->s_snxt = si->si_ack;
                                cb->s_cwnd = CUNIT;
                                cb->s_force = 1 + SPPT_REXMT;
-                               spp_output(cb, (struct mbuf *)0);
+                               spp_output(cb, NULL);
                                cb->s_timer[SPPT_REXMT] = cb->s_rxtcur;
                                cb->s_rtt = 0;
                                if (cwnd >= 4 * CUNIT)
@@ -1106,7 +1106,7 @@ send:
                        spp_trace(SA_OUTPUT, cb->s_state, cb, si, 0);
 
                if (so->so_options & SO_DONTROUTE)
-                       error = ns_output(m, (struct route *)0, NS_ROUTETOIF);
+                       error = ns_output(m, NULL, NS_ROUTETOIF);
                else
                        error = ns_output(m, &cb->s_nspcb->nsp_route, 0);
        }
@@ -1725,7 +1725,7 @@ spp_close(struct sppcb *cb)
        soisdisconnected(so);
        ns_pcbdetach(nsp);
        sppstat.spps_closed++;
-       return ((struct sppcb *)0);
+       return (NULL);
 }
 /*
  *     Someday we may do level 3 handshaking
index 7f5c367..355be8a 100644 (file)
@@ -62,22 +62,22 @@ db_varfcn_t db_dr7;
  * Machine register set.
  */
 struct db_variable db_regs[] = {
-       { "cs",         &ddb_regs.tf_cs,     FCN_NULL },
-       { "ds",         &ddb_regs.tf_ds,     FCN_NULL },
-       { "es",         &ddb_regs.tf_es,     FCN_NULL },
-       { "fs",         &ddb_regs.tf_fs,     FCN_NULL },
-       { "gs",         &ddb_regs.tf_gs,     FCN_NULL },
-       { "ss",         &ddb_regs.tf_ss,     FCN_NULL },
-       { "eax",        &ddb_regs.tf_eax,    FCN_NULL },
-       { "ecx",        &ddb_regs.tf_ecx,    FCN_NULL },
-       { "edx",        &ddb_regs.tf_edx,    FCN_NULL },
-       { "ebx",        &ddb_regs.tf_ebx,    FCN_NULL },
-       { "esp",        &ddb_regs.tf_esp,    FCN_NULL },
-       { "ebp",        &ddb_regs.tf_ebp,    FCN_NULL },
-       { "esi",        &ddb_regs.tf_esi,    FCN_NULL },
-       { "edi",        &ddb_regs.tf_edi,    FCN_NULL },
-       { "eip",        &ddb_regs.tf_eip,    FCN_NULL },
-       { "efl",        &ddb_regs.tf_eflags, FCN_NULL },
+       { "cs",         &ddb_regs.tf_cs,     NULL },
+       { "ds",         &ddb_regs.tf_ds,     NULL },
+       { "es",         &ddb_regs.tf_es,     NULL },
+       { "fs",         &ddb_regs.tf_fs,     NULL },
+       { "gs",         &ddb_regs.tf_gs,     NULL },
+       { "ss",         &ddb_regs.tf_ss,     NULL },
+       { "eax",        &ddb_regs.tf_eax,    NULL },
+       { "ecx",        &ddb_regs.tf_ecx,    NULL },
+       { "edx",        &ddb_regs.tf_edx,    NULL },
+       { "ebx",        &ddb_regs.tf_ebx,    NULL },
+       { "esp",        &ddb_regs.tf_esp,    NULL },
+       { "ebp",        &ddb_regs.tf_ebp,    NULL },
+       { "esi",        &ddb_regs.tf_esi,    NULL },
+       { "edi",        &ddb_regs.tf_edi,    NULL },
+       { "eip",        &ddb_regs.tf_eip,    NULL },
+       { "efl",        &ddb_regs.tf_eflags, NULL },
        { "dr0",        NULL,                db_dr0 },
        { "dr1",        NULL,                db_dr1 },
        { "dr2",        NULL,                db_dr2 },
index 2c38d71..bf02be1 100644 (file)
@@ -94,30 +94,30 @@ db_varfcn_t db_dr7;
  * Machine register set.
  */
 struct db_variable db_regs[] = {
-       { "cs",         &ddb_regs.tf_cs,     FCN_NULL },
-/*     { "ds",         &ddb_regs.tf_ds,     FCN_NULL },
-       { "es",         &ddb_regs.tf_es,     FCN_NULL },
-       { "fs",         &ddb_regs.tf_fs,     FCN_NULL },
-       { "gs",         &ddb_regs.tf_gs,     FCN_NULL }, */
-       { "ss",         &ddb_regs.tf_ss,     FCN_NULL },
-       { "rax",        &ddb_regs.tf_rax,    FCN_NULL },
-       { "rcx",        &ddb_regs.tf_rcx,    FCN_NULL },
-       { "rdx",        &ddb_regs.tf_rdx,    FCN_NULL },
-       { "rbx",        &ddb_regs.tf_rbx,    FCN_NULL },
-       { "rsp",        &ddb_regs.tf_rsp,    FCN_NULL },
-       { "rbp",        &ddb_regs.tf_rbp,    FCN_NULL },
-       { "rsi",        &ddb_regs.tf_rsi,    FCN_NULL },
-       { "rdi",        &ddb_regs.tf_rdi,    FCN_NULL },
-       { "rip",        &ddb_regs.tf_rip,    FCN_NULL },
-       { "rfl",        &ddb_regs.tf_rflags, FCN_NULL },
-       { "r8",         &ddb_regs.tf_r8,     FCN_NULL },
-       { "r9",         &ddb_regs.tf_r9,     FCN_NULL },
-       { "r10",        &ddb_regs.tf_r10,    FCN_NULL },
-       { "r11",        &ddb_regs.tf_r11,    FCN_NULL },
-       { "r12",        &ddb_regs.tf_r12,    FCN_NULL },
-       { "r13",        &ddb_regs.tf_r13,    FCN_NULL },
-       { "r14",        &ddb_regs.tf_r14,    FCN_NULL },
-       { "r15",        &ddb_regs.tf_r15,    FCN_NULL },
+       { "cs",         &ddb_regs.tf_cs,     NULL },
+/*     { "ds",         &ddb_regs.tf_ds,     NULL },
+       { "es",         &ddb_regs.tf_es,     NULL },
+       { "fs",         &ddb_regs.tf_fs,     NULL },
+       { "gs",         &ddb_regs.tf_gs,     NULL }, */
+       { "ss",         &ddb_regs.tf_ss,     NULL },
+       { "rax",        &ddb_regs.tf_rax,    NULL },
+       { "rcx",        &ddb_regs.tf_rcx,    NULL },
+       { "rdx",        &ddb_regs.tf_rdx,    NULL },
+       { "rbx",        &ddb_regs.tf_rbx,    NULL },
+       { "rsp",        &ddb_regs.tf_rsp,    NULL },
+       { "rbp",        &ddb_regs.tf_rbp,    NULL },
+       { "rsi",        &ddb_regs.tf_rsi,    NULL },
+       { "rdi",        &ddb_regs.tf_rdi,    NULL },
+       { "rip",        &ddb_regs.tf_rip,    NULL },
+       { "rfl",        &ddb_regs.tf_rflags, NULL },
+       { "r8",         &ddb_regs.tf_r8,     NULL },
+       { "r9",         &ddb_regs.tf_r9,     NULL },
+       { "r10",        &ddb_regs.tf_r10,    NULL },
+       { "r11",        &ddb_regs.tf_r11,    NULL },
+       { "r12",        &ddb_regs.tf_r12,    NULL },
+       { "r13",        &ddb_regs.tf_r13,    NULL },
+       { "r14",        &ddb_regs.tf_r14,    NULL },
+       { "r15",        &ddb_regs.tf_r15,    NULL },
        { "dr0",        NULL,                db_dr0 },
        { "dr1",        NULL,                db_dr1 },
        { "dr2",        NULL,                db_dr2 },
index 706a43e..5dab6bd 100644 (file)
@@ -56,22 +56,22 @@ static int db_dr(struct db_variable *vp, db_expr_t *valuep, int op);
  * Machine register set.
  */
 struct db_variable db_regs[] = {
-       { "cs",         &ddb_regs.tf_cs,     FCN_NULL },
-       { "ds",         &ddb_regs.tf_ds,     FCN_NULL },
-       { "es",         &ddb_regs.tf_es,     FCN_NULL },
-       { "fs",         &ddb_regs.tf_fs,     FCN_NULL },
-       { "gs",         &ddb_regs.tf_gs,     FCN_NULL },
-       { "ss",         &ddb_regs.tf_ss,     FCN_NULL },
-       { "eax",        &ddb_regs.tf_eax,    FCN_NULL },
-       { "ecx",        &ddb_regs.tf_ecx,    FCN_NULL },
-       { "edx",        &ddb_regs.tf_edx,    FCN_NULL },
-       { "ebx",        &ddb_regs.tf_ebx,    FCN_NULL },
-       { "esp",        &ddb_regs.tf_esp,    FCN_NULL },
-       { "ebp",        &ddb_regs.tf_ebp,    FCN_NULL },
-       { "esi",        &ddb_regs.tf_esi,    FCN_NULL },
-       { "edi",        &ddb_regs.tf_edi,    FCN_NULL },
-       { "eip",        &ddb_regs.tf_eip,    FCN_NULL },
-       { "efl",        &ddb_regs.tf_eflags, FCN_NULL },
+       { "cs",         &ddb_regs.tf_cs,     NULL },
+       { "ds",         &ddb_regs.tf_ds,     NULL },
+       { "es",         &ddb_regs.tf_es,     NULL },
+       { "fs",         &ddb_regs.tf_fs,     NULL },
+       { "gs",         &ddb_regs.tf_gs,     NULL },
+       { "ss",         &ddb_regs.tf_ss,     NULL },
+       { "eax",        &ddb_regs.tf_eax,    NULL },
+       { "ecx",        &ddb_regs.tf_ecx,    NULL },
+       { "edx",        &ddb_regs.tf_edx,    NULL },
+       { "ebx",        &ddb_regs.tf_ebx,    NULL },
+       { "esp",        &ddb_regs.tf_esp,    NULL },
+       { "ebp",        &ddb_regs.tf_ebp,    NULL },
+       { "esi",        &ddb_regs.tf_esi,    NULL },
+       { "edi",        &ddb_regs.tf_edi,    NULL },
+       { "eip",        &ddb_regs.tf_eip,    NULL },
+       { "efl",        &ddb_regs.tf_eflags, NULL },
        { "dr0",        NULL,                db_dr },
        { "dr1",        NULL,                db_dr },
        { "dr2",        NULL,                db_dr },
index c80ad39..580f229 100644 (file)
@@ -50,7 +50,7 @@
 struct sem;
 typedef struct sem *sem_t;
 
-#define SEM_FAILED     ((sem_t *)0)
+#define SEM_FAILED     (NULL)
 #define SEM_VALUE_MAX  UINT_MAX
 
 #ifndef _KERNEL
index ef8392c..7b16737 100644 (file)
@@ -318,8 +318,7 @@ fifo_write(struct vop_write_args *ap)
        else
                flags = 0;
        vn_unlock(ap->a_vp);
-       error = sosend(wso, (struct sockaddr *)0, ap->a_uio, 0,
-                      (struct mbuf *)0, flags, td);
+       error = sosend(wso, NULL, ap->a_uio, 0, NULL, flags, td);
        vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY);
        return (error);
 }
index 28b8c5b..66f37a7 100644 (file)
@@ -170,7 +170,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
        nb = ip->i_ib[indirs[0].in_off];
        if (nb == 0) {
 #if 0
-               pref = ext2_blkpref(ip, lbn, 0, (daddr_t *)0, 0);
+               pref = ext2_blkpref(ip, lbn, 0, NULL, 0);
 #else
                /* see the comment by ext2_blkpref. What we do here is
                   to pretend that it'd be good for a block holding indirect
@@ -236,7 +236,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
                        pref = ext2_blkpref(ip, lbn, indirs[i].in_off, bap,
                                                lblkno(fs, bp->b_loffset));
 #else
-                       pref = ext2_blkpref(ip, lbn, 0, (daddr_t *)0, 0);
+                       pref = ext2_blkpref(ip, lbn, 0, NULL, 0);
 #endif
                if ((error =
                    ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {
index 7f3862d..8f081d4 100644 (file)
@@ -1015,7 +1015,7 @@ ext2_checkpath(struct inode *source, struct inode *target, struct ucred *cred)
                }
                error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
                                sizeof (struct dirtemplate), (off_t)0,
-                               UIO_SYSSPACE, IO_NODELOCKED, cred, (int *)0);
+                               UIO_SYSSPACE, IO_NODELOCKED, cred, NULL);
                if (error != 0)
                        break;
                namlen = dirbuf.dotdot_type;    /* like ufs little-endian */
index d0a4c74..46432d7 100644 (file)
@@ -918,7 +918,7 @@ ext2_dqflush(struct vnode *vp)
                        if (dq->dq_cnt)
                                panic("dqflush: stray dquot");
                        LIST_REMOVE(dq, dq_hash);
-                       dq->dq_ump = (struct ext2mount *)0;
+                       dq->dq_ump = NULL;
                }
        }
 }
index 8f07518..7bf177e 100644 (file)
@@ -790,7 +790,7 @@ abortit:
                        error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf,
                                        sizeof (struct dirtemplate), (off_t)0,
                                        UIO_SYSSPACE, IO_NODELOCKED,
-                                       tcnp->cn_cred, (int *)0);
+                                       tcnp->cn_cred, NULL);
                        if (error == 0) {
                                /* Like ext2 little-endian: */
                                namlen = dirbuf.dotdot_type;
@@ -806,7 +806,7 @@ abortit:
                                                sizeof (struct dirtemplate),
                                                (off_t)0, UIO_SYSSPACE,
                                                IO_NODELOCKED|IO_SYNC,
-                                               tcnp->cn_cred, (int *)0);
+                                               tcnp->cn_cred, NULL);
                                }
                        }
                }
@@ -975,7 +975,7 @@ ext2_mkdir(struct vop_old_mkdir_args *ap)
        dirtemplate.dotdot_reclen = DIRBLKSIZ - 12;
        error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate,
                        sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE,
-                       IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0);
+                       IO_NODELOCKED|IO_SYNC, cnp->cn_cred, NULL);
        if (error) {
                dp->i_nlink--;
                dp->i_flag |= IN_CHANGE;
@@ -1110,7 +1110,7 @@ ext2_symlink(struct vop_old_symlink_args *ap)
 
                error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
                                UIO_SYSSPACE, IO_NODELOCKED, 
-                               ap->a_cnp->cn_cred, (int *)0);
+                               ap->a_cnp->cn_cred, NULL);
 
                if (error)
                        vput(vp);
index ebd8097..c38e038 100644 (file)
@@ -682,7 +682,7 @@ cd9660_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
 #else
            0,
 #endif
-           (struct iso_directory_record *)0));
+           NULL));
 }
 
 int
index bb660ce..045d742 100644 (file)
@@ -1246,7 +1246,7 @@ abortit:
                bcopy(toname, ip->de_Name, 11); /* update denode */
                dp->de_fndoffset = to_diroffset;
                dp->de_fndcnt = to_count;
-               error = createde(ip, dp, (struct denode **)0, tcnp);
+               error = createde(ip, dp, NULL, tcnp);
                if (error) {
                        bcopy(oldname, ip->de_Name, 11);
                        goto done;
index 388396d..0799ac6 100644 (file)
@@ -1103,7 +1103,7 @@ nfs_getcacheblk(struct vnode *vp, off_t loffset, int size, struct thread *td)
        if (nmp->nm_flag & NFSMNT_INT) {
                bp = getblk(vp, loffset, size, GETBLK_PCATCH, 0);
                while (bp == NULL) {
-                       if (nfs_sigintr(nmp, (struct nfsreq *)0, td))
+                       if (nfs_sigintr(nmp, NULL, td))
                                return (NULL);
                        bp = getblk(vp, loffset, size, 0, 2 * hz);
                }
index c56cc07..4b2f1df 100644 (file)
@@ -179,7 +179,7 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
            (nfsd->nd_flag & ND_KERBAUTH), TRUE);
        if (error) {
                nfsm_reply(NFSX_UNSIGNED);
-               nfsm_srvpostop_attr(1, (struct vattr *)0);
+               nfsm_srvpostop_attr(1, NULL);
                error = 0;
                goto nfsmout;
        }
@@ -627,7 +627,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
 
        nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 #ifndef nolint
-       mp2 = (struct mbuf *)0;
+       mp2 = NULL;
 #endif
        mp3 = NULL;
        fhp = &nfh.fh_generic;
@@ -664,7 +664,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
                 &rdonly, (nfsd->nd_flag & ND_KERBAUTH), TRUE);
        if (error) {
                nfsm_reply(2 * NFSX_UNSIGNED);
-               nfsm_srvpostop_attr(1, (struct vattr *)0);
+               nfsm_srvpostop_attr(1, NULL);
                error = 0;
                goto nfsmout;
        }
@@ -762,7 +762,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
        if (error) {
                vp = NULL;
                nfsm_reply(2 * NFSX_UNSIGNED);
-               nfsm_srvpostop_attr(1, (struct vattr *)0);
+               nfsm_srvpostop_attr(1, NULL);
                error = 0;
                goto nfsmout;
        }
@@ -2072,7 +2072,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
 
        nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 #ifndef nolint
-       fvp = (struct vnode *)0;
+       fvp = NULL;
 #endif
        ffhp = &fnfh.fh_generic;
        tfhp = &tnfh.fh_generic;
@@ -2396,7 +2396,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
        u_int32_t *tl;
        int32_t t1;
        struct nfsv2_sattr *sp;
-       char *bpos, *pathcp = (char *)0, *cp2;
+       char *bpos, *pathcp = NULL, *cp2;
        struct uio io;
        struct iovec iv;
        int error = 0, len, len2, dirfor_ret = 1, diraft_ret = 1;
index f0b09ae..1b620c7 100644 (file)
@@ -212,7 +212,7 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
        struct sockaddr_in *sin;
        struct thread *td = &thread0; /* only used for socreate and sobind */
 
-       nmp->nm_so = (struct socket *)0;
+       nmp->nm_so = NULL;
        saddr = nmp->nm_nam;
        error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
                nmp->nm_soproto, td);
@@ -420,7 +420,7 @@ nfs_disconnect(struct nfsmount *nmp)
 
        if (nmp->nm_so) {
                so = nmp->nm_so;
-               nmp->nm_so = (struct socket *)0;
+               nmp->nm_so = NULL;
                soshutdown(so, SHUT_RDWR);
                soclose(so, FNONBLOCK);
        }
@@ -474,7 +474,7 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top,
        } else
                soflags = so->so_proto->pr_flags;
        if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
-               sendnam = (struct sockaddr *)0;
+               sendnam = NULL;
        else
                sendnam = nam;
        if (so->so_type == SOCK_SEQPACKET)
@@ -980,7 +980,7 @@ nfs_request(struct vnode *vp, struct mbuf *mrest, int procnum,
         * Get the RPC header with authorization.
         */
 kerbauth:
-       verf_str = auth_str = (char *)0;
+       verf_str = auth_str = NULL;
        if (nmp->nm_flag & NFSMNT_KERB) {
                verf_str = nickv;
                verf_len = sizeof (nickv);
@@ -1140,7 +1140,7 @@ tryagain:
                else if ((nmp->nm_flag & NFSMNT_KERB) && *tl++ == rpc_autherr) {
                        if (!failed_auth) {
                                failed_auth++;
-                               mheadend->m_next = (struct mbuf *)0;
+                               mheadend->m_next = NULL;
                                m_freem(mrep);
                                m_freem(rep->r_mreq);
                                goto kerbauth;
@@ -1434,11 +1434,10 @@ nfs_timer(void *arg /* never used */)
                    nmp->nm_sent < nmp->nm_cwnd) &&
                   (m = m_copym(rep->r_mreq, 0, M_COPYALL, MB_DONTWAIT))){
                        if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
-                           error = so_pru_send(so, 0, m, (struct sockaddr *)0,
-                                    (struct mbuf *)0, td);
+                           error = so_pru_send(so, 0, m, NULL, NULL, td);
                        else
                            error = so_pru_send(so, 0, m, nmp->nm_nam,
-                               (struct mbuf *)0, td);
+                               NULL, td);
                        if (error) {
                                if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
                                        so->so_error = 0;
@@ -2240,12 +2239,12 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag, int *countp)
            recm = NULL;
            if (slp->ns_cc == slp->ns_reclen) {
                recm = slp->ns_raw;
-               slp->ns_raw = slp->ns_rawend = (struct mbuf *)0;
+               slp->ns_raw = slp->ns_rawend = NULL;
                slp->ns_cc = slp->ns_reclen = 0;
            } else if (slp->ns_cc > slp->ns_reclen) {
                len = 0;
                m = slp->ns_raw;
-               om = (struct mbuf *)0;
+               om = NULL;
 
                while (len < slp->ns_reclen) {
                        if ((len + m->m_len) > slp->ns_reclen) {
@@ -2268,7 +2267,7 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag, int *countp)
                                len += m->m_len;
                                m = m->m_next;
                                recm = slp->ns_raw;
-                               om->m_next = (struct mbuf *)0;
+                               om->m_next = NULL;
                        } else {
                                om = m;
                                len += m->m_len;
@@ -2297,13 +2296,13 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag, int *countp)
                    m_freem(slp->ns_frag);
                } else {
                    nfs_realign(&slp->ns_frag, 10 * NFSX_UNSIGNED);
-                   rec->nr_address = (struct sockaddr *)0;
+                   rec->nr_address = NULL;
                    rec->nr_packet = slp->ns_frag;
                    STAILQ_INSERT_TAIL(&slp->ns_rec, rec, nr_link);
                    ++slp->ns_numrec;
                    ++*countp;
                }
-               slp->ns_frag = (struct mbuf *)0;
+               slp->ns_frag = NULL;
            }
        }
 }
index 5c65067..8dce3fa 100644 (file)
@@ -722,7 +722,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
        }
        mb->m_next = mrest;
        mreq->m_pkthdr.len = authsiz + 10 * NFSX_UNSIGNED + mrest_len;
-       mreq->m_pkthdr.rcvif = (struct ifnet *)0;
+       mreq->m_pkthdr.rcvif = NULL;
        *mbp = mb;
        return (mreq);
 }
@@ -1058,7 +1058,7 @@ nfs_init(struct vfsconf *vfsp)
        /* Ensure async daemons disabled */
        for (i = 0; i < NFS_MAXASYNCDAEMON; i++) {
                nfs_iodwant[i] = NULL;
-               nfs_iodmount[i] = (struct nfsmount *)0;
+               nfs_iodmount[i] = NULL;
        }
        nfs_nhinit();                   /* Init the nfsnode table */
 #ifndef NFS_NOSERVER
@@ -1662,7 +1662,7 @@ nfsm_adj(struct mbuf *mp, int len, int nul)
        m = mp;
        for (;;) {
                count += m->m_len;
-               if (m->m_next == (struct mbuf *)0)
+               if (m->m_next == NULL)
                        break;
                m = m->m_next;
        }
@@ -1949,14 +1949,14 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
                        dp->ndm_eocookie = 0;
                        LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
                } else
-                       return ((nfsuint64 *)0);
+                       return (NULL);
        }
        while (pos >= NFSNUMCOOKIES) {
                pos -= NFSNUMCOOKIES;
                if (dp->ndm_list.le_next) {
                        if (!add && dp->ndm_eocookie < NFSNUMCOOKIES &&
                                pos >= dp->ndm_eocookie)
-                               return ((nfsuint64 *)0);
+                               return (NULL);
                        dp = dp->ndm_list.le_next;
                } else if (add) {
                        MALLOC(dp2, struct nfsdmap *, sizeof (struct nfsdmap),
@@ -1965,13 +1965,13 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
                        LIST_INSERT_AFTER(dp, dp2, ndm_list);
                        dp = dp2;
                } else
-                       return ((nfsuint64 *)0);
+                       return (NULL);
        }
        if (pos >= dp->ndm_eocookie) {
                if (add)
                        dp->ndm_eocookie = pos + 1;
                else
-                       return ((nfsuint64 *)0);
+                       return (NULL);
        }
        return (&dp->ndm_cookies[pos]);
 }
index ef361d2..e1c913e 100644 (file)
@@ -205,7 +205,7 @@ sys_nfssvc(struct nfssvc_args *uap)
                 * Get the client address for connected sockets.
                 */
                if (nfsdarg.name == NULL || nfsdarg.namelen == 0)
-                       nam = (struct sockaddr *)0;
+                       nam = NULL;
                else {
                        error = getsockaddr(&nam, nfsdarg.name,
                                            nfsdarg.namelen);
@@ -250,12 +250,12 @@ sys_nfssvc(struct nfssvc_args *uap)
                                   kmalloc(sizeof (struct nfsuid), M_NFSUID,
                                        M_WAITOK);
                            } else
-                               nuidp = (struct nfsuid *)0;
+                               nuidp = NULL;
                            if ((slp->ns_flag & SLP_VALID) == 0) {
                                if (nuidp)
                                    kfree((caddr_t)nuidp, M_NFSUID);
                            } else {
-                               if (nuidp == (struct nfsuid *)0) {
+                               if (nuidp == NULL) {
                                    nuidp = TAILQ_FIRST(&slp->ns_uidlruhead);
                                    LIST_REMOVE(nuidp, nu_hash);
                                    TAILQ_REMOVE(&slp->ns_uidlruhead, nuidp,
@@ -328,7 +328,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td)
 
        so = (struct socket *)fp->f_data;
 #if 0
-       tslp = (struct nfssvc_sock *)0;
+       tslp = NULL;
        /*
         * Add it to the list, as required.
         */
@@ -441,7 +441,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
        cacherep = RC_DOIT;
        writes_todo = 0;
 #endif
-       if (nfsd == (struct nfsd *)0) {
+       if (nfsd == NULL) {
                nsd->nsd_nfsd = nfsd = (struct nfsd *)
                        kmalloc(sizeof (struct nfsd), M_NFSD, M_WAITOK|M_ZERO);
                crit_enter();
@@ -479,7 +479,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
                                if (slp == 0)
                                        nfsd_head_flag &= ~NFSD_CHECKSLP;
                        }
-                       if ((slp = nfsd->nfsd_slp) == (struct nfssvc_sock *)0)
+                       if ((slp = nfsd->nfsd_slp) == NULL)
                                continue;
                        if (slp->ns_flag & SLP_VALID) {
                                if (slp->ns_flag & SLP_DISCONN)
@@ -511,7 +511,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
                                kfree((caddr_t)nd, M_NFSRVDESC);
                                nd = NULL;
                        }
-                       nfsd->nfsd_slp = (struct nfssvc_sock *)0;
+                       nfsd->nfsd_slp = NULL;
                        nfsd->nfsd_flag &= ~NFSD_REQINPROG;
                        nfsrv_slpderef(slp);
                        continue;
@@ -603,7 +603,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
                        }
                        nfsstats.srvrpccnt[nd->nd_procnum]++;
                        nfsrv_updatecache(nd, TRUE, mreq);
-                       nd->nd_mrep = (struct mbuf *)0;
+                       nd->nd_mrep = NULL;
                    case RC_REPLY:
                        m = mreq;
                        siz = 0;
@@ -617,7 +617,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
                        }
                        m = mreq;
                        m->m_pkthdr.len = siz;
-                       m->m_pkthdr.rcvif = (struct ifnet *)0;
+                       m->m_pkthdr.rcvif = NULL;
                        /*
                         * For stream protocols, prepend a Sun RPC
                         * Record Mark.
@@ -691,7 +691,7 @@ done:
        TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
        crit_exit();
        kfree((caddr_t)nfsd, M_NFSD);
-       nsd->nsd_nfsd = (struct nfsd *)0;
+       nsd->nsd_nfsd = NULL;
        if (--nfs_numnfsd == 0)
                nfsrv_init(TRUE);       /* Reinitialize everything */
        return (error);
@@ -716,7 +716,7 @@ nfsrv_zapsock(struct nfssvc_sock *slp)
        slp->ns_flag &= ~SLP_ALLFLAGS;
        fp = slp->ns_fp;
        if (fp) {
-               slp->ns_fp = (struct file *)0;
+               slp->ns_fp = NULL;
                so = slp->ns_so;
                so->so_rcv.ssb_flags &= ~SSB_UPCALL;
                so->so_upcall = NULL;
index ed7528c..4a05d64 100644 (file)
@@ -306,7 +306,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred)
        u_quad_t tquad;
 
 #ifndef nolint
-       sfp = (struct nfs_statfs *)0;
+       sfp = NULL;
 #endif
        error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np);
        if (error)
@@ -777,7 +777,7 @@ nfs_decode_args(struct nfsmount *nmp, struct nfs_args *argp)
        if (nmp->nm_so && adjsock) {
                nfs_safedisconnect(nmp);
                if (nmp->nm_sotype == SOCK_DGRAM)
-                       while (nfs_connect(nmp, (struct nfsreq *)0)) {
+                       while (nfs_connect(nmp, NULL)) {
                                kprintf("nfs_args: retrying connect\n");
                                (void) tsleep((caddr_t)&lbolt, 0, "nfscon", 0);
                        }
@@ -943,7 +943,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
         * the first request, in case the server is not responding.
         */
        if (nmp->nm_sotype == SOCK_DGRAM &&
-               (error = nfs_connect(nmp, (struct nfsreq *)0)))
+               (error = nfs_connect(nmp, NULL)))
                goto bad;
 
        /*