From 2038fb68f6f4648634dc635cc08cf85a47e81e05 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 6 Apr 2009 14:52:46 +0200 Subject: [PATCH] Replace all casts of NULL to something with NULL. --- bin/date/date.c | 4 +- bin/dd/dd.c | 2 +- bin/dd/misc.c | 2 +- bin/expr/expr.y | 2 +- bin/mv/mv.c | 4 +- bin/pax/ar_io.c | 3 +- bin/pax/gen_subs.c | 2 +- bin/ps/ps.c | 2 +- bin/rcp/util.c | 2 +- bin/sh/eval.c | 6 +- bin/sh/expand.c | 6 +- bin/sh/jobs.c | 8 +- bin/sh/parser.c | 4 +- bin/sh/redir.c | 2 +- bin/sleep/sleep.c | 2 +- games/atc/input.c | 4 +- games/bs/bs.c | 14 +- games/cribbage/instr.c | 2 +- games/hunt/hunt/hunt.c | 6 +- games/hunt/huntd/driver.c | 82 ++++++------ games/hunt/huntd/execute.c | 3 +- games/hunt/huntd/shots.c | 4 +- games/larn/tok.c | 2 +- games/mille/mille.c | 2 +- games/mille/move.c | 2 +- games/mille/varpush.c | 2 +- games/phantasia/misc.c | 3 +- games/rain/rain.c | 2 +- games/rogue/machdep.c | 4 +- games/worms/worms.c | 2 +- games/wump/wump.c | 2 +- lib/libc/compat-43/getwd.c | 2 +- lib/libc/db/hash/hash_page.c | 2 +- lib/libc/gen/fstab.c | 6 +- lib/libc/gen/wordexp.c | 2 +- lib/libc/net/gethostbynis.c | 2 +- lib/libc/net/getnetbynis.c | 2 +- lib/libc/net/rcmdsh.c | 5 +- lib/libc/rpc/auth_des.c | 2 +- lib/libc/rpc/auth_time.c | 2 +- lib/libc/rpc/clnt_dg.c | 8 +- lib/libc/rpc/clnt_generic.c | 6 +- lib/libc/rpc/clnt_vc.c | 18 +-- lib/libc/rpc/crypt_client.c | 4 +- lib/libc/rpc/key_call.c | 20 +-- lib/libc/rpc/netname.c | 4 +- lib/libc/rpc/rpc_generic.c | 4 +- lib/libc/rpc/rpc_soc.c | 2 +- lib/libc/rpc/rpcb_clnt.c | 6 +- lib/libc/rpc/rtime.c | 2 +- lib/libc/rpc/svc_auth_des.c | 2 +- lib/libc/stdio/mktemp.c | 4 +- lib/libc/stdio/setbuf.3 | 2 +- lib/libc/stdio/setbuffer.c | 2 +- lib/libc/stdio/vfscanf.c | 4 +- lib/libc/stdlib/atof.3 | 2 +- lib/libc/stdlib/atoi.3 | 2 +- lib/libc/stdlib/atoi.c | 2 +- lib/libc/stdlib/atol.3 | 4 +- lib/libc/stdlib/atol.c | 2 +- lib/libc/stdlib/system.c | 2 +- lib/libc/stdtime/localtime.c | 2 +- lib/libc_r/uthread/uthread_init.c | 2 +- lib/libedit/filecomplete.c | 2 +- lib/libedit/readline.c | 2 +- lib/libposix1e/acl_to_text.3 | 2 +- lib/librpcsvc/rnusers.c | 4 +- lib/librpcsvc/rwall.c | 2 +- lib/libthread_xu/thread/thr_init.c | 2 +- lib/libutil/login_tty.c | 2 +- lib/libutil/pw_util.c | 6 +- lib/libutil/uucplock.c | 2 +- libexec/atrun/atrun.c | 6 +- libexec/getty/main.c | 14 +- libexec/getty/subr.c | 6 +- libexec/pppoed/pppoed.c | 2 +- libexec/rlogind/rlogind.c | 6 +- libexec/rpc.rquotad/rquotad.c | 2 +- libexec/rshd/rshd.c | 2 +- sbin/adjkerntz/adjkerntz.c | 2 +- sbin/atm/ilmid/ilmid.c | 18 +-- sbin/disklabel/disklabel.c | 2 +- sbin/disklabel64/disklabel64.c | 2 +- sbin/dump/tape.c | 2 +- sbin/init/init.c | 2 +- sbin/mountd/mountd.c | 58 ++++----- sbin/ping/ping.c | 2 +- sbin/ping6/ping6.c | 2 +- sbin/restore/symtab.c | 2 +- sbin/restore/tape.c | 2 +- sbin/route/route.c | 22 ++-- sbin/shutdown/shutdown.c | 10 +- share/examples/isdn/v21/v21modem.c | 2 +- share/examples/scsi_target/scsi_target.c | 2 +- share/examples/sunrpc/sort/rsort.c | 2 +- share/examples/sunrpc/sort/sort_proc.c | 2 +- share/man/man9/style.9 | 2 +- sys/bus/cam/scsi/scsi_sa.c | 2 +- sys/dev/atm/hea/eni_receive.c | 4 +- sys/dev/misc/psm/psm.c | 2 +- sys/dev/netif/ie/if_ie.c | 6 +- sys/dev/raid/asr/asr.c | 66 +++++----- sys/dev/raid/twa/twa_globals.c | 6 +- sys/dev/serial/stl/stallion.c | 122 +++++++++--------- sys/dev/serial/stli/istallion.c | 100 +++++++------- sys/emulation/ndis/subr_ntoskrnl.c | 4 +- sys/kern/inflate.c | 26 ++-- sys/kern/subr_scanf.c | 2 +- sys/kern/uipc_domain.c | 2 +- sys/net/if.c | 18 +-- sys/net/if_clone.c | 2 +- .../bluetooth/socket/ng_btsocket_rfcomm.c | 3 +- sys/netinet/if_atm.c | 6 +- sys/netinet/in_pcb.c | 10 +- sys/netinet/ip_divert.c | 2 +- sys/netinet/ip_output.c | 6 +- sys/netinet/sctp_indata.c | 4 +- sys/netinet/sctp_input.c | 8 +- sys/netinet/sctp_output.c | 6 +- sys/netinet/sctp_pcb.c | 6 +- sys/netinet/sctp_timer.c | 2 +- sys/netinet/sctp_usrreq.c | 6 +- sys/netinet/tcp_subr.c | 2 +- sys/netinet/tcp_timer.c | 2 +- sys/netinet/tcp_usrreq.c | 2 +- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/frag6.c | 2 +- sys/netinet6/icmp6.c | 6 +- sys/netinet6/in6.c | 3 +- sys/netinet6/in6_pcb.c | 2 +- sys/netinet6/ip6_output.c | 2 +- sys/netinet6/nd6_rtr.c | 4 +- sys/netinet6/sctp6_usrreq.c | 2 +- sys/netproto/atm/atm_if.c | 6 +- sys/netproto/atm/queue.h | 14 +- sys/netproto/atm/uni/unisig_if.c | 3 +- sys/netproto/atm/uni/unisig_vc_state.c | 3 +- sys/netproto/ipsec/key.c | 4 +- sys/netproto/ipsec/xform_esp.c | 2 +- sys/netproto/ipx/ipx.c | 3 +- sys/netproto/ipx/ipx_ip.c | 2 +- sys/netproto/ipx/ipx_pcb.c | 2 +- sys/netproto/ipx/ipx_usrreq.c | 4 +- sys/netproto/ipx/spx_usrreq.c | 26 ++-- sys/netproto/key/key.c | 4 +- sys/netproto/natm/natm.c | 10 +- sys/netproto/ncp/ncp_sock.c | 2 +- sys/netproto/ns/ns.c | 8 +- sys/netproto/smb/smb_trantcp.c | 2 +- sys/sys/socket.h | 4 +- sys/vfs/ntfs/ntfs_subr.c | 2 +- usr.bin/apply/apply.c | 2 +- usr.bin/at/at.c | 2 +- usr.bin/bc/bc.y | 2 +- usr.bin/calendar/io.c | 4 +- usr.bin/chat/chat.c | 10 +- usr.bin/chpass/chpass.c | 4 +- usr.bin/chpass/util.c | 4 +- usr.bin/col/col.c | 8 +- usr.bin/column/column.c | 12 +- usr.bin/find/getdate.y | 2 +- usr.bin/gcore/elfcore.c | 4 +- usr.bin/getconf/getconf.c | 4 +- usr.bin/hexdump/display.c | 6 +- usr.bin/ldd/ldd.c | 2 +- usr.bin/lock/lock.c | 4 +- usr.bin/m4/gnum4.c | 2 +- usr.bin/mail/aux.c | 2 +- usr.bin/mail/cmd2.c | 2 +- usr.bin/mail/collect.c | 2 +- usr.bin/msgs/msgs.c | 2 +- usr.bin/newgrp/newgrp.c | 2 +- usr.bin/newkey/newkey.c | 6 +- usr.bin/rdist/rshrcmd.c | 4 +- usr.bin/rpcgen/rpc_main.c | 2 +- usr.bin/rpcgen/rpc_sample.c | 15 +-- usr.bin/rpcgen/rpc_svcout.c | 8 +- usr.bin/symorder/symorder.c | 2 +- usr.bin/time/time.c | 6 +- usr.bin/tr/tr.c | 2 +- usr.bin/whereis/whereis.c | 3 +- usr.bin/write/write.c | 2 +- usr.bin/xinstall/xinstall.c | 2 +- usr.sbin/IPXrouted/main.c | 3 +- usr.sbin/apmd/apmd.c | 2 +- usr.sbin/config/main.c | 2 +- usr.sbin/cron/cron/cron.h | 1 - usr.sbin/cron/cron/job.c | 2 +- usr.sbin/cron/lib/entry.c | 8 +- usr.sbin/i4b/isdnd/log.c | 2 +- usr.sbin/i4b/isdnd/main.c | 6 +- usr.sbin/i4b/isdnd/process.c | 2 +- usr.sbin/i4b/isdndecode/main.c | 10 +- usr.sbin/i4b/isdntrace/trace.c | 10 +- usr.sbin/inetd/builtins.c | 2 +- usr.sbin/inetd/inetd.c | 4 +- usr.sbin/keyserv/keyserv.c | 2 +- usr.sbin/keyserv/setkey.c | 2 +- usr.sbin/lpr/lpc/cmds.c | 4 +- usr.sbin/mrouted/kern.c | 4 +- usr.sbin/ngctl/main.c | 2 +- usr.sbin/ppp/command.c | 2 +- usr.sbin/pppd/auth.c | 4 +- usr.sbin/pppd/main.c | 6 +- usr.sbin/pwd_mkdb/pwd_mkdb.c | 2 +- usr.sbin/resident/resident.c | 2 +- usr.sbin/route6d/route6d.c | 4 +- usr.sbin/rpc.lockd/lockd.c | 2 +- usr.sbin/rpc.umntall/mounttab.c | 2 +- usr.sbin/rpc.yppasswdd/yppasswdd_main.c | 2 +- usr.sbin/rpc.ypupdated/ypupdated_main.c | 2 +- usr.sbin/rpc.ypxfrd/ypxfrd_main.c | 4 +- usr.sbin/rpcbind/rpcb_svc_com.c | 2 +- usr.sbin/rpcbind/rpcbind.c | 4 +- usr.sbin/rtsold/rtsold.c | 2 +- usr.sbin/stallion/stlload/stlload.c | 6 +- usr.sbin/syslogd/syslogd.c | 16 +-- usr.sbin/timed/timed/slave.c | 3 +- usr.sbin/usbd/usbd.c | 2 +- usr.sbin/vipw/vipw.c | 4 +- usr.sbin/ypbind/yp_ping.c | 2 +- usr.sbin/ypbind/ypbind.c | 2 +- usr.sbin/ypserv/yp_main.c | 2 +- usr.sbin/zic/ialloc.c | 2 +- 224 files changed, 664 insertions(+), 684 deletions(-) diff --git a/bin/date/date.c b/bin/date/date.c index 36ff3e97ce..5c04e73f09 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -133,7 +133,7 @@ main(int argc, char **argv) * If -d or -t, set the timezone or daylight savings time; this * doesn't belong here; the kernel should not know about either. */ - if (set_timezone && settimeofday((struct timeval *)NULL, &tz)) + if (set_timezone && settimeofday(NULL, &tz)) err(1, "settimeofday (timezone)"); if (!rflag && time(&tval) == -1) @@ -273,7 +273,7 @@ setthetime(const char *fmt, const char *p, int jflag, int nflag) logwtmp("|", "date", ""); tv.tv_sec = tval; tv.tv_usec = 0; - if (settimeofday(&tv, (struct timezone *)NULL)) + if (settimeofday(&tv, NULL)) err(1, "settimeofday (timeval)"); logwtmp("{", "date", ""); } diff --git a/bin/dd/dd.c b/bin/dd/dd.c index efb29ea765..50ca08c634 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -189,7 +189,7 @@ setup(void) ctab = casetab; } - gettimeofday(&tv, (struct timezone *)NULL); + gettimeofday(&tv, NULL); st.start = tv.tv_sec + tv.tv_usec * 1e-6; } diff --git a/bin/dd/misc.c b/bin/dd/misc.c index ad94bdc1a0..34c8728f65 100644 --- a/bin/dd/misc.c +++ b/bin/dd/misc.c @@ -54,7 +54,7 @@ summary(void) double secs; char buf[100]; - gettimeofday(&tv, (struct timezone *)NULL); + gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) secs = 1e-6; diff --git a/bin/expr/expr.y b/bin/expr/expr.y index 4807d9d479..99b1851424 100644 --- a/bin/expr/expr.y +++ b/bin/expr/expr.y @@ -171,7 +171,7 @@ to_integer(struct val *vp) /* vp->type == numeric_string, make it numeric */ errno = 0; - i = strtoll(vp->u.s, (char**)NULL, 10); + i = strtoll(vp->u.s, NULL, 10); if (errno != 0) { errx (2, "overflow"); } diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 57dc6cd483..de898e862d 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -355,7 +355,7 @@ copy(const char *from, const char *to) if ((pid = fork()) == 0) { execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to, - (char *)NULL); + NULL); warn("%s", _PATH_CP); _exit(1); } @@ -373,7 +373,7 @@ copy(const char *from, const char *to) return (1); } if (!(pid = vfork())) { - execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL); + execl(_PATH_RM, "mv", "-rf", "--", from, NULL); warn("%s", _PATH_RM); _exit(1); } diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index 7b0b9d8123..c14a738b7c 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1272,8 +1272,7 @@ ar_start_gzip(int fd, const char *gzip_program, int wr) } close(fds[0]); close(fds[1]); - if (execlp(gzip_program, gzip_program, gzip_flags, - (char *)NULL) < 0) + if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0) err(1, "could not exec"); /* NOTREACHED */ } diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 2a93a86a13..9943becf5d 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -158,7 +158,7 @@ ls_tty(ARCHD *arcn) if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - if ((arcn->sb.st_mtime + SIXMONTHS) <= time((time_t *)NULL)) + if ((arcn->sb.st_mtime + SIXMONTHS) <= time(NULL)) timefrmt = d_first ? OLDFRMTD : OLDFRMTM; else timefrmt = d_first ? CURFRMTD : CURFRMTM; diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 337b00e57e..82e3e63322 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -563,7 +563,7 @@ saveuser(KINFO *ki) ki->ki_args = NULL; } if (needenv) { - ki->ki_env = getfmt(kvm_getenvv, ki, (char *)NULL, 0); + ki->ki_env = getfmt(kvm_getenvv, ki, NULL, 0); } else { ki->ki_env = NULL; } diff --git a/bin/rcp/util.c b/bin/rcp/util.c index 61d3d57d54..231c12bf58 100644 --- a/bin/rcp/util.c +++ b/bin/rcp/util.c @@ -114,7 +114,7 @@ susystem(char *s, int userid) case 0: setuid(userid); - execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL); + execl(_PATH_BSHELL, "sh", "-c", s, NULL); _exit(127); } istat = signal(SIGINT, SIG_IGN); diff --git a/bin/sh/eval.c b/bin/sh/eval.c index ae6a391789..5759aa3472 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -266,7 +266,7 @@ evaltree(union node *n, int flags) do_etest = !(flags & EV_TESTED); break; case NCMD: - evalcommand(n, flags, (struct backcmd *)NULL); + evalcommand(n, flags, NULL); do_etest = !(flags & EV_TESTED); break; default: @@ -406,7 +406,7 @@ evalsubshell(union node *n, int flags) } if (! backgnd) { INTOFF; - exitstatus = waitforjob(jp, (int *)NULL); + exitstatus = waitforjob(jp, NULL); INTON; } } @@ -505,7 +505,7 @@ evalpipe(union node *n) INTON; if (n->npipe.backgnd == 0) { INTOFF; - exitstatus = waitforjob(jp, (int *)NULL); + exitstatus = waitforjob(jp, NULL); TRACE(("evalpipe: job done exit status %d\n", exitstatus)); INTON; } diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 8172c27d7f..a397528349 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -133,7 +133,7 @@ void expandhere(union node *arg, int fd) { herefd = fd; - expandarg(arg, (struct arglist *)NULL, 0); + expandarg(arg, NULL, 0); xwrite(fd, stackblock(), expdest - stackblock()); } @@ -473,7 +473,7 @@ expbackq(union node *cmd, int quoted, int flag) if (in.buf) ckfree(in.buf); if (in.jp) - exitstatus = waitforjob(in.jp, (int *)NULL); + exitstatus = waitforjob(in.jp, NULL); if (quoted == 0) recordregion(startloc, dest - stackblock(), 0); TRACE(("evalbackq: size=%d: \"%.*s\"\n", @@ -520,7 +520,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, case VSQUESTION: if (*p != CTLENDVAR) { outfmt(&errout, "%s\n", startp); - error((char *)NULL); + error(NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), str, (varflags & VSNUL) ? "null or " diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index bbd7e72b9a..939ece5089 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -210,7 +210,7 @@ fgcmd(int argc __unused, char **argv) restartjob(jp); jp->foreground = 1; INTOFF; - status = waitforjob(jp, (int *)NULL); + status = waitforjob(jp, NULL); INTON; return status; } @@ -400,7 +400,7 @@ showjobs(int change, int mode) struct job *jp; TRACE(("showjobs(%d) called\n", change)); - while (dowait(0, (struct job *)NULL) > 0); + while (dowait(0, NULL) > 0); for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) { if (! jp->used) continue; @@ -491,7 +491,7 @@ waitcmd(int argc, char **argv) break; } } - } while (dowait(1, (struct job *)NULL) != -1); + } while (dowait(1, NULL) != -1); in_waitcmd--; return 0; @@ -1031,7 +1031,7 @@ waitproc(int block, int *status) #endif if (block == 0) flags |= WNOHANG; - return wait3(status, flags, (struct rusage *)NULL); + return wait3(status, flags, NULL); } /* diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 22a25d1829..6648bf2393 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -848,7 +848,7 @@ xxreadtoken(void) } } breakloop: - return readtoken1(c, BASESYNTAX, (char *)NULL, 0); + return readtoken1(c, BASESYNTAX, NULL, 0); #undef RETURN } @@ -1525,7 +1525,7 @@ synerror(const char *msg) if (commandname) outfmt(&errout, "%s: %d: ", commandname, startlinno); outfmt(&errout, "Syntax error: %s\n", msg); - error((char *)NULL); + error(NULL); } STATIC void diff --git a/bin/sh/redir.c b/bin/sh/redir.c index fff61adeb0..e2a403b1fe 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -248,7 +248,7 @@ openhere(union node *redir) goto out; } } - if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { + if (forkshell(NULL, NULL, FORK_NOJOB) == 0) { close(pip[0]); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index e78886f0dc..fcf51c54a7 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -113,7 +113,7 @@ main(int argc, char **argv) } if (!neg && (time_to_sleep.tv_sec > 0 || time_to_sleep.tv_nsec > 0)) - nanosleep(&time_to_sleep, (struct timespec *)NULL); + nanosleep(&time_to_sleep, NULL); exit(0); } diff --git a/games/atc/input.c b/games/atc/input.c index e8a6f96119..74fd13cebf 100644 --- a/games/atc/input.c +++ b/games/atc/input.c @@ -364,10 +364,10 @@ gettoken(void) base = shell; else base++; - execl(shell, base, (char *) NULL); + execl(shell, base, NULL); } else - execl(_PATH_BSHELL, "sh", (char *) NULL); + execl(_PATH_BSHELL, "sh", NULL); exit(0); /* oops */ } diff --git a/games/bs/bs.c b/games/bs/bs.c index 7d10c038a2..f4c3a6f388 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -400,7 +400,7 @@ initgame(void) placeship(COMPUTER, ss, FALSE); } - ss = (ship_t *)NULL; + ss = NULL; do { char c, docked[SHIPTYPES + 2], *cp = docked; @@ -446,7 +446,7 @@ initgame(void) prompt(1, "Random-placing your %s", ss->name); randomplace(PLAYER, ss); placeship(PLAYER, ss, TRUE); - error((char *)NULL); + error(NULL); ss->placed = TRUE; } else if (c == 'R') @@ -459,7 +459,7 @@ initgame(void) placeship(PLAYER, ss, TRUE); ss->placed = TRUE; } - error((char *)NULL); + error(NULL); } else if (strchr("hjkl8462", c)) { @@ -477,7 +477,7 @@ initgame(void) if (checkplace(PLAYER, ss, TRUE)) { placeship(PLAYER, ss, TRUE); - error((char *)NULL); + error(NULL); ss->placed = TRUE; } } @@ -699,12 +699,12 @@ hitship(int x, int y) getyx(stdscr, oldy, oldx); sb = (turn) ? plyship : cpuship; if(!(sym = board[OTHER][x][y])) - return((ship_t *)NULL); + return(NULL); for(ss = sb; ss < sb + SHIPTYPES; ++ss) if(ss->symbol == sym) { if (++ss->hits < ss->length) { /* still afloat? */ - return((ship_t *)NULL); + return(NULL); } else { /* sunk */ int i, j; @@ -755,7 +755,7 @@ hitship(int x, int y) } } move(oldy, oldx); - return((ship_t *)NULL); + return(NULL); } static int diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index bb40f3f3e6..39fe1b5842 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -70,7 +70,7 @@ instructions(void) if ((pager = rindex(path, '/')) != NULL) ++pager; pager = path; - execlp(path, pager, _PATH_INSTR, (char *) NULL); + execlp(path, pager, _PATH_INSTR, NULL); fprintf(stderr, "cribbage: %s.\n", strerror(errno)); _exit(1); default: diff --git a/games/hunt/hunt/hunt.c b/games/hunt/hunt/hunt.c index 71a343145a..54417d2325 100644 --- a/games/hunt/hunt/hunt.c +++ b/games/hunt/hunt/hunt.c @@ -258,7 +258,7 @@ main(int ac, char **av) if ((enter_status = quit(enter_status)) == Q_QUIT) break; } - leave(0, (char *) NULL); + leave(0, NULL); /* NOTREACHED */ return(0); } @@ -436,7 +436,7 @@ bad_ver(void) static void sigterm(int signo __unused) { - leave(0, (char *) NULL); + leave(0, NULL); } /* @@ -480,7 +480,7 @@ intr(int dummy __unused) (void) write(Socket, "q", 1); (void) close(Socket); } - leave(0, (char *) NULL); + leave(0, NULL); } else if (ch == 'n') { (void) signal(SIGINT, intr); diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c index f21940b17b..e1a9bc6a4e 100644 --- a/games/hunt/huntd/driver.c +++ b/games/hunt/huntd/driver.c @@ -1,31 +1,31 @@ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are * met: - * - * + Redistributions of source code must retain the above copyright + * + * + Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * + Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + Neither the name of the University of California, San Francisco nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written + * + Neither the name of the University of California, San Francisco nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $OpenBSD: driver.c,v 1.17 2007/04/02 14:55:16 jmc Exp $ @@ -143,7 +143,7 @@ again: read_fds = Fds_mask; errno = 0; timerclear(&timeout); - nready = select(Num_fds, &read_fds, NULL, NULL, + nready = select(Num_fds, &read_fds, NULL, NULL, &timeout); if (nready < 0 && errno != EINTR) { logit(LOG_ERR, "select"); @@ -155,7 +155,7 @@ again: /* * Nothing was ready. We do some work now * to see if the simulation has any pending work - * to do, and decide if we need to block + * to do, and decide if we need to block * indefinitely or just timeout. */ do { @@ -173,10 +173,10 @@ again: * just block waiting for external activity */ to = NULL; - + read_fds = Fds_mask; errno = 0; - nready = select(Num_fds, &read_fds, NULL, NULL, + nready = select(Num_fds, &read_fds, NULL, NULL, to); if (nready < 0 && errno != EINTR) { logit(LOG_ERR, "select"); @@ -198,7 +198,7 @@ again: fd = sp->fd; if (FD_ISSET(fd, &Have_inp) && answer_next(sp)) { /* - * Remove from the spawn list. (fd remains in + * Remove from the spawn list. (fd remains in * read set). */ *sp->prevnext = sp->next; @@ -213,7 +213,7 @@ again: if (first && should_announce) announce_game(); first = FALSE; - } + } sp = spnext; } @@ -442,7 +442,7 @@ init(void) Server_socket = socket(AF_INET, SOCK_DGRAM, 0); /* Permit multiple huntd's on the same port. */ - if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true, + if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true, sizeof true) < 0) logit(LOG_ERR, "setsockopt SO_REUSEADDR"); @@ -601,7 +601,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage, } /* Set the death message: */ - (void) snprintf(victim->p_death, sizeof victim->p_death, + (void) snprintf(victim->p_death, sizeof victim->p_death, "| %s by %s |", cp, blame); /* No further score crediting needed. */ @@ -609,14 +609,14 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage, } /* Set the death message: */ - (void) snprintf(victim->p_death, sizeof victim->p_death, + (void) snprintf(victim->p_death, sizeof victim->p_death, "| %s by %s |", cp, credit->i_name); if (victim == attacker) { /* No use killing yourself. */ credit->i_kills--; credit->i_bkills++; - } + } else if (victim->p_ident->i_team == ' ' || victim->p_ident->i_team != credit->i_team) { /* A cross-team kill: */ @@ -647,7 +647,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage, attacker->p_damage = 0; /* Tell the attacker his new strength: */ - outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d", + outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d", attacker->p_damage, attacker->p_damcap); /* Tell the attacker his new 'kill count': */ @@ -758,12 +758,12 @@ zap(PLAYER *pp, FLAG was_player) char buf[BUFSIZ]; /* Detonate: */ - (void) add_shot(expl_type, pp->p_y, pp->p_x, - pp->p_face, expl_charge, (PLAYER *) NULL, + (void) add_shot(expl_type, pp->p_y, pp->p_x, + pp->p_face, expl_charge, NULL, TRUE, SPACE); /* Explain what the explosion is about. */ - snprintf(buf, sizeof buf, "%s detonated.", + snprintf(buf, sizeof buf, "%s detonated.", pp->p_ident->i_name); message(ALL_PLAYERS, buf); @@ -804,7 +804,7 @@ zap(PLAYER *pp, FLAG was_player) volcano += pp->p_ammo - expl_charge; /* Volcano eruption: */ - if (conf_volcano && rand_num(100) < volcano / + if (conf_volcano && rand_num(100) < volcano / conf_volcano_max) { /* Erupt near the middle of the map */ do { @@ -814,7 +814,7 @@ zap(PLAYER *pp, FLAG was_player) /* Convert volcano charge into lava: */ (void) add_shot(LAVA, y, x, LEFTS, volcano, - (PLAYER *) NULL, TRUE, SPACE); + NULL, TRUE, SPACE); volcano = 0; /* Tell eveyone what's happening */ @@ -833,7 +833,7 @@ zap(PLAYER *pp, FLAG was_player) add_shot(DSHOT, y, x, rand_dir(), shot_req[conf_mindshot + rand_num(MAXBOMB - conf_mindshot)], - (PLAYER *) NULL, FALSE, SPACE); + NULL, FALSE, SPACE); } /* Tell the zapped player's client to shut down. */ @@ -845,8 +845,8 @@ zap(PLAYER *pp, FLAG was_player) if (pp != End_player) { /* Move the last player into the gap: */ memcpy(pp, End_player, sizeof *pp); - outyx(ALL_PLAYERS, - STAT_PLAY_ROW + 1 + (pp - Player), + outyx(ALL_PLAYERS, + STAT_PLAY_ROW + 1 + (pp - Player), STAT_NAME_COL, "%5.2f%c%-10.10s %c", pp->p_ident->i_score, stat_char(pp), @@ -868,7 +868,7 @@ zap(PLAYER *pp, FLAG was_player) End_monitor--; if (pp != End_monitor) { memcpy(pp, End_monitor, sizeof *pp); - outyx(ALL_PLAYERS, + outyx(ALL_PLAYERS, STAT_MON_ROW + 1 + (pp - Player), STAT_NAME_COL, "%5.5s %-10.10s %c", " ", pp->p_ident->i_name, pp->p_ident->i_team); diff --git a/games/hunt/huntd/execute.c b/games/hunt/huntd/execute.c index b9e338ab1f..dcc413114e 100644 --- a/games/hunt/huntd/execute.c +++ b/games/hunt/huntd/execute.c @@ -614,8 +614,7 @@ pickup(PLAYER *pp, int y, int x, int prob, int obj) /* Does it explode? */ if (rand_num(100) < prob) /* Ooooh, unlucky: (Boom) */ - add_shot(obj, y, x, LEFTS, req, (PLAYER *) NULL, - TRUE, pp->p_face); + add_shot(obj, y, x, LEFTS, req, NULL, TRUE, pp->p_face); else { /* Safely picked it up. Add to player's ammo: */ pp->p_ammo += req; diff --git a/games/hunt/huntd/shots.c b/games/hunt/huntd/shots.c index 32eeb571a0..7e5b45fcb5 100644 --- a/games/hunt/huntd/shots.c +++ b/games/hunt/huntd/shots.c @@ -724,7 +724,7 @@ again: /* Land: */ if (pp->p_face != BOOT && pp->p_face != BOOT_PAIR) { /* Land a player - they stustain a fall: */ - checkdam(pp, (PLAYER *) NULL, (IDENT *) NULL, + checkdam(pp, NULL, NULL, rand_num(pp->p_damage / conf_fall_frac), FALL); pp->p_face = rand_dir(); showstat(pp); @@ -826,7 +826,7 @@ chkshot(BULLET *bp, BULLET *next) y, x, LEFTS, (Maze[y][x] == GMINE) ? GRENREQ : BULREQ, - (PLAYER *) NULL, TRUE, SPACE); + NULL, TRUE, SPACE); Maze[y][x] = SPACE; break; } diff --git a/games/larn/tok.c b/games/larn/tok.c index 5c85f4a332..d86098111e 100644 --- a/games/larn/tok.c +++ b/games/larn/tok.c @@ -77,7 +77,7 @@ yylex(void) { /* revoke */ setgid(getgid()); - execl("/bin/csh", "csh", (char *) NULL); exit(1); + execl("/bin/csh", "csh", NULL); exit(1); } wait(0); if (ic<0) /* error */ diff --git a/games/mille/mille.c b/games/mille/mille.c index 9efcb11b88..ff0670b42b 100644 --- a/games/mille/mille.c +++ b/games/mille/mille.c @@ -61,7 +61,7 @@ main(int ac, char *av[]) if (strcmp(av[0], "a.out") == 0) { outf = fopen("q", "w"); - setbuf(outf, (char *)NULL); + setbuf(outf, NULL); Debug = TRUE; } restore = FALSE; diff --git a/games/mille/move.c b/games/mille/move.c index 994a981b0e..4809e96353 100644 --- a/games/mille/move.c +++ b/games/mille/move.c @@ -464,7 +464,7 @@ getmove(void) leaveok(Board, TRUE); if ((outf = fopen(buf, "w")) == NULL) perror(buf); - setbuf(outf, (char *)NULL); + setbuf(outf, NULL); } Debug = !Debug; break; diff --git a/games/mille/varpush.c b/games/mille/varpush.c index 24a1f7e73b..25683e91a5 100644 --- a/games/mille/varpush.c +++ b/games/mille/varpush.c @@ -90,7 +90,7 @@ over: goto over; } if (strcmp(buf, _PATH_DEVNULL) != 0) - setbuf(outf, (char *)NULL); + setbuf(outf, NULL); } #endif } diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index ccfe9267c6..ef85e48aaf 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -996,8 +996,7 @@ static const char *deathmesg[] = if (ch == 'Y') { cleanup(FALSE); - execl(_PATH_GAMEPROG, "phantasia", "-s", - (Wizard ? "-S": (char *) NULL), (char *) NULL); + execl(_PATH_GAMEPROG, "phantasia", "-s", (Wizard ? "-S": NULL), NULL); exit(0); /*NOTREACHED*/ } diff --git a/games/rain/rain.c b/games/rain/rain.c index 33694dc820..b22b599ad8 100644 --- a/games/rain/rain.c +++ b/games/rain/rain.c @@ -65,7 +65,7 @@ main(int argc, char **argv) while ((ch = getopt(argc, argv, "d:h")) != -1) switch (ch) { case 'd': - if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1 + if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1 || delay > 1000) errx(1, "invalid delay (1-1000)"); delay *= 1000; /* ms -> us */ diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c index cc9d0da59c..ae9e39a60a 100644 --- a/games/rogue/machdep.c +++ b/games/rogue/machdep.c @@ -389,7 +389,7 @@ md_gln(void) if ((s = getlogin())) return s; if (!(p = getpwuid(getuid()))) - return((char *)NULL); + return(NULL); return(p->pw_name); } @@ -541,7 +541,7 @@ md_shell(const char *shell) if (!fork()) { /* revoke */ setgid(getgid()); - execl(shell, shell, (char *) NULL); + execl(shell, shell, NULL); } wait((int *)w); } diff --git a/games/worms/worms.c b/games/worms/worms.c index 4f5815427b..934e861c6f 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -194,7 +194,7 @@ main(int argc, char **argv) while ((ch = getopt(argc, argv, "d:fl:n:t")) != -1) switch(ch) { case 'd': - if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1 || delay > 1000) + if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1 || delay > 1000) errx(1, "invalid delay (1-1000)"); delay *= 1000; /* ms -> us */ break; diff --git a/games/wump/wump.c b/games/wump/wump.c index 6285697a00..70d9dd6101 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -747,7 +747,7 @@ puff of greasy black smoke! (poof)\n"); err(1, "open %s", _PATH_WUMPINFO); if (dup2(fd, 0) == -1) err(1, "dup2"); - (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL); + (void)execl("/bin/sh", "sh", "-c", pager, NULL); err(1, "exec sh -c %s", pager); case -1: err(1, "fork"); diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c index f42c3ca349..134e5c3198 100644 --- a/lib/libc/compat-43/getwd.c +++ b/lib/libc/compat-43/getwd.c @@ -48,5 +48,5 @@ getwd(char *buf) if ( (p = getcwd(buf, MAXPATHLEN)) ) return(p); strcpy(buf, strerror(errno)); - return((char *)NULL); + return(NULL); } diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index 6a6b85dce4..1d5f259fe8 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -843,7 +843,7 @@ open_temp(HTAB *hashp) unlink(namestr); _fcntl(hashp->fp, F_SETFD, 1); } - _sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); + _sigprocmask(SIG_SETMASK, &oset, NULL); return (hashp->fp != -1 ? 0 : -1); } diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 2ce1f5dd6b..9d7bea1b5a 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -213,7 +213,7 @@ struct fstab * getfsent(void) { if ((!_fs_fp && !setfsent()) || !fstabscan()) - return((struct fstab *)NULL); + return(NULL); return(&_fs_fstab); } @@ -224,7 +224,7 @@ getfsspec(const char *name) while (fstabscan()) if (!strcmp(_fs_fstab.fs_spec, name)) return(&_fs_fstab); - return((struct fstab *)NULL); + return(NULL); } struct fstab * @@ -234,7 +234,7 @@ getfsfile(const char *name) while (fstabscan()) if (!strcmp(_fs_fstab.fs_file, name)) return(&_fs_fstab); - return((struct fstab *)NULL); + return(NULL); } int diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index 8d098b656c..595543bcb7 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -126,7 +126,7 @@ we_askshell(const char *words, wordexp_t *we, int flags) _close(devnull); } execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", cmd, (char *)NULL); + "-c", cmd, NULL); _exit(1); } diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c index 768a4c5c1c..979891bfee 100644 --- a/lib/libc/net/gethostbynis.c +++ b/lib/libc/net/gethostbynis.c @@ -73,7 +73,7 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he, return (-1); } - if (hed->yp_domain == (char *)NULL) + if (hed->yp_domain == NULL) if (yp_get_default_domain (&hed->yp_domain)) { RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); diff --git a/lib/libc/net/getnetbynis.c b/lib/libc/net/getnetbynis.c index c6d61397a7..3e5cba70e8 100644 --- a/lib/libc/net/getnetbynis.c +++ b/lib/libc/net/getnetbynis.c @@ -67,7 +67,7 @@ _getnetbynis(const char *name, char *map, int af, struct netent *ne, return (-1); } - if (ned->yp_domain == (char *)NULL) + if (ned->yp_domain == NULL) if (yp_get_default_domain (&ned->yp_domain)) return (-1); diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index 31cd5ee371..8b4514d5b3 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -147,12 +147,11 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, else rshprog = pw->pw_shell; p = strrchr(rshprog, '/'); - execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd, - (char *)NULL); + execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd, NULL); } else { p = strrchr(rshprog, '/'); execlp(rshprog, p ? p + 1 : rshprog, *ahost, "-l", - remuser, cmd, (char *)NULL); + remuser, cmd, NULL); } fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", rshprog, strerror(errno)); diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c index 008fec1862..e30d5d0ae7 100644 --- a/lib/libc/rpc/auth_des.c +++ b/lib/libc/rpc/auth_des.c @@ -284,7 +284,7 @@ authdes_marshal(AUTH *auth, XDR *xdrs) * Figure out the "time", accounting for any time difference * with the server if necessary. */ - gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL); + gettimeofday(&ad->ad_timestamp, NULL); ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec; ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec; while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) { diff --git a/lib/libc/rpc/auth_time.c b/lib/libc/rpc/auth_time.c index 9463678a7c..6fc77e6034 100644 --- a/lib/libc/rpc/auth_time.c +++ b/lib/libc/rpc/auth_time.c @@ -404,7 +404,7 @@ __rpc_get_time_offset(struct timeval *td, /* Time difference */ FD_ZERO(&readfds); FD_SET(s, &readfds); res = _select(_rpc_dtablesize(), &readfds, - (fd_set *)NULL, (fd_set *)NULL, &timeout); + NULL, NULL, &timeout); } while (res < 0 && errno == EINTR); if (res <= 0) goto error; diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index 25e4db84a6..52a793a528 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -157,14 +157,14 @@ clnt_dg_create(int fd, /* open file descriptor */ sigfillset(&newmask); thr_sigsetmask(SIG_SETMASK, &newmask, &mask); mutex_lock(&clnt_fd_lock); - if (dg_fd_locks == (int *) NULL) { + if (dg_fd_locks == NULL) { int cv_allocsz; size_t fd_allocsz; int dtbsize = __rpc_dtbsize(); fd_allocsz = dtbsize * sizeof (int); dg_fd_locks = (int *) mem_alloc(fd_allocsz); - if (dg_fd_locks == (int *) NULL) { + if (dg_fd_locks == NULL) { mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); goto err1; @@ -173,9 +173,9 @@ clnt_dg_create(int fd, /* open file descriptor */ cv_allocsz = dtbsize * sizeof (cond_t); dg_cv = (cond_t *) mem_alloc(cv_allocsz); - if (dg_cv == (cond_t *) NULL) { + if (dg_cv == NULL) { mem_free(dg_fd_locks, fd_allocsz); - dg_fd_locks = (int *) NULL; + dg_fd_locks = NULL; mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); goto err1; diff --git a/lib/libc/rpc/clnt_generic.c b/lib/libc/rpc/clnt_generic.c index 3b8dc20aa2..d8b299625b 100644 --- a/lib/libc/rpc/clnt_generic.c +++ b/lib/libc/rpc/clnt_generic.c @@ -123,7 +123,7 @@ clnt_create_vers_timed(const char *hostname, rpcprog_t prog, to.tv_sec = 10; to.tv_usec = 0; rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, - (char *)NULL, (xdrproc_t)xdr_void, (char *)NULL, to); + NULL, (xdrproc_t)xdr_void, NULL, to); if (rpc_stat == RPC_SUCCESS) { *vers_out = vers_high; return (clnt); @@ -145,8 +145,8 @@ clnt_create_vers_timed(const char *hostname, rpcprog_t prog, } CLNT_CONTROL(clnt, CLSET_VERS, (char *)&vers_high); rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, - (char *)NULL, (xdrproc_t)xdr_void, - (char *)NULL, to); + NULL, (xdrproc_t)xdr_void, + NULL, to); if (rpc_stat == RPC_SUCCESS) { *vers_out = vers_high; return (clnt); diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index 8700343a66..9fa08f79f6 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -129,7 +129,7 @@ static cond_t *vc_cv; mutex_lock(&clnt_fd_lock); \ vc_fd_locks[fd] = 0; \ mutex_unlock(&clnt_fd_lock); \ - thr_sigsetmask(SIG_SETMASK, &(mask), (sigset_t *) NULL); \ + thr_sigsetmask(SIG_SETMASK, &(mask), NULL); \ cond_signal(&vc_cv[fd]); \ } @@ -173,7 +173,7 @@ clnt_vc_create(int fd, /* open file descriptor */ cl = (CLIENT *)mem_alloc(sizeof (*cl)); ct = (struct ct_data *)mem_alloc(sizeof (*ct)); - if ((cl == (CLIENT *)NULL) || (ct == (struct ct_data *)NULL)) { + if ((cl == NULL) || (ct == NULL)) { syslog(LOG_ERR, clnt_vc_errstr, clnt_vc_str, __no_mem_str); rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = errno; @@ -183,25 +183,25 @@ clnt_vc_create(int fd, /* open file descriptor */ sigfillset(&newmask); thr_sigsetmask(SIG_SETMASK, &newmask, &mask); mutex_lock(&clnt_fd_lock); - if (vc_fd_locks == (int *) NULL) { + if (vc_fd_locks == NULL) { int cv_allocsz, fd_allocsz; int dtbsize = __rpc_dtbsize(); fd_allocsz = dtbsize * sizeof (int); vc_fd_locks = (int *) mem_alloc(fd_allocsz); - if (vc_fd_locks == (int *) NULL) { + if (vc_fd_locks == NULL) { mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); goto err; } else memset(vc_fd_locks, '\0', fd_allocsz); - assert(vc_cv == (cond_t *) NULL); + assert(vc_cv == NULL); cv_allocsz = dtbsize * sizeof (cond_t); vc_cv = (cond_t *) mem_alloc(cv_allocsz); - if (vc_cv == (cond_t *) NULL) { + if (vc_cv == NULL) { mem_free(vc_fd_locks, fd_allocsz); - vc_fd_locks = (int *) NULL; + vc_fd_locks = NULL; mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); goto err; @@ -212,7 +212,7 @@ clnt_vc_create(int fd, /* open file descriptor */ cond_init(&vc_cv[i], 0, NULL); } } else - assert(vc_cv != (cond_t *) NULL); + assert(vc_cv != NULL); /* * XXX - fvdl connecting while holding a mutex? @@ -301,7 +301,7 @@ err: if (cl) mem_free(cl, sizeof (CLIENT)); } - return ((CLIENT *)NULL); + return (NULL); } static enum clnt_stat diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c index 96daef4585..c344b5d48a 100644 --- a/lib/libc/rpc/crypt_client.c +++ b/lib/libc/rpc/crypt_client.c @@ -64,7 +64,7 @@ _des_crypt_call(char *buf, int len, struct desparams *dparms) return(DESERR_HWERROR); } clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf); - if (clnt == (CLIENT *) NULL) { + if (clnt == NULL) { endnetconfig(localhandle); return(DESERR_HWERROR); } @@ -78,7 +78,7 @@ _des_crypt_call(char *buf, int len, struct desparams *dparms) bcopy(dparms->des_key, des_crypt_1_arg.des_key, 8); result_1 = des_crypt_1(&des_crypt_1_arg, clnt); - if (result_1 == (desresp *) NULL) { + if (result_1 == NULL) { clnt_destroy(clnt); return(DESERR_HWERROR); } diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c index bb0e61930d..9843eec8e9 100644 --- a/lib/libc/rpc/key_call.c +++ b/lib/libc/rpc/key_call.c @@ -307,10 +307,10 @@ getkeyserv_handle(int vers) } kcp = (struct key_call_private *)thr_getspecific(key_call_key); } - if (kcp == (struct key_call_private *)NULL) { + if (kcp == NULL) { kcp = (struct key_call_private *)malloc(sizeof (*kcp)); - if (kcp == (struct key_call_private *)NULL) { - return ((CLIENT *) NULL); + if (kcp == NULL) { + return (NULL); } if (main_thread) key_call_private_main = kcp; @@ -335,7 +335,7 @@ getkeyserv_handle(int vers) if (kcp->client->cl_auth == NULL) { clnt_destroy(kcp->client); kcp->client = NULL; - return ((CLIENT *) NULL); + return (NULL); } } /* Change the version number to the new one */ @@ -343,13 +343,13 @@ getkeyserv_handle(int vers) return (kcp->client); } if (!(localhandle = setnetconfig())) { - return ((CLIENT *) NULL); + return (NULL); } tpconf = NULL; if (uname(&u) == -1) { endnetconfig(localhandle); - return ((CLIENT *) NULL); + return (NULL); } while ((nconf = getnetconfig(localhandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) { @@ -367,14 +367,14 @@ getkeyserv_handle(int vers) } } } - if ((kcp->client == (CLIENT *) NULL) && (tpconf)) + if ((kcp->client == NULL) && (tpconf)) /* Now, try the CLTS or COTS loopback transport */ kcp->client = clnt_tp_create(u.nodename, KEY_PROG, vers, tpconf); endnetconfig(localhandle); - if (kcp->client == (CLIENT *) NULL) { - return ((CLIENT *) NULL); + if (kcp->client == NULL) { + return (NULL); } kcp->uid = geteuid(); kcp->pid = getpid(); @@ -382,7 +382,7 @@ getkeyserv_handle(int vers) if (kcp->client->cl_auth == NULL) { clnt_destroy(kcp->client); kcp->client = NULL; - return ((CLIENT *) NULL); + return (NULL); } wait_time.tv_sec = TOTAL_TIMEOUT/TOTAL_TRIES; diff --git a/lib/libc/rpc/netname.c b/lib/libc/rpc/netname.c index 5cef0e8cf8..686ed6318e 100644 --- a/lib/libc/rpc/netname.c +++ b/lib/libc/rpc/netname.c @@ -89,9 +89,9 @@ getnetname(char *name) uid = geteuid(); if (uid == 0) { - return (host2netname(name, (char *) NULL, (char *) NULL)); + return (host2netname(name, NULL, NULL)); } else { - return (user2netname(name, uid, (char *) NULL)); + return (user2netname(name, uid, NULL)); } } diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c index 25680359af..183afd8243 100644 --- a/lib/libc/rpc/rpc_generic.c +++ b/lib/libc/rpc/rpc_generic.c @@ -222,8 +222,8 @@ struct netconfig * __rpc_getconfip(const char *nettype) { char *netid; - char *netid_tcp = (char *) NULL; - char *netid_udp = (char *) NULL; + char *netid_tcp = NULL; + char *netid_udp = NULL; static char *netid_tcp_main; static char *netid_udp_main; struct netconfig *dummy; diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index ce049f0ebc..8d7abec0bb 100644 --- a/lib/libc/rpc/rpc_soc.c +++ b/lib/libc/rpc/rpc_soc.c @@ -457,7 +457,7 @@ svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path) SVCXPRT *xprt; int addrlen; - xprt = (SVCXPRT *)NULL; + xprt = NULL; localhandle = setnetconfig(); while ((nconf = getnetconfig(localhandle)) != NULL) { if (nconf->nc_protofmly != NULL && diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c index 3c2da02deb..198c6aeb43 100644 --- a/lib/libc/rpc/rpcb_clnt.c +++ b/lib/libc/rpc/rpcb_clnt.c @@ -179,7 +179,7 @@ check_cache(const char *host, const char *netid) return (cptr); } } - return ((struct address_cache *) NULL); + return (NULL); } static void @@ -1040,7 +1040,7 @@ rpcb_getaddr(rpcprog_t program, rpcvers_t version, if ((na = __rpcb_findaddr_timed(program, version, (struct netconfig *) nconf, (char *) host, - (CLIENT **) NULL, (struct timeval *) NULL)) == NULL) + NULL, NULL)) == NULL) return (FALSE); if (na->len > address->maxlen) { @@ -1219,7 +1219,7 @@ rpcb_gettime(const char *host, time_t *timep) break; } __rpc_endconf(handle); - if (client == (CLIENT *) NULL) { + if (client == NULL) { return (FALSE); } diff --git a/lib/libc/rpc/rtime.c b/lib/libc/rpc/rtime.c index 2a589a1e07..3bc5a7d3ac 100644 --- a/lib/libc/rpc/rtime.c +++ b/lib/libc/rpc/rtime.c @@ -105,7 +105,7 @@ rtime(struct sockaddr_in *addrp, struct timeval *timep, struct timeval *timeout) FD_ZERO(&readfds); FD_SET(s, &readfds); res = _select(_rpc_dtablesize(), &readfds, - (fd_set *)NULL, (fd_set *)NULL, timeout); + NULL, NULL, timeout); } while (res < 0 && errno == EINTR); if (res <= 0) { if (res == 0) { diff --git a/lib/libc/rpc/svc_auth_des.c b/lib/libc/rpc/svc_auth_des.c index 3ed9814332..aaf1606ee9 100644 --- a/lib/libc/rpc/svc_auth_des.c +++ b/lib/libc/rpc/svc_auth_des.c @@ -267,7 +267,7 @@ _svcauth_des(struct svc_req *rqst, struct rpc_msg *msg) debug("timestamp before last seen"); return (AUTH_REJECTEDVERF); /* replay */ } - gettimeofday(¤t, (struct timezone *)NULL); + gettimeofday(¤t, NULL); current.tv_sec -= window; /* allow for expiration */ if (!BEFORE(¤t, ×tamp)) { debug("timestamp expired"); diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index f0babe0481..b9e8a03d3f 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -73,13 +73,13 @@ mkstemp(char *path) char * mkdtemp(char *path) { - return (_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL); + return (_gettemp(path, NULL, 1, 0) ? path : NULL); } char * _mktemp(char *path) { - return (_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL); + return (_gettemp(path, NULL, 0, 0) ? path : NULL); } __warn_references(mktemp, diff --git a/lib/libc/stdio/setbuf.3 b/lib/libc/stdio/setbuf.3 index df523df3a5..3934824acb 100644 --- a/lib/libc/stdio/setbuf.3 +++ b/lib/libc/stdio/setbuf.3 @@ -159,7 +159,7 @@ The function is exactly equivalent to the call: .Pp -.Dl "setvbuf(stream, (char *)NULL, _IOLBF, 0);" +.Dl "setvbuf(stream, NULL, _IOLBF, 0);" .Sh RETURN VALUES The .Fn setvbuf diff --git a/lib/libc/stdio/setbuffer.c b/lib/libc/stdio/setbuffer.c index 1c86f45ce0..9c4bb487fc 100644 --- a/lib/libc/stdio/setbuffer.c +++ b/lib/libc/stdio/setbuffer.c @@ -54,5 +54,5 @@ int setlinebuf(FILE *fp) { - return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0)); + return (setvbuf(fp, NULL, _IOLBF, (size_t)0)); } diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 82a98f83f2..07ac0c4f72 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -736,9 +736,9 @@ literal: *p = 0; if ((flags & UNSIGNED) == 0) - res = strtoimax(buf, (char **)NULL, base); + res = strtoimax(buf, NULL, base); else - res = strtoumax(buf, (char **)NULL, base); + res = strtoumax(buf, NULL, base); if (flags & POINTER) *va_arg(ap, void **) = (void *)(uintptr_t)res; diff --git a/lib/libc/stdlib/atof.3 b/lib/libc/stdlib/atof.3 index 6d8a03a2d4..85ca6d02a2 100644 --- a/lib/libc/stdlib/atof.3 +++ b/lib/libc/stdlib/atof.3 @@ -58,7 +58,7 @@ representation. .Pp It is equivalent to: .Bd -literal -offset indent -strtod(nptr, (char **)NULL); +strtod(nptr, NULL); .Ed .Pp The decimal point diff --git a/lib/libc/stdlib/atoi.3 b/lib/libc/stdlib/atoi.3 index 3f58a43848..c1f6543194 100644 --- a/lib/libc/stdlib/atoi.3 +++ b/lib/libc/stdlib/atoi.3 @@ -58,7 +58,7 @@ representation. .Pp It is equivalent to: .Bd -literal -offset indent -(int)strtol(nptr, (char **)NULL, 10); +(int)strtol(nptr, NULL, 10); .Ed .Pp The diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c index ed243c3fb1..746d92a518 100644 --- a/lib/libc/stdlib/atoi.c +++ b/lib/libc/stdlib/atoi.c @@ -36,5 +36,5 @@ int atoi(const char *str) { - return((int)strtol(str, (char **)NULL, 10)); + return((int)strtol(str, NULL, 10)); } diff --git a/lib/libc/stdlib/atol.3 b/lib/libc/stdlib/atol.3 index 76c1f29e2c..cb832da109 100644 --- a/lib/libc/stdlib/atol.3 +++ b/lib/libc/stdlib/atol.3 @@ -66,7 +66,7 @@ representation. .Pp It is equivalent to: .Pp -.Dl "strtol(nptr, (char **)NULL, 10);" +.Dl "strtol(nptr, NULL, 10);" .Pp The .Fn atoll @@ -79,7 +79,7 @@ representation. .Pp It is equivalent to: .Pp -.Dl "strtoll(nptr, (char **)NULL, 10);" +.Dl "strtoll(nptr, NULL, 10);" .Sh ERRORS The functions .Fn atol diff --git a/lib/libc/stdlib/atol.c b/lib/libc/stdlib/atol.c index b0ca8132ca..2d4bf743ee 100644 --- a/lib/libc/stdlib/atol.c +++ b/lib/libc/stdlib/atol.c @@ -36,5 +36,5 @@ long atol(const char *str) { - return(strtol(str, (char **)NULL, 10)); + return(strtol(str, NULL, 10)); } diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c index 1ef4fb18d7..43fd35b0e1 100644 --- a/lib/libc/stdlib/system.c +++ b/lib/libc/stdlib/system.c @@ -76,7 +76,7 @@ __system(const char *command) _sigaction(SIGINT, &intact, NULL); _sigaction(SIGQUIT, &quitact, NULL); _sigprocmask(SIG_SETMASK, &oldsigblock, NULL); - execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); + execl(_PATH_BSHELL, "sh", "-c", command, NULL); _exit(127); default: /* parent */ savedpid = pid; diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index c12a17d070..88cfa5428d 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1130,7 +1130,7 @@ tzsetwall_basic(int rdlocked) _RWLOCK_WRLOCK(&lcl_rwlock); lcl_is_set = -1; - if (tzload((char *) NULL, lclptr, TRUE) != 0) + if (tzload(NULL, lclptr, TRUE) != 0) gmtload(lclptr); settzname(); _RWLOCK_UNLOCK(&lcl_rwlock); diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c index 25d1cb05ec..7b6bcea470 100644 --- a/lib/libc_r/uthread/uthread_init.c +++ b/lib/libc_r/uthread/uthread_init.c @@ -150,7 +150,7 @@ _thread_init(void) PANIC("Can't open console"); if (setlogin("root") == -1) PANIC("Can't set login to root"); - if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) + if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1) PANIC("Can't set controlling terminal"); if (__sys_dup2(fd, 0) == -1 || __sys_dup2(fd, 1) == -1 || diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c index dd6576e89d..ea7d1238a1 100644 --- a/lib/libedit/filecomplete.c +++ b/lib/libedit/filecomplete.c @@ -326,7 +326,7 @@ completion_matches(const char *text, char *(*genfunc)(const char *, int)) match_list[0] = retstr; /* add NULL as last pointer to the array */ - match_list[matches + 1] = (char *) NULL; + match_list[matches + 1] = NULL; return (match_list); } diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c index 501b6de1b5..da6250624b 100644 --- a/lib/libedit/readline.c +++ b/lib/libedit/readline.c @@ -190,7 +190,7 @@ _move_history(int op) static HIST_ENTRY rl_he; if (history(h, &ev, op) != 0) - return (HIST_ENTRY *) NULL; + return NULL; rl_he.line = ev.str; rl_he.data = NULL; diff --git a/lib/libposix1e/acl_to_text.3 b/lib/libposix1e/acl_to_text.3 index 006ef58dad..03a311fccd 100644 --- a/lib/libposix1e/acl_to_text.3 +++ b/lib/libposix1e/acl_to_text.3 @@ -67,7 +67,7 @@ development at this time. .Sh RETURN VALUES Upon successful completion, the function shall return a pointer to the long text form of an ACL. Otherwise, a value of -.Va (char*)NULL +.Va NULL shall be returned and .Va errno shall be set to indicate the error. diff --git a/lib/librpcsvc/rnusers.c b/lib/librpcsvc/rnusers.c index ab24d45496..ad1114b08e 100644 --- a/lib/librpcsvc/rnusers.c +++ b/lib/librpcsvc/rnusers.c @@ -47,7 +47,7 @@ int rusers(char *host, utmpidlearr *up) { return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES, - (xdrproc_t)xdr_void, (char *) NULL, + (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_utmpidlearr, (char *) up)); } @@ -57,7 +57,7 @@ rnusers(char *host) int nusers; if (callrpc(host, RUSERSPROG, RUSERSVERS_ORIG, RUSERSPROC_NUM, - (xdrproc_t)xdr_void, (char *) NULL, + (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_u_long, (char *) &nusers) != 0) return (-1); else diff --git a/lib/librpcsvc/rwall.c b/lib/librpcsvc/rwall.c index 9a6517f4bf..1e3fd27928 100644 --- a/lib/librpcsvc/rwall.c +++ b/lib/librpcsvc/rwall.c @@ -47,5 +47,5 @@ rwall(char *host, char *msg) { return (callrpc(host, WALLPROG, WALLVERS, WALLPROC_WALL, (xdrproc_t)xdr_wrapstring, (char *) &msg, - (xdrproc_t)xdr_void, (char *) NULL)); + (xdrproc_t)xdr_void, NULL)); } diff --git a/lib/libthread_xu/thread/thr_init.c b/lib/libthread_xu/thread/thr_init.c index 42723e608f..902ea0cf86 100644 --- a/lib/libthread_xu/thread/thr_init.c +++ b/lib/libthread_xu/thread/thr_init.c @@ -201,7 +201,7 @@ _libpthread_init(struct pthread *curthread) PANIC("Can't open console"); if (setlogin("root") == -1) PANIC("Can't set login to root"); - if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) + if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1) PANIC("Can't set controlling terminal"); } diff --git a/lib/libutil/login_tty.c b/lib/libutil/login_tty.c index 048aea62d4..262619466c 100644 --- a/lib/libutil/login_tty.c +++ b/lib/libutil/login_tty.c @@ -43,7 +43,7 @@ int login_tty(int fd) { (void) setsid(); - if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1) + if (ioctl(fd, TIOCSCTTY, NULL) == -1) return (-1); (void) dup2(fd, 0); (void) dup2(fd, 1); diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c index 532e7991b8..bd3d396476 100644 --- a/lib/libutil/pw_util.c +++ b/lib/libutil/pw_util.c @@ -258,11 +258,11 @@ pw_mkdb(const char *user) /* child */ if (user == NULL) execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", - "-d", passwd_dir, tempname, (char *)NULL); + "-d", passwd_dir, tempname, NULL); else execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", passwd_dir, "-u", user, tempname, - (char *)NULL); + NULL); _exit(1); /* NOTREACHED */ default: @@ -314,7 +314,7 @@ pw_edit(int notsetuid) setuid(getuid()); } errno = 0; - execlp(editor, basename(editor), tempname, (char *)NULL); + execlp(editor, basename(editor), tempname, NULL); _exit(errno); default: /* parent */ diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c index 5df204c6d7..43904551ee 100644 --- a/lib/libutil/uucplock.c +++ b/lib/libutil/uucplock.c @@ -216,7 +216,7 @@ get_pid(int fd, int *err) bytes_read = read (fd, buf, sizeof (buf) - 1); if (bytes_read > 0) { buf[bytes_read] = '\0'; - pid = strtol (buf, (char **) NULL, 10); + pid = strtol (buf, NULL, 10); } else { pid = -1; *err = bytes_read ? errno : EINVAL; diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c index b1d631b986..92299501d9 100644 --- a/libexec/atrun/atrun.c +++ b/libexec/atrun/atrun.c @@ -332,7 +332,7 @@ run_file(const char *filename, uid_t uid, gid_t gid) if (chdir(pentry->pw_dir)) chdir("/"); - if(execle("/bin/sh","sh",(char *) NULL, nenvp) != 0) + if(execle("/bin/sh","sh",NULL, nenvp) != 0) perr("exec failed for /bin/sh"); PRIV_END @@ -341,7 +341,7 @@ run_file(const char *filename, uid_t uid, gid_t gid) */ close(fd_in); close(fd_out); - waitpid(pid, (int *) NULL, 0); + waitpid(pid, NULL, 0); /* Send mail. Unlink the output file first, so it is deleted after * the run. @@ -380,7 +380,7 @@ run_file(const char *filename, uid_t uid, gid_t gid) execl(_PATH_SENDMAIL, "sendmail", "-F", "Atrun Service", "-odi", "-oem", - mailname, (char *) NULL); + mailname, NULL); perr("exec failed for mail command"); PRIV_END diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 3b0356e048..7f0fd4fe3e 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -236,13 +236,13 @@ main(int argc, char **argv) if (!opentty(ttyn, O_RDWR|O_NONBLOCK)) exit(1); - setdefttymode(tname); - rfds = 1 << 0; /* FD_SET */ - timeout.tv_sec = RT; - timeout.tv_usec = 0; - i = select(32, (fd_set*)&rfds, (fd_set*)NULL, - (fd_set*)NULL, RT ? &timeout : NULL); - if (i < 0) { + setdefttymode(tname); + rfds = 1 << 0; /* FD_SET */ + timeout.tv_sec = RT; + timeout.tv_usec = 0; + i = select(32, (fd_set*)&rfds, NULL, + NULL, RT ? &timeout : NULL); + if (i < 0) { syslog(LOG_ERR, "select %s: %m", ttyn); } else if (i == 0) { syslog(LOG_NOTICE, "recycle tty %s", ttyn); diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 287fe44fb1..7c8b086d2b 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -806,15 +806,13 @@ autobaud(void) rfds = 1 << 0; timeout.tv_sec = 5; timeout.tv_usec = 0; - if (select(32, (fd_set *)&rfds, (fd_set *)NULL, - (fd_set *)NULL, &timeout) <= 0) + if (select(32, (fd_set *)&rfds, NULL, NULL, &timeout) <= 0) return (type); if (read(STDIN_FILENO, &c, sizeof(char)) != sizeof(char)) return (type); timeout.tv_sec = 0; timeout.tv_usec = 20; - (void) select(32, (fd_set *)NULL, (fd_set *)NULL, - (fd_set *)NULL, &timeout); + (void) select(32, NULL, NULL, NULL, &timeout); (void)tcflush(0, TCIOFLUSH); switch (c & 0377) { diff --git a/libexec/pppoed/pppoed.c b/libexec/pppoed/pppoed.c index de8304f3c9..04e326f24a 100644 --- a/libexec/pppoed/pppoed.c +++ b/libexec/pppoed/pppoed.c @@ -444,7 +444,7 @@ Spawn(const char *prog __unused, const char *acname, const char *provider, setsid(); syslog(LOG_INFO, "Executing: %s", exec); - execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, (char *)NULL); + execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, NULL); syslog(LOG_ERR, "execlp failed: %m"); _exit(EX_OSFILE); diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c index ba50ff8038..cb3726aa1c 100644 --- a/libexec/rlogind/rlogind.c +++ b/libexec/rlogind/rlogind.c @@ -293,10 +293,10 @@ doit(int f, union sockunion *fromp) } if (authenticated) { execl(_PATH_LOGIN, "login", "-p", - "-h", hostname, "-f", lusername, (char *)NULL); + "-h", hostname, "-f", lusername, NULL); } else execl(_PATH_LOGIN, "login", "-p", - "-h", hostname, lusername, (char *)NULL); + "-h", hostname, lusername, NULL); fatal(STDERR_FILENO, _PATH_LOGIN, 1); /*NOTREACHED*/ } @@ -374,7 +374,7 @@ protocol(int f, int p) FD_ZERO(&ebits); FD_ZERO(&ibits); FD_ZERO(&obits); - omask = (fd_set *)NULL; + omask = NULL; if (fcc) { FD_SET(p, &obits); omask = &obits; diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c index e7f6d05847..f321e7c55d 100644 --- a/libexec/rpc.rquotad/rquotad.c +++ b/libexec/rpc.rquotad/rquotad.c @@ -112,7 +112,7 @@ rquota_service(struct svc_req *request, SVCXPRT *transp) { switch (request->rq_proc) { case NULLPROC: - (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); + (void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL); break; case RQUOTAPROC_GETQUOTA: diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 3c7a2f7740..8eebc16e4b 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -612,7 +612,7 @@ fail: syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: cmd='%.80s'", remuser, fromhost, locuser, cmdbuf); } - execl(pwd->pw_shell, cp, "-c", cmdbuf, (char *)NULL); + execl(pwd->pw_shell, cp, "-c", cmdbuf, NULL); perror(pwd->pw_shell); exit(1); } diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c index 4f936a525c..3766f03232 100644 --- a/sbin/adjkerntz/adjkerntz.c +++ b/sbin/adjkerntz/adjkerntz.c @@ -306,7 +306,7 @@ recalculate: * restoring disrtcset, since we don't clean up * anything. */ - if (gettimeofday(&tv, (struct timezone *)NULL)) { + if (gettimeofday(&tv, NULL)) { syslog(LOG_ERR, "gettimeofday: %m"); return 1; } diff --git a/sbin/atm/ilmid/ilmid.c b/sbin/atm/ilmid/ilmid.c index efe0712bd4..e4206ca072 100644 --- a/sbin/atm/ilmid/ilmid.c +++ b/sbin/atm/ilmid/ilmid.c @@ -893,7 +893,7 @@ asn_get_header ( u_char **bufp ) * Allocate memory to hold the SNMP header */ if ( ( h = (Snmp_Header *)UM_ALLOC(sizeof(Snmp_Header)) ) == NULL ) - return ( (Snmp_Header *)NULL ); + return ( NULL ); /* * Ensure that we wipe the slate clean @@ -904,7 +904,7 @@ asn_get_header ( u_char **bufp ) * PDU has to start as SEQUENCE OF */ if ( *bp++ != ASN_SEQUENCE ) /* Class == Universial, f == 1, tag == SEQUENCE */ - return ( (Snmp_Header *)NULL ); + return ( NULL ); /* * Get the length of remaining PDU data @@ -915,7 +915,7 @@ asn_get_header ( u_char **bufp ) * We expect to find an integer encoding Version-1 */ if ( *bp++ != ASN_INTEGER ) { - return ( (Snmp_Header *)NULL ); + return ( NULL ); } h->version = asn_get_int ( &bp, NULL ); @@ -923,7 +923,7 @@ asn_get_header ( u_char **bufp ) * After the version, we need the community name */ if ( *bp++ != ASN_OCTET ) { - return ( (Snmp_Header *)NULL ); + return ( NULL ); } asn_get_octet ( &bp, h->community, NULL ); @@ -942,28 +942,28 @@ asn_get_header ( u_char **bufp ) /* Request ID */ if ( *bp++ != ASN_INTEGER ) { UM_FREE ( h ); - return ( (Snmp_Header *)NULL ); + return ( NULL ); } h->reqid = asn_get_int ( &bp, NULL ); /* Error Status */ if ( *bp++ != ASN_INTEGER ) { UM_FREE ( h ); - return ( (Snmp_Header *)NULL ); + return ( NULL ); } h->error = asn_get_int ( &bp, NULL ); /* Error Index */ if ( *bp++ != ASN_INTEGER ) { UM_FREE ( h ); - return ( (Snmp_Header *)NULL ); + return ( NULL ); } h->erridx = asn_get_int ( &bp, NULL ); /* Sequence of... */ if ( *bp++ != ASN_SEQUENCE ) { UM_FREE ( h ); - return ( (Snmp_Header *)NULL ); + return ( NULL ); } h->varlen = ( asn_get_pdu_len ( &bp, &len ) - 1 ); h->varlen += ( len - 1 ); @@ -1956,7 +1956,7 @@ static void Increment_DL ( __unused int sig ) { Debug_Level++; - if ( Debug_Level && Log == (FILE *)NULL ) { + if ( Debug_Level && Log == NULL ) { if ( foregnd ) { Log = stderr; } else { diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index bec4f3318c..b94642e2bc 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -488,7 +488,7 @@ l_perror(const char *s) break; default: - warn((char *)NULL); + warn(NULL); break; } } diff --git a/sbin/disklabel64/disklabel64.c b/sbin/disklabel64/disklabel64.c index d7659940e9..067e03a8bb 100644 --- a/sbin/disklabel64/disklabel64.c +++ b/sbin/disklabel64/disklabel64.c @@ -516,7 +516,7 @@ l_perror(const char *s) break; default: - warn((char *)NULL); + warn(NULL); break; } } diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index abbe6c33ba..817b3c80f7 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -337,7 +337,7 @@ trewind(void) } close(slaves[f].fd); } - while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ + while (wait(NULL) >= 0) /* wait for any signals from slaves */ /* void */; if (pipeout) diff --git a/sbin/init/init.c b/sbin/init/init.c index dd0c449b98..49a66ea063 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1658,7 +1658,7 @@ setprocresources(const char *cname) { login_cap_t *lc; if ((lc = login_getclassbyname(cname, NULL)) != NULL) { - setusercontext(lc, (struct passwd*)NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES); + setusercontext(lc, NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES); login_close(lc); } } diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 9dc6117f1f..18f72aef92 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -309,9 +309,9 @@ main(int argc, char **argv) }; argc -= optind; argv += optind; - grphead = (struct grouplist *)NULL; - exphead = (struct exportlist *)NULL; - mlhead = (struct mountlist *)NULL; + grphead = NULL; + exphead = NULL; + mlhead = NULL; if (argc == 1) { strncpy(exname, *argv, MAXPATHLEN-1); exname[MAXPATHLEN-1] = '\0'; @@ -787,7 +787,7 @@ xdr_explist(XDR *xdrsp, caddr_t cp) if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, &putdef)) goto errout; if (ep->ex_defdir && putdef == 0 && - put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL, + put_exlist(ep->ex_defdir, xdrsp, NULL, &putdef)) goto errout; ep = ep->ex_next; @@ -848,7 +848,7 @@ put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp) return (1); } hp = hp->ht_next; - if (gotalldir && hp == (struct hostlist *)NULL) { + if (gotalldir && hp == NULL) { hp = adp->dp_hosts; gotalldir = 0; } @@ -893,7 +893,7 @@ get_exportlist(void) ep = ep->ex_next; free_exp(ep2); } - exphead = (struct exportlist *)NULL; + exphead = NULL; grp = grphead; while (grp) { @@ -901,7 +901,7 @@ get_exportlist(void) grp = grp->gr_next; free_grp(tgrp); } - grphead = (struct grouplist *)NULL; + grphead = NULL; /* * And delete exports that are in the kernel for all local @@ -947,7 +947,7 @@ get_exportlist(void) syslog(LOG_ERR, "can't open %s", exname); exit(2); } - dirhead = (struct dirlist *)NULL; + dirhead = NULL; while (get_line()) { if (debug) warnx("got line %s", line); @@ -964,7 +964,7 @@ get_exportlist(void) exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; - ep = (struct exportlist *)NULL; + ep = NULL; /* * Create new exports list entry @@ -977,7 +977,7 @@ get_exportlist(void) goto nextline; } if (*cp == '-') { - if (ep == (struct exportlist *)NULL) { + if (ep == NULL) { getexp_err(ep, tgrp); goto nextline; } @@ -1011,7 +1011,7 @@ get_exportlist(void) * in the list. */ ep = ex_search(&fsb.f_fsid); - if (ep == (struct exportlist *)NULL) { + if (ep == NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; ep->ex_fsdir = (char *) @@ -1045,7 +1045,7 @@ get_exportlist(void) savedc = *endcp; *endcp = '\0'; got_nondir = 1; - if (ep == (struct exportlist *)NULL) { + if (ep == NULL) { getexp_err(ep, tgrp); goto nextline; } @@ -1136,11 +1136,11 @@ get_exportlist(void) grp->gr_next = grphead; grphead = tgrp; } else { - hang_dirp(dirhead, (struct grouplist *)NULL, ep, + hang_dirp(dirhead, NULL, ep, opt_flags); free_grp(grp); } - dirhead = (struct dirlist *)NULL; + dirhead = NULL; if ((ep->ex_flag & EX_LINKED) == 0) { ep2 = exphead; epp = &exphead; @@ -1160,7 +1160,7 @@ get_exportlist(void) nextline: if (dirhead) { free_dir(dirhead); - dirhead = (struct dirlist *)NULL; + dirhead = NULL; } } fclose(exp_file); @@ -1175,7 +1175,7 @@ get_exp(void) struct exportlist *ep; ep = (struct exportlist *)malloc(sizeof (struct exportlist)); - if (ep == (struct exportlist *)NULL) + if (ep == NULL) out_of_mem(); memset(ep, 0, sizeof(struct exportlist)); return (ep); @@ -1190,7 +1190,7 @@ get_grp(void) struct grouplist *gp; gp = (struct grouplist *)malloc(sizeof (struct grouplist)); - if (gp == (struct grouplist *)NULL) + if (gp == NULL) out_of_mem(); memset(gp, 0, sizeof(struct grouplist)); return (gp); @@ -1242,12 +1242,12 @@ add_expdir(struct dirlist **dpp, char *cp, int len) struct dirlist *dp; dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); - if (dp == (struct dirlist *)NULL) + if (dp == NULL) out_of_mem(); dp->dp_left = *dpp; - dp->dp_right = (struct dirlist *)NULL; + dp->dp_right = NULL; dp->dp_flag = 0; - dp->dp_hosts = (struct hostlist *)NULL; + dp->dp_hosts = NULL; strcpy(dp->dp_dirp, cp); *dpp = dp; return (dp->dp_dirp); @@ -1269,7 +1269,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, free((caddr_t)dp); else ep->ex_defdir = dp; - if (grp == (struct grouplist *)NULL) { + if (grp == NULL) { ep->ex_defdir->dp_flag |= DP_DEFSET; if (flags & OP_KERB) ep->ex_defdir->dp_flag |= DP_KERB; @@ -1320,7 +1320,7 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, free((caddr_t)newdp); } else { dp = newdp; - dp->dp_left = (struct dirlist *)NULL; + dp->dp_left = NULL; *dpp = dp; } if (grp) { @@ -1695,9 +1695,9 @@ get_ht(void) struct hostlist *hp; hp = (struct hostlist *)malloc(sizeof (struct hostlist)); - if (hp == (struct hostlist *)NULL) + if (hp == NULL) out_of_mem(); - hp->ht_next = (struct hostlist *)NULL; + hp->ht_next = NULL; hp->ht_flag = 0; return (hp); } @@ -2153,13 +2153,13 @@ get_mountlist(void) if (host == NULL || dirp == NULL) continue; mlp = (struct mountlist *)malloc(sizeof (*mlp)); - if (mlp == (struct mountlist *)NULL) + if (mlp == NULL) out_of_mem(); strncpy(mlp->ml_host, host, RPCMNT_NAMELEN); mlp->ml_host[RPCMNT_NAMELEN] = '\0'; strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN); mlp->ml_dirp[RPCMNT_PATHLEN] = '\0'; - mlp->ml_next = (struct mountlist *)NULL; + mlp->ml_next = NULL; *mlpp = mlp; mlpp = &mlp->ml_next; } @@ -2217,13 +2217,13 @@ add_mlist(char *hostp, char *dirp) mlp = mlp->ml_next; } mlp = (struct mountlist *)malloc(sizeof (*mlp)); - if (mlp == (struct mountlist *)NULL) + if (mlp == NULL) out_of_mem(); strncpy(mlp->ml_host, hostp, RPCMNT_NAMELEN); mlp->ml_host[RPCMNT_NAMELEN] = '\0'; strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN); mlp->ml_dirp[RPCMNT_PATHLEN] = '\0'; - mlp->ml_next = (struct mountlist *)NULL; + mlp->ml_next = NULL; *mlpp = mlp; if ((mlfile = fopen(_PATH_RMOUNTLIST, "a")) == NULL) { syslog(LOG_ERR, "can't update %s", _PATH_RMOUNTLIST); @@ -2268,7 +2268,7 @@ int check_options(struct dirlist *dp) { - if (dp == (struct dirlist *)NULL) + if (dp == NULL) return (1); if ((opt_flags & (OP_MAPROOT | OP_MAPALL)) == (OP_MAPROOT | OP_MAPALL) || (opt_flags & (OP_MAPROOT | OP_KERB)) == (OP_MAPROOT | OP_KERB) || diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 5d2e9f7033..bd07c8a94f 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -289,7 +289,7 @@ main(int argc, char **argv) err(EX_NOPERM, "-f flag"); } options |= F_FLOOD; - setbuf(stdout, (char *)NULL); + setbuf(stdout, NULL); break; case 'G': /* Maximum packet size for ping sweep */ ultmp = strtoul(optarg, &ep, 0); diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 10ede1078b..fcf1c3a73b 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -411,7 +411,7 @@ main(int argc, char **argv) errx(1, "Must be superuser to flood ping"); } options |= F_FLOOD; - setbuf(stdout, (char *)NULL); + setbuf(stdout, NULL); break; case 'g': gateway = optarg; diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c index 0faec331f0..b02fe8d20e 100644 --- a/sbin/restore/symtab.c +++ b/sbin/restore/symtab.c @@ -535,7 +535,7 @@ initsymtable(char *filename) entrytblsize = maxino / HASHFACTOR; entry = (struct entry **) calloc((unsigned)entrytblsize, sizeof(struct entry *)); - if (entry == (struct entry **)NULL) + if (entry == NULL) panic("no memory for entry table\n"); ep = addentry(".", ROOTINO, NODE); ep->e_flags |= NEW; diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index 466006ad0c..dec1e9248c 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -265,7 +265,7 @@ setup(void) done(1); } map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY)); - if (map == (char *)NULL) + if (map == NULL) panic("no memory for file dump list\n"); dumpmap = map; curfile.action = USING; diff --git a/sbin/route/route.c b/sbin/route/route.c index 9c908e7f81..a70c66a3d7 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -150,7 +150,7 @@ main(int argc, char **argv) int ch; if (argc < 2) - usage((char *)NULL); + usage(NULL); while ((ch = getopt(argc, argv, "c:wnqdtv")) != -1) switch(ch) { @@ -177,7 +177,7 @@ main(int argc, char **argv) break; case '?': default: - usage((char *)NULL); + usage(NULL); } argc -= optind; argv += optind; @@ -705,33 +705,33 @@ newroute(int argc, char **argv) break; case K_IFA: if (--argc == 0) - usage((char *)NULL); + usage(NULL); getaddr(RTA_IFA, *++argv, 0); break; case K_IFP: if (--argc == 0) - usage((char *)NULL); + usage(NULL); getaddr(RTA_IFP, *++argv, 0); break; case K_GENMASK: if (--argc == 0) - usage((char *)NULL); + usage(NULL); getaddr(RTA_GENMASK, *++argv, 0); break; case K_GATEWAY: if (--argc == 0) - usage((char *)NULL); + usage(NULL); getaddr(RTA_GATEWAY, *++argv, 0); break; case K_DST: if (--argc == 0) - usage((char *)NULL); + usage(NULL); ishost = getaddr(RTA_DST, *++argv, &hp); dest = *argv; break; case K_NETMASK: if (--argc == 0) - usage((char *)NULL); + usage(NULL); getaddr(RTA_NETMASK, *++argv, 0); /* FALLTHROUGH */ case K_NET: @@ -739,7 +739,7 @@ newroute(int argc, char **argv) break; case K_PREFIXLEN: if (--argc == 0) - usage((char *)NULL); + usage(NULL); if (prefixlen(*++argv) == -1) { forcenet = 0; ishost = 1; @@ -793,7 +793,7 @@ newroute(int argc, char **argv) af = AF_MPLS; aflen = sizeof(struct sockaddr_mpls); if (--argc == 0) - usage((char *)NULL); + usage(NULL); switch(pushcount + swapcount){ case 1: getaddr(RTA_MPLS1, *++argv, 0); @@ -815,7 +815,7 @@ newroute(int argc, char **argv) case K_RTT: case K_RTTVAR: if (--argc == 0) - usage((char *)NULL); + usage(NULL); set_metric(*++argv, key); break; default: diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index cc68a8c152..c5c08dd9ca 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -136,13 +136,13 @@ main(int argc, char **argv) break; case '?': default: - usage((char *)NULL); + usage(NULL); } argc -= optind; argv += optind; if (argc < 1) - usage((char *)NULL); + usage(NULL); if (killflg + doreboot + dohalt + dopower > 1) usage("incompatible switches -h, -k, -p and -r"); @@ -354,21 +354,21 @@ die_you_gravy_sucking_pig_dog(void) } else { if (doreboot) { execle(_PATH_REBOOT, "reboot", "-l", nosync, - (char *)NULL, empty_environ); + NULL, empty_environ); syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_REBOOT); warn(_PATH_REBOOT); } else if (dohalt) { execle(_PATH_HALT, "halt", "-l", nosync, - (char *)NULL, empty_environ); + NULL, empty_environ); syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_HALT); warn(_PATH_HALT); } else if (dopower) { execle(_PATH_HALT, "halt", "-l", "-p", nosync, - (char *)NULL, empty_environ); + NULL, empty_environ); syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_HALT); warn(_PATH_HALT); diff --git a/share/examples/isdn/v21/v21modem.c b/share/examples/isdn/v21/v21modem.c index db3c88bc0f..fdd4d8b552 100644 --- a/share/examples/isdn/v21/v21modem.c +++ b/share/examples/isdn/v21/v21modem.c @@ -243,7 +243,7 @@ create_session(void) i = forkpty(&ptyfd, buf, 0, 0); if (i == 0) { execl("/usr/libexec/getty", "getty", "std.300", "-", - (char *)NULL); + NULL); syslog(LOG_ERR, "exec getty %d", errno); exit(2); } else if (i < 0) { diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index e15b0cf821..44a1545624 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -141,7 +141,7 @@ main(int argc, char *argv[]) errx(1, "Unreasonable sector size: %s", optarg); break; case 's': - user_size = strtoll(optarg, (char **)NULL, /*base*/10); + user_size = strtoll(optarg, NULL, /*base*/10); if (user_size < 0) errx(1, "Unreasonable volume size: %s", optarg); break; diff --git a/share/examples/sunrpc/sort/rsort.c b/share/examples/sunrpc/sort/rsort.c index 5c05ad7f42..0070dcadd7 100644 --- a/share/examples/sunrpc/sort/rsort.c +++ b/share/examples/sunrpc/sort/rsort.c @@ -22,7 +22,7 @@ main(argc, argv) machinename = argv[1]; args.ss.ss_len = argc - 2; /* substract off progname, machinename */ args.ss.ss_val = &argv[2]; - res.ss.ss_val = (char **)NULL; + res.ss.ss_val = NULL; if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT, xdr_sortstrings, &args, xdr_sortstrings, &res))) diff --git a/share/examples/sunrpc/sort/sort_proc.c b/share/examples/sunrpc/sort/sort_proc.c index 5538faf7ea..209dcb51ca 100644 --- a/share/examples/sunrpc/sort/sort_proc.c +++ b/share/examples/sunrpc/sort/sort_proc.c @@ -15,7 +15,7 @@ sort_1(ssp) { static struct sortstrings ss_res; - if (ss_res.ss.ss_val != (str *)NULL) + if (ss_res.ss.ss_val != NULL) free(ss_res.ss.ss_val); qsort(ssp->ss.ss_val, ssp->ss.ss_len, sizeof (char *), comparestrings); diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index cfd512e57f..150c1fc83d 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -616,7 +616,7 @@ or do not roll your own. .Bd -literal if ((four = malloc(sizeof(struct foo))) == NULL) - err(1, (char *)NULL); + err(1, NULL); if ((six = (int *)overflow()) == NULL) errx(1, "number overflowed"); return(eight); diff --git a/sys/bus/cam/scsi/scsi_sa.c b/sys/bus/cam/scsi/scsi_sa.c index e2d12c430e..fea22576d1 100644 --- a/sys/bus/cam/scsi/scsi_sa.c +++ b/sys/bus/cam/scsi/scsi_sa.c @@ -3639,7 +3639,7 @@ scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries, struct scsi_tape_locate *scmd; cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action, - (u_int8_t *)NULL, 0, sense_len, sizeof(*scmd), timeout); + NULL, 0, sense_len, sizeof(*scmd), timeout); scmd = (struct scsi_tape_locate *)&csio->cdb_io.cdb_bytes; bzero(scmd, sizeof(*scmd)); scmd->opcode = LOCATE; diff --git a/sys/dev/atm/hea/eni_receive.c b/sys/dev/atm/hea/eni_receive.c index f87749225f..3f9ac37c89 100644 --- a/sys/dev/atm/hea/eni_receive.c +++ b/sys/dev/atm/hea/eni_receive.c @@ -132,7 +132,7 @@ eni_do_service(Eni_unit *eup) */ evp = (Eni_vcc *) atm_dev_vcc_find ( (Cmn_unit *)eup, 0, vcc, VCC_IN ); - if ( evp == (Eni_vcc *)NULL ) + if ( evp == NULL ) goto next_vcc; /* VCI no longer active */ rdptr = evp->ev_rxpos; /* @@ -323,7 +323,7 @@ eni_do_service(Eni_unit *eup) /* * Do we have a valid buffer? */ - if ( m != (KBuffer *)NULL ) + if ( m != NULL ) { int len; u_long *up; diff --git a/sys/dev/misc/psm/psm.c b/sys/dev/misc/psm/psm.c index 5cd875270e..e786100999 100644 --- a/sys/dev/misc/psm/psm.c +++ b/sys/dev/misc/psm/psm.c @@ -707,7 +707,7 @@ doinitialize(struct psm_softc *sc, mousemode_t *mode) sc->mode.packetsize = vendortype[i].packetsize; /* set mouse parameters */ - if (mode != (mousemode_t *)NULL) { + if (mode != NULL) { if (mode->rate > 0) mode->rate = set_mouse_sampling_rate(kbdc, mode->rate); if (mode->resolution >= 0) diff --git a/sys/dev/netif/ie/if_ie.c b/sys/dev/netif/ie/if_ie.c index 67e013e43e..722853dc00 100644 --- a/sys/dev/netif/ie/if_ie.c +++ b/sys/dev/netif/ie/if_ie.c @@ -1723,7 +1723,7 @@ iereset(int unit) } kprintf("ie%d: reset\n", unit); ie_softc[unit].arpcom.ac_if.if_flags &= ~IFF_UP; - ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL); + ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL); /* * Stop i82586 dead in its tracks. @@ -1741,7 +1741,7 @@ iereset(int unit) #endif ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP; - ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL); + ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL); } /* @@ -2142,7 +2142,7 @@ ie_mc_reset(int unit) if (ie->mcast_count >= MAXMCAST) { ie->arpcom.ac_if.if_flags |= IFF_ALLMULTI; ieioctl(&ie->arpcom.ac_if, SIOCSIFFLAGS, NULL, - (struct ucred *)NULL); + NULL); goto setflag; } bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), diff --git a/sys/dev/raid/asr/asr.c b/sys/dev/raid/asr/asr.c index 1edc6d44d0..2bb9d6a5d1 100644 --- a/sys/dev/raid/asr/asr.c +++ b/sys/dev/raid/asr/asr.c @@ -853,7 +853,7 @@ ASR_queue_c ( union asr_ccb * ccb; OUT int status; - if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) { + if ((ccb = asr_alloc_ccb (sc)) == NULL) { return (CAM_REQUEUE_REQ); } @@ -939,7 +939,7 @@ ASR_failActiveCommands ( * xpt_async (AC_BUS_RESET, sc->ha_path[bus], NULL); * } */ - while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != (struct ccb_hdr *)NULL) { + while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != NULL) { ASR_ccbRemove (sc, (union asr_ccb *)ccb); ccb->status &= ~CAM_STATUS_MASK; @@ -992,8 +992,8 @@ STATIC INLINE int ASR_getBlinkLedCode ( IN Asr_softc_t * sc) { - if ((sc != (Asr_softc_t *)NULL) - && (sc->ha_blinkLED != (u_int8_t *)NULL) + if ((sc != NULL) + && (sc->ha_blinkLED != NULL) && (sc->ha_blinkLED[1] == 0xBC)) { return (sc->ha_blinkLED[0]); } @@ -1029,13 +1029,13 @@ ASR_getTidAddress( * sc must be valid before it gets here, so that check could be * dropped if speed a critical issue. */ - if ((sc == (Asr_softc_t *)NULL) + if ((sc == NULL) || (bus > MAX_CHANNEL) || (target > sc->ha_MaxId) || (lun > sc->ha_MaxLun)) { debug_asr_printf("(%lx,%d,%d,%d) target out of range\n", (u_long)sc, bus, target, lun); - return ((tid_t *)NULL); + return (NULL); } /* * See if there is an associated bus list. @@ -1046,7 +1046,7 @@ ASR_getTidAddress( */ # define BUS_CHUNK 8 new_size = ((target + BUS_CHUNK - 1) & ~(BUS_CHUNK - 1)); - if ((bus_ptr = sc->ha_targets[bus]) == (target2lun_t *)NULL) { + if ((bus_ptr = sc->ha_targets[bus]) == NULL) { /* * Allocate a new structure? * Since one element in structure, the +1 @@ -1056,9 +1056,9 @@ ASR_getTidAddress( || ((sc->ha_targets[bus] = bus_ptr = (target2lun_t *)kmalloc ( sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size), M_TEMP, M_WAITOK)) - == (target2lun_t *)NULL)) { + == NULL)) { debug_asr_printf("failed to allocate bus list\n"); - return ((tid_t *)NULL); + return (NULL); } bzero (bus_ptr, sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size)); @@ -1075,9 +1075,9 @@ ASR_getTidAddress( || ((new_bus_ptr = (target2lun_t *)kmalloc ( sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size), M_TEMP, M_WAITOK)) - == (target2lun_t *)NULL)) { + == NULL)) { debug_asr_printf("failed to reallocate bus list\n"); - return ((tid_t *)NULL); + return (NULL); } /* * Zero and copy the whole thing, safer, simpler coding @@ -1103,7 +1103,7 @@ ASR_getTidAddress( if ((new_size = lun) != 0) { new_size = ((lun + TARGET_CHUNK - 1) & ~(TARGET_CHUNK - 1)); } - if ((target_ptr = bus_ptr->LUN[target]) == (lun2tid_t *)NULL) { + if ((target_ptr = bus_ptr->LUN[target]) == NULL) { /* * Allocate a new structure? * Since one element in structure, the +1 @@ -1113,9 +1113,9 @@ ASR_getTidAddress( || ((bus_ptr->LUN[target] = target_ptr = (lun2tid_t *)kmalloc ( sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size), M_TEMP, M_WAITOK)) - == (lun2tid_t *)NULL)) { + == NULL)) { debug_asr_printf("failed to allocate target list\n"); - return ((tid_t *)NULL); + return (NULL); } bzero (target_ptr, sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size)); @@ -1132,9 +1132,9 @@ ASR_getTidAddress( || ((new_target_ptr = (lun2tid_t *)kmalloc ( sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size), M_TEMP, M_WAITOK)) - == (lun2tid_t *)NULL)) { + == NULL)) { debug_asr_printf("failed to reallocate target list\n"); - return ((tid_t *)NULL); + return (NULL); } /* * Zero and copy the whole thing, safer, simpler coding @@ -1175,7 +1175,7 @@ ASR_getTid ( crit_enter(); if (((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, FALSE)) - == (tid_t *)NULL) + == NULL) /* (tid_t)0 or (tid_t)-1 indicate no TID */ || (*tid_ptr == (tid_t)0)) { crit_exit(); @@ -1209,7 +1209,7 @@ ASR_setTid ( } crit_enter(); if ((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, TRUE)) - == (tid_t *)NULL) { + == NULL) { crit_exit(); return ((tid_t)-1); } @@ -2262,8 +2262,8 @@ ASR_sync ( * as the OS normally would flush all outstanding commands before * issuing a shutdown or an adapter reset). */ - if ((sc != (Asr_softc_t *)NULL) - && (LIST_FIRST(&(sc->ha_ccb)) != (struct ccb_hdr *)NULL) + if ((sc != NULL) + && (LIST_FIRST(&(sc->ha_ccb)) != NULL) && ((TID = ASR_getTid (sc, bus, target, lun)) != (tid_t)-1) && (TID != (tid_t)0)) { defAlignLong(PRIVATE_SCSI_SCB_EXECUTE_MESSAGE,Message); @@ -2400,7 +2400,7 @@ asr_pci_map_mem ( p &= ~15; sc->ha_mem_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid, p, p + l, l, RF_ACTIVE); - if (sc->ha_mem_res == (struct resource *)NULL) { + if (sc->ha_mem_res == NULL) { return (0); } sc->ha_Base = (void *)rman_get_start(sc->ha_mem_res); @@ -2423,7 +2423,7 @@ asr_pci_map_mem ( p &= ~15; sc->ha_mes_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid, p, p + l, l, RF_ACTIVE); - if (sc->ha_mes_res == (struct resource *)NULL) { + if (sc->ha_mes_res == NULL) { return (0); } if ((void *)rman_get_start(sc->ha_mes_res) == NULL) { @@ -2450,7 +2450,7 @@ asr_pci_map_int ( sc->ha_irq_res = bus_alloc_resource(tag, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (sc->ha_irq_res == (struct resource *)NULL) { + if (sc->ha_irq_res == NULL) { return (0); } error = bus_setup_intr(tag, sc->ha_irq_res, 0, @@ -2474,7 +2474,7 @@ asr_attach (ATTACH_ARGS) ATTACH_SET(); sc = kmalloc(sizeof(*sc), M_DEVBUF, M_INTWAIT | M_ZERO); - if (Asr_softc == (Asr_softc_t *)NULL) { + if (Asr_softc == NULL) { /* * Fixup the OS revision as saved in the dptsig for the * engine (dptioctl.h) to pick up. @@ -2727,7 +2727,7 @@ asr_attach (ATTACH_ARGS) int bus; union asr_ccb * ccb; - if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) { + if ((ccb = asr_alloc_ccb (sc)) == NULL) { kprintf ("asr%d: CAM could not be notified of asynchronous callback parameters\n", unit); ATTACH_RETURN(ENOMEM); } @@ -3087,7 +3087,7 @@ asr_intr ( * and a generic handler for immunity against odd error * returns from the adapter. */ - if (ccb == (union asr_ccb *)NULL) { + if (ccb == NULL) { /* * Return Reply so that it can be used for the * next command @@ -3238,7 +3238,7 @@ asr_open(struct dev_open_args *ap) cdev_t dev = ap->a_head.a_dev; OUT int error; - if (ASR_get_sc (dev) == (Asr_softc_t *)NULL) { + if (ASR_get_sc (dev) == NULL) { return (ENODEV); } crit_enter(); @@ -3571,7 +3571,7 @@ ASR_queue_i( } if (error) { while ((elm = SLIST_FIRST(&sgList)) - != (struct ioctlSgList_S *)NULL) { + != NULL) { SLIST_REMOVE_HEAD(&sgList, link); kfree (elm, M_TEMP); } @@ -3585,10 +3585,10 @@ ASR_queue_i( debug_usr_cmd_dump_message(Message_Ptr); /* Send the command */ - if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) { + if ((ccb = asr_alloc_ccb (sc)) == NULL) { /* Free up in-kernel buffers */ while ((elm = SLIST_FIRST(&sgList)) - != (struct ioctlSgList_S *)NULL) { + != NULL) { SLIST_REMOVE_HEAD(&sgList, link); kfree (elm, M_TEMP); } @@ -3625,7 +3625,7 @@ ASR_queue_i( crit_exit(); /* Free up in-kernel buffers */ while ((elm = SLIST_FIRST(&sgList)) - != (struct ioctlSgList_S *)NULL) { + != NULL) { SLIST_REMOVE_HEAD(&sgList, link); kfree (elm, M_TEMP); } @@ -3667,7 +3667,7 @@ ASR_queue_i( } /* Free up in-kernel buffers */ - while ((elm = SLIST_FIRST(&sgList)) != (struct ioctlSgList_S *)NULL) { + while ((elm = SLIST_FIRST(&sgList)) != NULL) { /* Copy out as necessary */ if ((error == 0) /* DIR bit considered `valid', error due to ignorance works */ @@ -3715,7 +3715,7 @@ asr_ioctl(struct dev_ioctl_args *ap) OUT int error = 0; Asr_softc_t * sc = ASR_get_sc (dev); - if (sc != (Asr_softc_t *)NULL) + if (sc != NULL) switch(ap->a_cmd) { case DPT_SIGNATURE: diff --git a/sys/dev/raid/twa/twa_globals.c b/sys/dev/raid/twa/twa_globals.c index dd6947c7c1..63dd68502a 100644 --- a/sys/dev/raid/twa/twa_globals.c +++ b/sys/dev/raid/twa/twa_globals.c @@ -107,7 +107,7 @@ struct twa_message twa_aen_table[] = { {0x00FD, "Handler lockup"}, {0x00FE, "Retrying PCI transfer"}, {0x00FF, "AEN queue is full"}, - {0xFFFFFFFF, (char *)NULL} + {0xFFFFFFFF, NULL} }; /* AEN severity table. */ @@ -117,7 +117,7 @@ char *twa_aen_severity_table[] = { "WARNING", "INFO", "DEBUG", - (char *)NULL + NULL }; /* Error messages. */ @@ -234,7 +234,7 @@ struct twa_message twa_error_table[] = { {0x025B, "Invalid LBA offset specified in CreateUnit descriptor"}, {0x025C, "Invalid stripelet size specified in CreateUnit descriptor"}, {0x0260, "SMART attribute exceeded threshold"}, - {0xFFFFFFFF, (char *)NULL} + {0xFFFFFFFF, NULL} }; #ifdef TWA_DEBUG diff --git a/sys/dev/serial/stl/stallion.c b/sys/dev/serial/stl/stallion.c index 06e5111f80..58e212bdc0 100644 --- a/sys/dev/serial/stl/stallion.c +++ b/sys/dev/serial/stl/stallion.c @@ -306,32 +306,32 @@ static stlbrd_t *stl_brds[STL_MAXBRDS]; * referencing boards when printing trace and stuff. */ static char *stl_brdnames[] = { - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, "EasyIO", "EC8/32-AT", "EC8/32-MC", - (char *) NULL, - (char *) NULL, - (char *) NULL, + NULL, + NULL, + NULL, "EC8/32-PCI", "EC8/64-PCI", "EasyIO-PCI", @@ -824,7 +824,7 @@ static int stl_findfreeunit(void) int i; for (i = 0; (i < STL_MAXBRDS); i++) - if (stl_brds[i] == (stlbrd_t *) NULL) + if (stl_brds[i] == NULL) break; return((i >= STL_MAXBRDS) ? -1 : i); } @@ -991,11 +991,11 @@ static const char *stlpciprobe(pcici_t tag, pcidi_t type) } if (brdtype == 0) - return((char *) NULL); + return(NULL); class = pci_conf_read(tag, PCI_CLASS_REG); if ((class & PCI_CLASS_MASK) == PCI_CLASS_MASS_STORAGE) - return((char *) NULL); + return(NULL); return(stl_brdnames[brdtype]); } @@ -1159,7 +1159,7 @@ STATIC int stlopen(struct dev_open_args *ap) return(0); portp = stl_dev2port(dev); - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(ENXIO); if (minor(dev) & STL_CTRLDEV) return(0); @@ -1276,7 +1276,7 @@ STATIC int stlclose(struct dev_close_args *ap) return(0); portp = stl_dev2port(dev); - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(ENXIO); tp = &portp->tty; @@ -1337,7 +1337,7 @@ STATIC int stlioctl(struct dev_ioctl_args *ap) return(stl_memioctl(dev, cmd, data, ap->a_fflag)); portp = stl_dev2port(dev); - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(ENODEV); tp = &portp->tty; error = 0; @@ -1506,8 +1506,8 @@ STATIC stlport_t *stl_dev2port(cdev_t dev) stlbrd_t *brdp; brdp = stl_brds[MKDEV2BRD(dev)]; - if (brdp == (stlbrd_t *) NULL) - return((stlport_t *) NULL); + if (brdp == NULL) + return(NULL); return(brdp->ports[MKDEV2PORT(dev)]); } @@ -1709,7 +1709,7 @@ static void stl_flush(stlport_t *portp, int flag) kprintf("stl_flush(portp=%x,flag=%x)\n", (int) portp, flag); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return; crit_enter(); @@ -1767,7 +1767,7 @@ void stlintr(void *arg) #endif for (i = 0; (i < stl_nrbrds); i++) { - if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL) + if ((brdp = stl_brds[i]) == NULL) continue; if (brdp->state == 0) continue; @@ -1961,10 +1961,10 @@ static void stl_poll(void *arg) crit_enter(); for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) { - if ((brdp = stl_brds[brdnr]) == (stlbrd_t *) NULL) + if ((brdp = stl_brds[brdnr]) == NULL) continue; for (portnr = 0; (portnr < brdp->nrports); portnr++) { - if ((portp = brdp->ports[portnr]) == (stlport_t *) NULL) + if ((portp = brdp->ports[portnr]) == NULL) continue; if ((portp->state & ASY_ACTIVE) == 0) continue; @@ -2106,7 +2106,7 @@ static int stl_param(struct tty *tp, struct termios *tiosp) stlport_t *portp; portp = (stlport_t *) tp; - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(ENODEV); return(stl_setport(portp, tiosp)); @@ -2548,7 +2548,7 @@ static int stl_brdinit(stlbrd_t *brdp) for (i = 0, k = 0; (i < STL_MAXPANELS); i++) { panelp = brdp->panels[i]; - if (panelp != (stlpanel_t *) NULL) { + if (panelp != NULL) { stl_initports(brdp, panelp); for (j = 0; (j < panelp->nrports); j++) brdp->ports[k++] = panelp->ports[j]; @@ -2577,7 +2577,7 @@ static int stl_getbrdstats(caddr_t data) if (stl_brdstats.brd >= STL_MAXBRDS) return(-ENODEV); brdp = stl_brds[stl_brdstats.brd]; - if (brdp == (stlbrd_t *) NULL) + if (brdp == NULL) return(-ENODEV); bzero(&stl_brdstats, sizeof(combrd_t)); @@ -2613,17 +2613,17 @@ static stlport_t *stl_getport(int brdnr, int panelnr, int portnr) stlpanel_t *panelp; if ((brdnr < 0) || (brdnr >= STL_MAXBRDS)) - return((stlport_t *) NULL); + return(NULL); brdp = stl_brds[brdnr]; - if (brdp == (stlbrd_t *) NULL) - return((stlport_t *) NULL); + if (brdp == NULL) + return(NULL); if ((panelnr < 0) || (panelnr >= brdp->nrpanels)) - return((stlport_t *) NULL); + return(NULL); panelp = brdp->panels[panelnr]; - if (panelp == (stlpanel_t *) NULL) - return((stlport_t *) NULL); + if (panelp == NULL) + return(NULL); if ((portnr < 0) || (portnr >= panelp->nrports)) - return((stlport_t *) NULL); + return(NULL); return(panelp->ports[portnr]); } @@ -2639,11 +2639,11 @@ static int stl_getportstats(stlport_t *portp, caddr_t data) { unsigned char *head, *tail; - if (portp == (stlport_t *) NULL) { + if (portp == NULL) { stl_comstats = *((comstats_t *) data); portp = stl_getport(stl_comstats.brd, stl_comstats.panel, stl_comstats.port); - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(-ENODEV); } @@ -2680,11 +2680,11 @@ static int stl_getportstats(stlport_t *portp, caddr_t data) static int stl_clrportstats(stlport_t *portp, caddr_t data) { - if (portp == (stlport_t *) NULL) { + if (portp == NULL) { stl_comstats = *((comstats_t *) data); portp = stl_getport(stl_comstats.brd, stl_comstats.panel, stl_comstats.port); - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(ENODEV); } @@ -2715,10 +2715,10 @@ static int stl_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag) switch (cmd) { case COM_GETPORTSTATS: - rc = stl_getportstats((stlport_t *) NULL, data); + rc = stl_getportstats(NULL, data); break; case COM_CLRPORTSTATS: - rc = stl_clrportstats((stlport_t *) NULL, data); + rc = stl_clrportstats(NULL, data); break; case COM_GETBRDSTATS: rc = stl_getbrdstats(data); @@ -2777,7 +2777,7 @@ static void stl_cd1400flush(stlport_t *portp, int flag) kprintf("stl_cd1400flush(portp=%x,flag=%x)\n", (int) portp, flag); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return; crit_enter(); @@ -3429,7 +3429,7 @@ static int stl_cd1400datastate(stlport_t *portp) kprintf("stl_cd1400datastate(portp=%x)\n", (int) portp); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(0); return((portp->state & ASY_TXBUSY) ? 1 : 0); @@ -3660,8 +3660,8 @@ static void stl_cd1400portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *po (int) brdp, (int) panelp, (int) portp); #endif - if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) || - (portp == (stlport_t *) NULL)) + if ((brdp == NULL) || (panelp == NULL) || + (portp == NULL)) return; portp->ioaddr = panelp->iobase + (((brdp->brdtype == BRD_ECHPCI) || @@ -3851,8 +3851,8 @@ static void stl_sc26198portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *p (int) brdp, (int) panelp, (int) portp); #endif - if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) || - (portp == (stlport_t *) NULL)) + if ((brdp == NULL) || (panelp == NULL) || + (portp == NULL)) return; portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4); @@ -4248,7 +4248,7 @@ static void stl_sc26198sendflow(stlport_t *portp, int hw, int sw) (int) portp, hw, sw); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return; crit_enter(); @@ -4308,7 +4308,7 @@ static int stl_sc26198datastate(stlport_t *portp) kprintf("stl_sc26198datastate(portp=%x)\n", (int) portp); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return(0); if (portp->state & ASY_TXBUSY) return(1); @@ -4331,7 +4331,7 @@ static void stl_sc26198flush(stlport_t *portp, int flag) kprintf("stl_sc26198flush(portp=%x,flag=%x)\n", (int) portp, flag); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return; crit_enter(); @@ -4383,7 +4383,7 @@ static void stl_sc26198wait(stlport_t *portp) kprintf("stl_sc26198wait(portp=%x)\n", (int) portp); #endif - if (portp == (stlport_t *) NULL) + if (portp == NULL) return; for (i = 0; (i < 20); i++) diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c index 233b90650e..577a1ae62f 100644 --- a/sys/dev/serial/stli/istallion.c +++ b/sys/dev/serial/stli/istallion.c @@ -308,18 +308,18 @@ static char *stli_brdnames[] = { "Brumby", "Brumby", "ONboard-EI", - (char *) NULL, + NULL, "ONboard", "ONboard-MC", "ONboard-MC", - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, - (char *) NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, "EasyIO", "EC8/32-AT", "EC8/32-MC", @@ -668,7 +668,7 @@ static int stli_findfreeunit(void) int i; for (i = 0; (i < STL_MAXBRDS); i++) - if (stli_brds[i] == (stlibrd_t *) NULL) + if (stli_brds[i] == NULL) break; return((i >= STL_MAXBRDS) ? -1 : i); } @@ -802,7 +802,7 @@ static int stliprobe(struct isa_device *idp) * Go ahead and try probing for the shared memory region now. * This way we will really know if the board is here... */ - if ((brdp = stli_brdalloc()) == (stlibrd_t *) NULL) + if ((brdp = stli_brdalloc()) == NULL) return(0); brdp->brdnr = stli_findfreeunit(); @@ -821,7 +821,7 @@ static int stliprobe(struct isa_device *idp) stli_stliprobed[idp->id_unit] = brdp->brdnr; stli_brdinit(brdp); if ((brdp->state & BST_FOUND) == 0) { - stli_brds[brdp->brdnr] = (stlibrd_t *) NULL; + stli_brds[brdp->brdnr] = NULL; return(0); } stli_nrbrds++; @@ -846,7 +846,7 @@ static int stliattach(struct isa_device *idp) brdnr = stli_stliprobed[idp->id_unit]; brdp = stli_brds[brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(0); if (brdp->state & BST_FOUND) stli_brdattach(brdp); @@ -875,7 +875,7 @@ STATIC int stliopen(struct dev_open_args *ap) return(0); portp = stli_dev2port(dev); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENXIO); if (minor(dev) & STL_CTRLDEV) return(0); @@ -1004,7 +1004,7 @@ STATIC int stliclose(struct dev_close_args *ap) return(0); portp = stli_dev2port(dev); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENXIO); tp = &portp->tty; @@ -1034,7 +1034,7 @@ STATIC int stliread(struct dev_read_args *ap) return(ENODEV); portp = stli_dev2port(dev); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENODEV); return ttyread(ap); } @@ -1083,7 +1083,7 @@ STATIC int stliwrite(struct dev_write_args *ap) if (minor(dev) & STL_CTRLDEV) return(ENODEV); portp = stli_dev2port(dev); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENODEV); return ttywrite(ap); } @@ -1111,9 +1111,9 @@ STATIC int stliioctl(struct dev_ioctl_args *ap) return(stli_memioctl(dev, cmd, data, ap->a_fflag)); portp = stli_dev2port(dev); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENODEV); - if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL) + if ((brdp = stli_brds[portp->brdnr]) == NULL) return(ENODEV); tp = &portp->tty; error = 0; @@ -1308,10 +1308,10 @@ STATIC stliport_t *stli_dev2port(cdev_t dev) stlibrd_t *brdp; brdp = stli_brds[MKDEV2BRD(dev)]; - if (brdp == (stlibrd_t *) NULL) - return((stliport_t *) NULL); + if (brdp == NULL) + return(NULL); if ((brdp->state & BST_STARTED) == 0) - return((stliport_t *) NULL); + return(NULL); return(brdp->ports[MKDEV2PORT(dev)]); } @@ -1336,7 +1336,7 @@ static int stli_initopen(stliport_t *portp) kprintf("stli_initopen(portp=%x)\n", (int) portp); #endif - if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL) + if ((brdp = stli_brds[portp->brdnr]) == NULL) return(ENXIO); if (portp->state & ST_INITIALIZED) return(0); @@ -1390,7 +1390,7 @@ static int stli_shutdownclose(stliport_t *portp) (void *) portp, portp->brdnr, portp->panelnr, portp->portnr); #endif - if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL) + if ((brdp = stli_brds[portp->brdnr]) == NULL) return(ENXIO); tp = &portp->tty; @@ -1687,7 +1687,7 @@ static void stli_start(struct tty *tp) */ if (tp->t_outq.c_cc != 0) { brdp = stli_brds[portp->brdnr]; - if (brdp == (stlibrd_t *) NULL) { + if (brdp == NULL) { crit_exit(); return; } @@ -1761,7 +1761,7 @@ static int stli_param(struct tty *tp, struct termios *tiosp) int rc; portp = (stliport_t *) tp; - if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL) + if ((brdp = stli_brds[portp->brdnr]) == NULL) return(ENXIO); crit_enter(); @@ -1791,12 +1791,12 @@ static void stli_flush(stliport_t *portp, int flag) kprintf("stli_flush(portp=%x,flag=%x)\n", (int) portp, flag); #endif - if (portp == (stliport_t *) NULL) + if (portp == NULL) return; if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) return; brdp = stli_brds[portp->brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return; crit_enter(); @@ -1980,7 +1980,7 @@ static void stli_rxprocess(stlibrd_t *brdp, stliport_t *portp) tail -= size; } rp->tail = tail; - stli_rxtmpport = (stliport_t *) NULL; + stli_rxtmpport = NULL; stli_rxtmplen = 0; } @@ -2268,7 +2268,7 @@ static void stli_poll(void *arg) */ for (brdnr = 0; (brdnr < stli_nrbrds); brdnr++) { brdp = stli_brds[brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) continue; if ((brdp->state & BST_STARTED) == 0) continue; @@ -3294,7 +3294,7 @@ static int stli_startbrd(stlibrd_t *brdp) if (memp->dtype != TYP_ASYNC) break; portp = brdp->ports[portnr]; - if (portp == (stliport_t *) NULL) + if (portp == NULL) break; portp->devnr = i; portp->addr = memp->offset; @@ -3313,12 +3313,12 @@ static int stli_startbrd(stlibrd_t *brdp) */ for (i = 1, portnr = 0; (i < nrdevs); i++, portnr++) { portp = brdp->ports[portnr]; - if (portp == (stliport_t *) NULL) + if (portp == NULL) break; if (portp->addr == 0) break; ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); - if (ap != (volatile cdkasy_t *) NULL) { + if (ap != NULL) { portp->rxsize = ap->rxq.size; portp->txsize = ap->txq.size; portp->rxoffset = ap->rxq.offset; @@ -3439,7 +3439,7 @@ static int stli_getbrdstats(caddr_t data) if (stli_brdstats.brd >= STL_MAXBRDS) return(ENODEV); brdp = stli_brds[stli_brdstats.brd]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(ENODEV); bzero(&stli_brdstats, sizeof(combrd_t)); @@ -3473,14 +3473,14 @@ static stliport_t *stli_getport(int brdnr, int panelnr, int portnr) int i; if ((brdnr < 0) || (brdnr >= STL_MAXBRDS)) - return((stliport_t *) NULL); + return(NULL); brdp = stli_brds[brdnr]; - if (brdp == (stlibrd_t *) NULL) - return((stliport_t *) NULL); + if (brdp == NULL) + return(NULL); for (i = 0; (i < panelnr); i++) portnr += brdp->panels[i]; if ((portnr < 0) || (portnr >= brdp->nrports)) - return((stliport_t *) NULL); + return(NULL); return(brdp->ports[portnr]); } @@ -3497,16 +3497,16 @@ static int stli_getportstats(stliport_t *portp, caddr_t data) stlibrd_t *brdp; int rc; - if (portp == (stliport_t *) NULL) { + if (portp == NULL) { stli_comstats = *((comstats_t *) data); portp = stli_getport(stli_comstats.brd, stli_comstats.panel, stli_comstats.port); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENODEV); } brdp = stli_brds[portp->brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(ENODEV); if (brdp->state & BST_STARTED) { @@ -3563,16 +3563,16 @@ static int stli_clrportstats(stliport_t *portp, caddr_t data) stlibrd_t *brdp; int rc; - if (portp == (stliport_t *) NULL) { + if (portp == NULL) { stli_comstats = *((comstats_t *) data); portp = stli_getport(stli_comstats.brd, stli_comstats.panel, stli_comstats.port); - if (portp == (stliport_t *) NULL) + if (portp == NULL) return(ENODEV); } brdp = stli_brds[portp->brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(ENODEV); if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0) @@ -3609,7 +3609,7 @@ STATIC int stli_memrw(cdev_t dev, struct uio *uiop, int flag) brdnr = minor(dev) & 0x7; brdp = stli_brds[brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(ENODEV); if (brdp->state == 0) return(ENODEV); @@ -3659,10 +3659,10 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag) */ switch (cmd) { case COM_GETPORTSTATS: - return(stli_getportstats((stliport_t *) NULL, data)); + return(stli_getportstats(NULL, data)); break; case COM_CLRPORTSTATS: - return(stli_clrportstats((stliport_t *) NULL, data)); + return(stli_clrportstats(NULL, data)); break; case COM_GETBRDSTATS: return(stli_getbrdstats(data)); @@ -3676,7 +3676,7 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag) */ brdnr = minor(dev) & 0x7; brdp = stli_brds[brdnr]; - if (brdp == (stlibrd_t *) NULL) + if (brdp == NULL) return(ENODEV); if (brdp->state == 0) return(ENODEV); @@ -3702,10 +3702,10 @@ static int stli_memioctl(cdev_t dev, unsigned long cmd, caddr_t data, int flag) } break; case COM_GETPORTSTATS: - rc = stli_getportstats((stliport_t *) NULL, data); + rc = stli_getportstats(NULL, data); break; case COM_CLRPORTSTATS: - rc = stli_clrportstats((stliport_t *) NULL, data); + rc = stli_clrportstats(NULL, data); break; case COM_GETBRDSTATS: rc = stli_getbrdstats(data); diff --git a/sys/emulation/ndis/subr_ntoskrnl.c b/sys/emulation/ndis/subr_ntoskrnl.c index ceb2c0d84c..750c6147a4 100644 --- a/sys/emulation/ndis/subr_ntoskrnl.c +++ b/sys/emulation/ndis/subr_ntoskrnl.c @@ -1198,13 +1198,13 @@ ntoskrnl_free_ansi_string(ndis_ansi_string *astr) static int atoi(const char *str) { - return (int)strtol(str, (char **)NULL, 10); + return (int)strtol(str, NULL, 10); } static long atol(const char *str) { - return strtol(str, (char **)NULL, 10); + return strtol(str, NULL, 10); } static int diff --git a/sys/kern/inflate.c b/sys/kern/inflate.c index e519cc5311..ff27d8e123 100644 --- a/sys/kern/inflate.c +++ b/sys/kern/inflate.c @@ -463,7 +463,7 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s, p++; /* assume all entries <= BMAX */ } while (--i); if (c[0] == n) { /* null input--all zero length codes */ - *t = (struct huft *) NULL; + *t = NULL; *m = 0; return 0; } @@ -510,8 +510,8 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s, p = v; /* grab values in bit order */ h = -1; /* no tables yet--level -1 */ w = l[-1] = 0; /* no bits decoded yet */ - u[0] = (struct huft *) NULL; /* just to keep compilers happy */ - q = (struct huft *) NULL; /* ditto */ + u[0] = NULL; /* just to keep compilers happy */ + q = NULL; /* ditto */ z = 0; /* ditto */ /* go through the bit lengths (k already is bits in shortest code) */ @@ -558,7 +558,7 @@ huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s, glbl->gz_hufts += z + 1; /* track memory usage */ *t = q + 1; /* link to list for * huft_free() */ - *(t = &(q->v.t)) = (struct huft *) NULL; + *(t = &(q->v.t)) = NULL; u[h] = ++q; /* table starts after link */ /* connect to last table, if there is one */ @@ -627,7 +627,7 @@ huft_free(struct inflate *glbl, struct huft *t) /* Go through linked list, freeing from the malloced (t[-1]) address. */ p = t; - while (p != (struct huft *) NULL) { + while (p != NULL) { q = (--p)->v.t; kfree(p, M_GZIP); p = q; @@ -784,7 +784,7 @@ static int inflate_fixed(struct inflate *glbl) { /* if first time, set up tables for fixed blocks */ - if (glbl->gz_fixed_tl == (struct huft *) NULL) { + if (glbl->gz_fixed_tl == NULL) { int i; /* temporary variable */ static unsigned l[288]; /* length list for huft_build */ @@ -801,7 +801,7 @@ inflate_fixed(struct inflate *glbl) glbl->gz_fixed_bl = 7; if ((i = huft_build(glbl, l, 288, 257, cplens, cplext, &glbl->gz_fixed_tl, &glbl->gz_fixed_bl)) != 0) { - glbl->gz_fixed_tl = (struct huft *) NULL; + glbl->gz_fixed_tl = NULL; return i; } /* distance table */ @@ -812,7 +812,7 @@ inflate_fixed(struct inflate *glbl) if ((i = huft_build(glbl, l, 30, 0, cpdist, cpdext, &glbl->gz_fixed_td, &glbl->gz_fixed_bd)) > 1) { huft_free(glbl, glbl->gz_fixed_tl); - glbl->gz_fixed_tl = (struct huft *) NULL; + glbl->gz_fixed_tl = NULL; return i; } } @@ -1012,7 +1012,7 @@ xinflate(struct inflate *glbl) int r; /* result code */ unsigned h; /* maximum struct huft's malloc'ed */ - glbl->gz_fixed_tl = (struct huft *) NULL; + glbl->gz_fixed_tl = NULL; /* initialize window, bit buffer */ glbl->gz_wp = 0; @@ -1055,13 +1055,13 @@ inflate(struct inflate *glbl) #endif i = xinflate(glbl); - if (glbl->gz_fixed_td != (struct huft *) NULL) { + if (glbl->gz_fixed_td != NULL) { huft_free(glbl, glbl->gz_fixed_td); - glbl->gz_fixed_td = (struct huft *) NULL; + glbl->gz_fixed_td = NULL; } - if (glbl->gz_fixed_tl != (struct huft *) NULL) { + if (glbl->gz_fixed_tl != NULL) { huft_free(glbl, glbl->gz_fixed_tl); - glbl->gz_fixed_tl = (struct huft *) NULL; + glbl->gz_fixed_tl = NULL; } #ifdef _KERNEL if (p == glbl->gz_slide) { diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c index 46d230bee5..dfee4d26bd 100644 --- a/sys/kern/subr_scanf.c +++ b/sys/kern/subr_scanf.c @@ -509,7 +509,7 @@ literal: u_quad_t res; *p = 0; - res = (*ccfn)(buf, (char **)NULL, base); + res = (*ccfn)(buf, NULL, base); if (flags & POINTER) *__va_arg(ap, void **) = (void *)(uintptr_t)res; diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 2b6ca59cac..774f90e260 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -196,7 +196,7 @@ found: return (pr); if (type == SOCK_RAW && pr->pr_type == SOCK_RAW && - pr->pr_protocol == 0 && maybe == (struct protosw *)NULL) + pr->pr_protocol == 0 && maybe == NULL) maybe = pr; } return (maybe); diff --git a/sys/net/if.c b/sys/net/if.c index b591c7627a..98100d6424 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -770,7 +770,7 @@ if_rtdel(struct radix_node *rn, void *arg) err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, rt_mask(rt), rt->rt_flags, - (struct rtentry **) NULL); + NULL); if (err) { log(LOG_WARNING, "if_rtdel: error %d\n", err); } @@ -1586,7 +1586,7 @@ ifpromisc(struct ifnet *ifp, int pswitch) ifr.ifr_flagshigh = ifp->if_flags >> 16; lwkt_serialize_enter(ifp->if_serializer); error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr, - (struct ucred *)NULL); + NULL); lwkt_serialize_exit(ifp->if_serializer); if (error == 0) rt_ifmsg(ifp); @@ -1704,7 +1704,7 @@ if_allmulti(struct ifnet *ifp, int onswitch) ifr.ifr_flagshigh = ifp->if_flags >> 16; lwkt_serialize_enter(ifp->if_serializer); error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr, - (struct ucred *)NULL); + NULL); lwkt_serialize_exit(ifp->if_serializer); } } else { @@ -1717,7 +1717,7 @@ if_allmulti(struct ifnet *ifp, int onswitch) ifr.ifr_flagshigh = ifp->if_flags >> 16; lwkt_serialize_enter(ifp->if_serializer); error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr, - (struct ucred *)NULL); + NULL); lwkt_serialize_exit(ifp->if_serializer); } } @@ -1818,7 +1818,7 @@ if_addmulti( */ crit_enter(); lwkt_serialize_enter(ifp->if_serializer); - ifp->if_ioctl(ifp, SIOCADDMULTI, 0, (struct ucred *)NULL); + ifp->if_ioctl(ifp, SIOCADDMULTI, 0, NULL); lwkt_serialize_exit(ifp->if_serializer); crit_exit(); @@ -1855,7 +1855,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) */ if (ifma->ifma_addr->sa_family == AF_LINK && sa == 0) { lwkt_serialize_enter(ifp->if_serializer); - ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL); + ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL); lwkt_serialize_exit(ifp->if_serializer); } crit_exit(); @@ -1889,7 +1889,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) crit_enter(); lwkt_serialize_enter(ifp->if_serializer); LIST_REMOVE(ifma, ifma_link); - ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL); + ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL); lwkt_serialize_exit(ifp->if_serializer); crit_exit(); kfree(ifma->ifma_addr, M_IFMADDR); @@ -1939,12 +1939,12 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len) ifr.ifr_flags = ifp->if_flags; ifr.ifr_flagshigh = ifp->if_flags >> 16; ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr, - (struct ucred *)NULL); + NULL); ifp->if_flags |= IFF_UP; ifr.ifr_flags = ifp->if_flags; ifr.ifr_flagshigh = ifp->if_flags >> 16; ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr, - (struct ucred *)NULL); + NULL); #ifdef INET /* * Also send gratuitous ARPs to notify other nodes about diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 79f746844a..28dafecbca 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -268,7 +268,7 @@ if_clone_lookup(const char *name, int *unitp) } /* No match. */ - return ((struct if_clone *)NULL); + return (NULL); found_name: if (*cp == '\0') { diff --git a/sys/netgraph7/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph7/bluetooth/socket/ng_btsocket_rfcomm.c index 0f232cb4c2..d37ff5fef4 100644 --- a/sys/netgraph7/bluetooth/socket/ng_btsocket_rfcomm.c +++ b/sys/netgraph7/bluetooth/socket/ng_btsocket_rfcomm.c @@ -1598,8 +1598,7 @@ ng_btsocket_rfcomm_session_receive(ng_btsocket_rfcomm_session_p s) flags = MSG_DONTWAIT; m = NULL; - error = soreceive(s->l2so, NULL, &uio, &m, - (struct mbuf **) NULL, &flags); + error = soreceive(s->l2so, NULL, &uio, &m, NULL, &flags); if (error != 0) { if (error == EWOULDBLOCK) return (0); /* XXX can happen? */ diff --git a/sys/netinet/if_atm.c b/sys/netinet/if_atm.c index a228a058ef..d8f30a23b4 100644 --- a/sys/netinet/if_atm.c +++ b/sys/netinet/if_atm.c @@ -174,8 +174,8 @@ failed: rt->rt_flags &= ~RTF_LLINFO; } #endif - rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *) NULL, - rt_mask(rt), 0, (struct rtentry **) NULL); + rtrequest(RTM_DELETE, rt_key(rt), NULL, + rt_mask(rt), 0, NULL); break; case RTM_DELETE: @@ -199,7 +199,7 @@ failed: api.rxhand = NULL; lwkt_serialize_enter(rt->rt_ifp->if_serializer); rt->rt_ifp->if_ioctl(rt->rt_ifp, SIOCATMDIS, (caddr_t)&api, - (struct ucred *)NULL); + NULL); lwkt_serialize_exit(rt->rt_ifp->if_serializer); break; } diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 9f7bfe1f8e..d937d798f0 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -472,7 +472,7 @@ in_pcbladdr(struct inpcb *inp, struct sockaddr *nam, if (inp->inp_laddr.s_addr == INADDR_ANY) { struct route *ro; - ia = (struct in_ifaddr *)NULL; + ia = NULL; /* * If route is known or can be allocated now, * our src addr is taken from the i/f, else punt. @@ -487,11 +487,11 @@ in_pcbladdr(struct inpcb *inp, struct sockaddr *nam, sin->sin_addr.s_addr || inp->inp_socket->so_options & SO_DONTROUTE)) { RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + ro->ro_rt = NULL; } if (!(inp->inp_socket->so_options & SO_DONTROUTE) && /*XXX*/ - (ro->ro_rt == (struct rtentry *)NULL || - ro->ro_rt->rt_ifp == (struct ifnet *)NULL)) { + (ro->ro_rt == NULL || + ro->ro_rt->rt_ifp == NULL)) { /* No route yet, so try to acquire one */ bzero(&ro->ro_dst, sizeof(struct sockaddr_in)); ro->ro_dst.sa_family = AF_INET; @@ -621,7 +621,7 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct thread *td) } if (inp->inp_laddr.s_addr == INADDR_ANY) { if (inp->inp_lport == 0) { - error = in_pcbbind(inp, (struct sockaddr *)NULL, td); + error = in_pcbbind(inp, NULL, td); if (error) return (error); } diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 16a8241e70..5b1afc6c64 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -313,7 +313,7 @@ div_packet(struct mbuf *m, int incoming, int port) } if (sa) { if (ssb_appendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc, m, - (struct mbuf *)NULL) == 0) + NULL) == 0) m_freem(m); else sorwakeup(sa); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 3fc57960b1..ab53a0f73c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -327,7 +327,7 @@ reroute: dst->sin_family != AF_INET || dst->sin_addr.s_addr != pkt_dst.s_addr)) { rtfree(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + ro->ro_rt = NULL; } if (ro->ro_rt == NULL) { bzero(dst, sizeof *dst); @@ -1186,7 +1186,7 @@ smart_frag_failure: goto done; } m->m_pkthdr.len = mhlen + len; - m->m_pkthdr.rcvif = (struct ifnet *)NULL; + m->m_pkthdr.rcvif = NULL; m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags; mhip->ip_off = htons(mhip->ip_off); mhip->ip_sum = 0; @@ -1274,7 +1274,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen) *phlen = 0; return (m); } - n->m_pkthdr.rcvif = (struct ifnet *)NULL; + n->m_pkthdr.rcvif = NULL; n->m_pkthdr.len = m->m_pkthdr.len + optlen; m->m_len -= sizeof(struct ip); m->m_data += sizeof(struct ip); diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 8662c64b6c..be68768444 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -2469,7 +2469,7 @@ sctp_service_queues(struct sctp_tcb *stcb, struct sctp_association *asoc, int ho break; } /* If deliver_data says no we must stop */ - if (sctp_deliver_data(stcb, asoc, (struct sctp_tmit_chunk *)NULL, hold_locks) == 0) + if (sctp_deliver_data(stcb, asoc, NULL, hold_locks) == 0) break; cntDel++; chk = TAILQ_FIRST(&asoc->delivery_queue); @@ -3973,7 +3973,7 @@ sctp_handle_sack(struct sctp_sack_chunk *ch, struct sctp_tcb *stcb, SCTP_RECEIVED_SACK, (void *)net); /* now was it the primary? if so restore */ if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); + sctp_set_primary_addr(stcb, NULL, net); } } } diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 551f745b99..fbe20f8860 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -498,7 +498,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp, /* now was it the primary? if so restore */ if (r_net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, r_net); + sctp_set_primary_addr(stcb, NULL, r_net); } } /* Now lets do a RTO with this */ @@ -1526,7 +1526,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, } #endif /* SCTP_DEBUG */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, + sctp_abort_association(inp, NULL, m, iphlen, sh, op_err); return (NULL); } @@ -1548,7 +1548,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, * was in flight. Only recourse is to abort the association. */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, + sctp_abort_association(inp, NULL, m, iphlen, sh, op_err); return (NULL); } @@ -2082,7 +2082,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, if (netl) { if (netl->dest_state & SCTP_ADDR_UNCONFIRMED) { netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED; - sctp_set_primary_addr((*stcb), (struct sockaddr *)NULL, + sctp_set_primary_addr((*stcb), NULL, netl); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, (*stcb), 0, (void *)netl); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 5acfd4bbe7..a1938a2ea9 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -2307,7 +2307,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, alt = sctp_find_alternate_net(stcb, net); if (alt != net) { if (sctp_set_primary_addr(stcb, - (struct sockaddr *)NULL, + NULL, alt) == 0) { net->dest_state |= SCTP_ADDR_WAS_PRIMARY; net->src_addr_selected = 0; @@ -2338,7 +2338,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, ro, o_flgs, inp->ip_inp.inp.inp_moptions #if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD_version >= 480000) \ || defined(__DragonFly__) - , (struct inpcb *)NULL + , NULL #endif #if defined(__NetBSD__) ,(struct socket *)inp->sctp_socket @@ -2494,7 +2494,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, alt = sctp_find_alternate_net(stcb, net); if (alt != net) { if (sctp_set_primary_addr(stcb, - (struct sockaddr *)NULL, + NULL, alt) == 0) { net->dest_state |= SCTP_ADDR_WAS_PRIMARY; net->src_addr_selected = 0; diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index ceca83a317..5583efb620 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2994,11 +2994,11 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, #endif if ((err = sctp_inpcb_bind(inp->sctp_socket, - (struct sockaddr *)NULL, + NULL, #if (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__DragonFly__) - (struct thread *)NULL + NULL #else - (struct proc *)NULL + NULL #endif ))){ /* bind error, probably perm */ diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 5f9f7ea1a2..b66a735b57 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -830,7 +830,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * from any net structures. */ if (sctp_set_primary_addr(stcb, - (struct sockaddr *)NULL, + NULL, alt) == 0) { net->dest_state |= SCTP_ADDR_WAS_PRIMARY; net->src_addr_selected = 0; diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index d3d40e4f64..0a6f4f6391 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -3411,7 +3411,7 @@ sctp_optsset(struct socket *so, lnet = stcb->asoc.primary_destination; lnet->next_tsn_at_change = net->next_tsn_at_change = stcb->asoc.sending_seq; if (sctp_set_primary_addr(stcb, - (struct sockaddr *)NULL, + NULL, net) == 0) { if (net->dest_state & SCTP_ADDR_SWITCH_PRIMARY) { net->dest_state |= SCTP_ADDR_DOUBLE_SWITCH; @@ -3704,11 +3704,11 @@ sctp_ctloutput(int op, struct socket *so, int level, int optname, } /* Ok if we reach here it is a SCTP option we hope */ if (op == PRCO_SETOPT) { - error = sctp_optsset(so, optname, mp, (struct proc *)NULL); + error = sctp_optsset(so, optname, mp, NULL); if (*mp) m_free(*mp); } else if (op == PRCO_GETOPT) { - error = sctp_optsget(so, optname, mp, (struct proc *)NULL); + error = sctp_optsget(so, optname, mp, NULL); } else { error = EINVAL; } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 69fb29ac97..c0f736dab7 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -636,7 +636,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } m->m_len = tlen; m->m_pkthdr.len = tlen; - m->m_pkthdr.rcvif = (struct ifnet *) NULL; + m->m_pkthdr.rcvif = NULL; nth->th_seq = htonl(seq); nth->th_ack = htonl(ack); nth->th_x2 = 0; diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index a7944a5d0d..1aeb860373 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -358,7 +358,7 @@ tcp_timer_keep_handler(struct tcpcb *tp) t_template = tcp_maketemplate(tp); if (t_template) { tcp_respond(tp, t_template->tt_ipgen, - &t_template->tt_t, (struct mbuf *)NULL, + &t_template->tt_t, NULL, tp->rcv_nxt, tp->snd_una - 1, 0); tcp_freetemplate(t_template); } diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 9f555b88b2..1756e83c22 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1024,7 +1024,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) #endif if (inp->inp_lport == 0) { - error = in_pcbbind(inp, (struct sockaddr *)NULL, td); + error = in_pcbbind(inp, NULL, td); if (error) return (error); } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 0cfb72d370..ac1c849b5b 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -748,7 +748,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *dstaddr, } if (inp->inp_lport == 0) { /* unbound socket */ - error = in_pcbbind(inp, (struct sockaddr *)NULL, td); + error = in_pcbbind(inp, NULL, td); if (error) goto release; in_pcbinswildcardhash(inp); diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 45ce3642c5..a73a8a69e6 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -162,7 +162,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) (!(ro.ro_rt->rt_flags & RTF_UP) || !IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6->ip6_dst))) { rtfree(ro.ro_rt); - ro.ro_rt = (struct rtentry *)NULL; + ro.ro_rt = NULL; } if (ro.ro_rt == NULL) { bzero(dst, sizeof(*dst)); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index db6832e3e0..9d454e6b72 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2291,7 +2291,7 @@ icmp6_redirect_input(struct mbuf *m, int off) bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr)); bcopy(&src6, &ssrc.sin6_addr, sizeof(struct in6_addr)); rtredirect((struct sockaddr *)&sdst, (struct sockaddr *)&sgw, - (struct sockaddr *)NULL, RTF_GATEWAY | RTF_HOST, + NULL, RTF_GATEWAY | RTF_HOST, (struct sockaddr *)&ssrc); } /* finally update cached route in each socket via kpfctlinput */ @@ -2400,9 +2400,9 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt) sin6 = (struct sockaddr_in6 *)rt->rt_gateway; router_ll6 = &sin6->sin6_addr; if (!IN6_IS_ADDR_LINKLOCAL(router_ll6)) - router_ll6 = (struct in6_addr *)NULL; + router_ll6 = NULL; } else - router_ll6 = (struct in6_addr *)NULL; + router_ll6 = NULL; /* ip6 */ ip6 = mtod(m, struct ip6_hdr *); diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index ef148f6fe7..5c1b218c35 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1590,8 +1590,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, struct sockaddr_in6 *sin6, ia->ia_addr = *sin6; if (ifacount <= 1 && ifp->if_ioctl && - (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, - (struct ucred *)NULL))) { + (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, NULL))) { lwkt_serialize_exit(ifp->if_serializer); return (error); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index b93711d0df..7187834677 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -128,7 +128,7 @@ int in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct thread *td) { struct socket *so = inp->inp_socket; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL; + struct sockaddr_in6 *sin6 = NULL; struct sockaddr_in6 jsin6; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct proc *p = td->td_proc; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index e91931560c..381d7b7215 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1308,7 +1308,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, ((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 || !IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) { RTFREE(ro_pmtu->ro_rt); - ro_pmtu->ro_rt = (struct rtentry *)NULL; + ro_pmtu->ro_rt = NULL; } if (ro_pmtu->ro_rt == NULL) { bzero(sa6_dst, sizeof(*sa6_dst)); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 78e4465fe5..681d09bb40 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -121,8 +121,8 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) char *lladdr = NULL; int lladdrlen = 0; #if 0 - struct sockaddr_dl *sdl = (struct sockaddr_dl *)NULL; - struct llinfo_nd6 *ln = (struct llinfo_nd6 *)NULL; + struct sockaddr_dl *sdl = NULL; + struct llinfo_nd6 *ln = NULL; struct rtentry *rt = NULL; int is_newentry; #endif diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 707e548f52..d8e066481e 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -586,7 +586,7 @@ sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d) if (d != NULL) { ip6cp = (struct ip6ctlparam *)d; } else { - ip6cp = (struct ip6ctlparam *)NULL; + ip6cp = NULL; } if (ip6cp) { diff --git a/sys/netproto/atm/atm_if.c b/sys/netproto/atm/atm_if.c index d10d928b7a..46eacf2290 100644 --- a/sys/netproto/atm/atm_if.c +++ b/sys/netproto/atm/atm_if.c @@ -192,7 +192,7 @@ atm_physif_deregister(Cmn_unit *cup) atm_free(cvp); cvp = cvp->cv_next; } - cup->cu_vcc = (Cmn_vcc *)NULL; + cup->cu_vcc = NULL; crit_exit(); @@ -231,7 +231,7 @@ atm_physif_freenifs(struct atm_pif *pip) atm_free ((caddr_t)nip); nip = nipp; } - pip->pif_nif = (struct atm_nif *)NULL; + pip->pif_nif = NULL; crit_exit(); @@ -874,7 +874,7 @@ atm_netif_rtdel(struct radix_node *rn, void *arg) err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, rt_mask(rt), rt->rt_flags, - (struct rtentry **) NULL); + NULL); if (err) { log(LOG_WARNING, "atm_netif_rtdel: error %d\n", err); } diff --git a/sys/netproto/atm/queue.h b/sys/netproto/atm/queue.h index dceb07be23..ff3180fe7e 100644 --- a/sys/netproto/atm/queue.h +++ b/sys/netproto/atm/queue.h @@ -138,14 +138,14 @@ typedef struct q_elem Qelem_t; */ #define LINK2TAIL(u,t,h,l) \ { \ - (u)->l = (t *)NULL; \ + (u)->l = NULL; \ /* Check for empty chain */ \ - if ((h) == (t *)NULL) { \ + if ((h) == NULL) { \ (h) = (u); \ } else { \ t *tp; \ /* Loop until we find the end of chain */ \ - for (tp = (h); tp->l != (t *)NULL; tp = tp->l) \ + for (tp = (h); tp->l != NULL; tp = tp->l) \ ; \ tp->l = (u); \ } \ @@ -166,7 +166,7 @@ typedef struct q_elem Qelem_t; } else { \ t *tp; \ /* Loop until we find the control block */ \ - for (tp = (h); tp != (t *)NULL; tp = tp->l) { \ + for (tp = (h); tp != NULL; tp = tp->l) { \ if (tp->l == (u)) \ break; \ } \ @@ -175,7 +175,7 @@ typedef struct q_elem Qelem_t; tp->l = (u)->l; \ } \ } \ - (u)->l = (t *)NULL; \ + (u)->l = NULL; \ } /* @@ -196,7 +196,7 @@ typedef struct q_elem Qelem_t; } else { \ t *tp; \ /* Loop until we find the control block */ \ - for (tp = (h); tp != (t *)NULL; tp = tp->l) { \ + for (tp = (h); tp != NULL; tp = tp->l) { \ if (tp->l == (u)) \ break; \ } \ @@ -208,7 +208,7 @@ typedef struct q_elem Qelem_t; /* It wasn't on the chain */ \ (f) = 0; \ } \ - (u)->l = (t *)NULL; \ + (u)->l = NULL; \ } #endif /* _NETATM_QUEUE_H */ diff --git a/sys/netproto/atm/uni/unisig_if.c b/sys/netproto/atm/uni/unisig_if.c index d304895dcb..e2347765dd 100644 --- a/sys/netproto/atm/uni/unisig_if.c +++ b/sys/netproto/atm/uni/unisig_if.c @@ -961,8 +961,7 @@ unisig_ioctl(int code, caddr_t data, caddr_t arg1) /* * Pass event to signalling manager state machine */ - err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET, - (KBuffer *) NULL); + err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET, NULL); /* * Clean up if there was an error diff --git a/sys/netproto/atm/uni/unisig_vc_state.c b/sys/netproto/atm/uni/unisig_vc_state.c index a6b33e9453..50a1e96490 100644 --- a/sys/netproto/atm/uni/unisig_vc_state.c +++ b/sys/netproto/atm/uni/unisig_vc_state.c @@ -1177,8 +1177,7 @@ unisig_vc_act12(struct unisig *usp, struct unisig_vccb *uvp, /* * Send the RELEASE message */ - rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL, - T_ATM_ABSENT); + rc = unisig_vc_clear_call(usp, uvp, NULL, T_ATM_ABSENT); return(rc); } diff --git a/sys/netproto/ipsec/key.c b/sys/netproto/ipsec/key.c index edf2a0c67c..f8267705a3 100644 --- a/sys/netproto/ipsec/key.c +++ b/sys/netproto/ipsec/key.c @@ -2536,7 +2536,7 @@ key_delsah(struct secashead *sah) LIST_REMOVE(sah, chain); if (sah->sa_route.ro_rt) { RTFREE(sah->sa_route.ro_rt); - sah->sa_route.ro_rt = (struct rtentry *)NULL; + sah->sa_route.ro_rt = NULL; } KFREE(sah); } @@ -6903,7 +6903,7 @@ key_sa_routechange(struct sockaddr *dst) if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len && bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) { RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + ro->ro_rt = NULL; } } diff --git a/sys/netproto/ipsec/xform_esp.c b/sys/netproto/ipsec/xform_esp.c index 282c26a14d..a9d05844c4 100644 --- a/sys/netproto/ipsec/xform_esp.c +++ b/sys/netproto/ipsec/xform_esp.c @@ -650,7 +650,7 @@ esp_output( struct enc_xform *espx; struct auth_hash *esph; int hlen, rlen, plen, padding, blks, alen, i, roff; - struct mbuf *mo = (struct mbuf *) NULL; + struct mbuf *mo = NULL; struct tdb_crypto *tc; struct secasvar *sav; struct secasindex *saidx; diff --git a/sys/netproto/ipx/ipx.c b/sys/netproto/ipx/ipx.c index e7c03b8fce..66ae830111 100644 --- a/sys/netproto/ipx/ipx.c +++ b/sys/netproto/ipx/ipx.c @@ -272,8 +272,7 @@ ipx_ifinit(struct ifnet *ifp, struct ipx_ifaddr *ia, */ lwkt_serialize_enter(ifp->if_serializer); if (ifp->if_ioctl != NULL && - (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia, - (struct ucred *)NULL))) { + (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia, NULL))) { ia->ia_addr = oldaddr; lwkt_serialize_exit(ifp->if_serializer); return (error); diff --git a/sys/netproto/ipx/ipx_ip.c b/sys/netproto/ipx/ipx_ip.c index 4f4cab588a..b37618593e 100644 --- a/sys/netproto/ipx/ipx_ip.c +++ b/sys/netproto/ipx/ipx_ip.c @@ -275,7 +275,7 @@ ipxipoutput_serialized(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, /* * Output final datagram. */ - error = (ip_output(m, (struct mbuf *)NULL, ro, SO_BROADCAST, NULL, NULL)); + error = (ip_output(m, NULL, ro, SO_BROADCAST, NULL, NULL)); if (error) { ifn->ifen_ifnet.if_oerrors++; ifn->ifen_ifnet.if_ierrors = error; diff --git a/sys/netproto/ipx/ipx_pcb.c b/sys/netproto/ipx/ipx_pcb.c index 36be535b9b..61c147e4f2 100644 --- a/sys/netproto/ipx/ipx_pcb.c +++ b/sys/netproto/ipx/ipx_pcb.c @@ -238,7 +238,7 @@ ipx_pcbconnect(struct ipxpcb *ipxp, struct sockaddr *nam, struct thread *td) if (ipx_pcblookup(&sipx->sipx_addr, ipxp->ipxp_lport, 0)) return (EADDRINUSE); if (ipxp->ipxp_lport == 0) - ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td); + ipx_pcbbind(ipxp, NULL, td); /* XXX just leave it zero if we can't find a route */ diff --git a/sys/netproto/ipx/ipx_usrreq.c b/sys/netproto/ipx/ipx_usrreq.c index 4a0f6c1c7f..32b2cdb97f 100644 --- a/sys/netproto/ipx/ipx_usrreq.c +++ b/sys/netproto/ipx/ipx_usrreq.c @@ -177,7 +177,7 @@ ipx_input(struct mbuf *m, struct ipxpcb *ipxp) m->m_data += sizeof(struct ipx); } if (ssb_appendaddr(&ipxp->ipxp_socket->so_rcv, (struct sockaddr *)&ipx_ipx, - m, (struct mbuf *)NULL) == 0) + m, NULL) == 0) goto bad; sorwakeup(ipxp->ipxp_socket); return; @@ -290,7 +290,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0) */ so = ipxp->ipxp_socket; if (so->so_options & SO_DONTROUTE) - return (ipx_outputfl(m, (struct route *)NULL, + return (ipx_outputfl(m, NULL, (so->so_options & SO_BROADCAST) | IPX_ROUTETOIF)); /* * Use cached route for previous datagram if diff --git a/sys/netproto/ipx/spx_usrreq.c b/sys/netproto/ipx/spx_usrreq.c index ae89427449..01509e62b5 100644 --- a/sys/netproto/ipx/spx_usrreq.c +++ b/sys/netproto/ipx/spx_usrreq.c @@ -340,7 +340,7 @@ spx_input(struct mbuf *m, struct ipxpcb *ipxp) m_freem(m); } if (cb->s_force || (cb->s_flags & (SF_ACKNOW|SF_WIN|SF_RXT))) - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); cb->s_flags &= ~(SF_WIN|SF_RXT); return; @@ -409,7 +409,7 @@ spx_reass(struct spxpcb *cb, struct spx *si, struct mbuf *si_m) cb->s_snxt = si->si_ack; cb->s_cwnd = CUNIT; cb->s_force = 1 + SPXT_REXMT; - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); cb->s_timer[SPXT_REXMT] = cb->s_rxtcur; cb->s_rtt = 0; if (cwnd >= 4 * CUNIT) @@ -1127,7 +1127,7 @@ send: spx_trace(SA_OUTPUT, cb->s_state, cb, si, 0); if (so->so_options & SO_DONTROUTE) - error = ipx_outputfl(m, (struct route *)NULL, IPX_ROUTETOIF); + error = ipx_outputfl(m, NULL, IPX_ROUTETOIF); else error = ipx_outputfl(m, &cb->s_ipxpcb->ipxp_route, 0); } @@ -1418,7 +1418,7 @@ spx_connect(struct socket *so, struct sockaddr *nam, struct thread *td) crit_enter(); if (ipxp->ipxp_lport == 0) { - error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td); + error = ipx_pcbbind(ipxp, NULL, td); if (error) goto spx_connect_end; } @@ -1441,7 +1441,7 @@ spx_connect(struct socket *so, struct sockaddr *nam, struct thread *td) * cb->s_dport. */ ipxp->ipxp_fport = 0; - error = spx_output(cb, (struct mbuf *)NULL); + error = spx_output(cb, NULL); spx_connect_end: crit_exit(); return (error); @@ -1499,7 +1499,7 @@ spx_listen(struct socket *so, struct thread *td) cb = ipxtospxpcb(ipxp); if (ipxp->ipxp_lport == 0) - error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td); + error = ipx_pcbbind(ipxp, NULL, td); if (error == 0) cb->s_state = TCPS_LISTEN; return (error); @@ -1520,7 +1520,7 @@ spx_rcvd(struct socket *so, int flags) crit_enter(); cb->s_flags |= SF_RVD; - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); cb->s_flags &= ~SF_RVD; crit_exit(); return (0); @@ -1600,7 +1600,7 @@ spx_shutdown(struct socket *so) socantsendmore(so); cb = spx_usrclosed(cb); if (cb != NULL) - error = spx_output(cb, (struct mbuf *)NULL); + error = spx_output(cb, NULL); crit_exit(); return (error); } @@ -1677,7 +1677,7 @@ spx_close(struct spxpcb *cb) soisdisconnected(so); ipx_pcbdetach(ipxp); spxstat.spxs_closed++; - return ((struct spxpcb *)NULL); + return (NULL); } /* @@ -1739,7 +1739,7 @@ spx_fasttimo(void) cb->s_flags &= ~SF_DELACK; cb->s_flags |= SF_ACKNOW; spxstat.spxs_delack++; - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); } } } @@ -1852,7 +1852,7 @@ spx_timers(struct spxpcb *cb, int timer) win = 2; cb->s_cwnd = CUNIT; cb->s_ssthresh = win * CUNIT; - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); break; /* @@ -1862,7 +1862,7 @@ spx_timers(struct spxpcb *cb, int timer) case SPXT_PERSIST: spxstat.spxs_persisttimeo++; spx_setpersist(cb); - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); break; /* @@ -1877,7 +1877,7 @@ spx_timers(struct spxpcb *cb, int timer) if (cb->s_idle >= SPXTV_MAXIDLE) goto dropit; spxstat.spxs_keepprobe++; - spx_output(cb, (struct mbuf *)NULL); + spx_output(cb, NULL); } else cb->s_idle = 0; cb->s_timer[SPXT_KEEP] = SPXTV_KEEP; diff --git a/sys/netproto/key/key.c b/sys/netproto/key/key.c index c2a0fd5b75..c56e3be010 100644 --- a/sys/netproto/key/key.c +++ b/sys/netproto/key/key.c @@ -2621,7 +2621,7 @@ key_delsah(struct secashead *sah) if (sah->sa_route.ro_rt) { RTFREE(sah->sa_route.ro_rt); - sah->sa_route.ro_rt = (struct rtentry *)NULL; + sah->sa_route.ro_rt = NULL; } /* remove from tree of SA index */ @@ -7262,7 +7262,7 @@ key_sa_routechange(struct sockaddr *dst) if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len && bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) { RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + ro->ro_rt = NULL; } } diff --git a/sys/netproto/natm/natm.c b/sys/netproto/natm/natm.c index 129ce26d87..545bd67104 100644 --- a/sys/netproto/natm/natm.c +++ b/sys/netproto/natm/natm.c @@ -263,7 +263,7 @@ natm_usr_disconnect(struct socket *so) api.rxhand = npcb; if (ifp->if_ioctl != NULL) { lwkt_serialize_enter(ifp->if_serializer); - ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL); + ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL); lwkt_serialize_exit(ifp->if_serializer); } @@ -565,7 +565,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, lwkt_serialize_enter(ifp->if_serializer); if (ifp->if_ioctl == NULL || ifp->if_ioctl(ifp, SIOCATMENA, (caddr_t) &api, - (struct ucred *)NULL) != 0) { + NULL) != 0) { lwkt_serialize_exit(ifp->if_serializer); npcb_free(npcb, NPCB_REMOVE); error = EIO; @@ -596,7 +596,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, api.rxhand = npcb; lwkt_serialize_enter(ifp->if_serializer); if (ifp->if_ioctl != NULL) - ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL); + ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL); lwkt_serialize_exit(ifp->if_serializer); npcb_free(npcb, NPCB_REMOVE); @@ -667,7 +667,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, ario.rawvalue = *((int *)nam); lwkt_serialize_enter(npcb->npcb_ifp->if_serializer); error = npcb->npcb_ifp->if_ioctl(npcb->npcb_ifp, SIOCXRAWATM, - (caddr_t) &ario, (struct ucred *)NULL); + (caddr_t) &ario, NULL); lwkt_serialize_exit(npcb->npcb_ifp->if_serializer); if (!error) { if (ario.rawvalue) @@ -760,7 +760,7 @@ natm_init(void) LIST_INIT(&natm_pcbs); netisr_register(NETISR_NATM, cpu0_portfn, pktinfo_portfn_cpu0, - natmintr, NETISR_FLAG_NOTMPSAFE); + natmintr, NETISR_FLAG_NOTMPSAFE); } /* diff --git a/sys/netproto/ncp/ncp_sock.c b/sys/netproto/ncp/ncp_sock.c index 5a39892a47..d239955b6a 100644 --- a/sys/netproto/ncp/ncp_sock.c +++ b/sys/netproto/ncp/ncp_sock.c @@ -379,7 +379,7 @@ ncp_sock_disconnect(struct ncp_conn *conn) { #ifdef NCPBURST if (conn->bc_so) { so = conn->bc_so; - conn->bc_so = (struct socket *)NULL; + conn->bc_so = NULL; soshutdown(so, SHUT_RDWR); soclose(so, FNONBLOCK); } diff --git a/sys/netproto/ns/ns.c b/sys/netproto/ns/ns.c index 17e0aabfde..0438da97b4 100644 --- a/sys/netproto/ns/ns.c +++ b/sys/netproto/ns/ns.c @@ -172,7 +172,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, lwkt_serialize_enter(ifp->if_serializer); error = ifp->if_ioctl(ifp, SIOCSIFDSTADDR, (caddr_t)ia, - (struct ucred *)NULL); + NULL); lwkt_serialize_exit(ifp->if_serializer); if (error) return (error); @@ -236,7 +236,7 @@ ns_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, if (ifp->if_ioctl == 0) return (EOPNOTSUPP); lwkt_serialize_enter(ifp->if_serializer); - error = ifp->if_ioctl(ifp, cmd, data, (struct ucred *)NULL); + error = ifp->if_ioctl(ifp, cmd, data, NULL); lwkt_serialize_exit(ifp->if_serializer); return (error); } @@ -291,7 +291,7 @@ ns_ifinit(struct ifnet *ifp, struct ns_ifaddr *ia, struct sockaddr_ns *sns, int if (ifp->if_ioctl && (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, - (struct ucred *)NULL))) { + NULL))) { ia->ia_addr = oldaddr; lwkt_serialize_exit(ifp->if_serializer); crit_exit(); @@ -306,7 +306,7 @@ ns_ifinit(struct ifnet *ifp, struct ns_ifaddr *ia, struct sockaddr_ns *sns, int if (ifp->if_ioctl && (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, - (struct ucred *)NULL))) { + NULL))) { ia->ia_addr = oldaddr; lwkt_serialize_exit(ifp->if_serializer); crit_exit(); diff --git a/sys/netproto/smb/smb_trantcp.c b/sys/netproto/smb/smb_trantcp.c index 3c3e12e2fa..20f1981929 100644 --- a/sys/netproto/smb/smb_trantcp.c +++ b/sys/netproto/smb/smb_trantcp.c @@ -551,7 +551,7 @@ smb_nbst_disconnect(struct smb_vc *vcp, struct thread *td) return ENOTCONN; if ((so = nbp->nbp_tso) != NULL) { nbp->nbp_flags &= ~NBF_CONNECTED; - nbp->nbp_tso = (struct socket *)NULL; + nbp->nbp_tso = NULL; soshutdown(so, SHUT_RDWR); soclose(so, FNONBLOCK); } diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 8515b14995..1e180acf2f 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -415,7 +415,7 @@ struct cmsgcred { (((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \ _ALIGN(sizeof(struct cmsghdr)) > \ (caddr_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ - (struct cmsghdr *)NULL : \ + NULL : \ (struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len))) /* @@ -425,7 +425,7 @@ struct cmsgcred { #define CMSG_FIRSTHDR(mhdr) \ ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ (struct cmsghdr *)(mhdr)->msg_control : \ - (struct cmsghdr *)NULL) + NULL) /* RFC 2292 additions */ diff --git a/sys/vfs/ntfs/ntfs_subr.c b/sys/vfs/ntfs/ntfs_subr.c index 3f78fd3414..05cbe2aab0 100644 --- a/sys/vfs/ntfs/ntfs_subr.c +++ b/sys/vfs/ntfs/ntfs_subr.c @@ -1835,7 +1835,7 @@ ntfs_runtocn(cn_t *cn, struct ntfsmount *ntmp, u_int8_t *run, u_long len, void ntfs_toupper_init(void) { - ntfs_toupper_tab = (wchar *) NULL; + ntfs_toupper_tab = NULL; lockinit(&ntfs_toupper_lock, "ntfs_toupper", 0, 0); ntfs_toupper_usecount = 0; } diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index f980748cab..36441ad2b2 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -244,7 +244,7 @@ exec_shell(const char *command, char *use_shell, char *use_name) err(1, "vfork"); case 0: /* child */ (void)sigsetmask(omask); - execl(use_shell, use_name, "-c", command, (char *)NULL); + execl(use_shell, use_name, "-c", command, NULL); warn("%s", use_shell); _exit(1); } diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index 16e24239cb..ac27564c5d 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -326,7 +326,7 @@ writefile(time_t runtimer, char queue) mailname = pass_entry->pw_name; } - if (atinput != (char *) NULL) + if (atinput != NULL) { fpin = freopen(atinput, "r", stdin); if (fpin == NULL) diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y index ab417c3eba..1f25152935 100644 --- a/usr.bin/bc/bc.y +++ b/usr.bin/bc/bc.y @@ -1137,7 +1137,7 @@ main(int argc, char *argv[]) dup(p[0]); close(p[0]); close(p[1]); - execl(_PATH_DC, "dc", "-x", (char *)NULL); + execl(_PATH_DC, "dc", "-x", NULL); err(1, "cannot find dc"); } } diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 2fd2c6b080..7315cd00a9 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -374,7 +374,7 @@ opencal(void) } execl(_PATH_CPP, "cpp", "-P", "-traditional", "-nostdinc", /* GCC specific opts */ - "-I.", "-I", _PATH_INCLUDE, (char *)NULL); + "-I.", "-I", _PATH_INCLUDE, NULL); warn(_PATH_CPP); _exit(EXIT_FAILURE); } @@ -436,7 +436,7 @@ closecal(FILE *fp) _exit(EXIT_FAILURE); } execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F", - "\"Reminder Service\"", (char *)NULL); + "\"Reminder Service\"", NULL); warn(_PATH_SENDMAIL); _exit(EXIT_FAILURE); } diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c index dac1234150..d3ce1c987c 100644 --- a/usr.bin/chat/chat.c +++ b/usr.bin/chat/chat.c @@ -511,7 +511,7 @@ void break_sequence(void) void terminate(int status) { echo_stderr(-1); - if (report_file != NULL && report_fp != (FILE *) NULL) { + if (report_file != NULL && report_fp != NULL) { /* * Allow the last of the report string to be gathered before we terminate. */ @@ -535,7 +535,7 @@ void terminate(int status) if (verbose) fprintf (report_fp, "Closing \"%s\".\n", report_file); fclose (report_fp); - report_fp = (FILE *) NULL; + report_fp = NULL; } #if defined(get_term_param) @@ -1230,16 +1230,16 @@ get_string(char *string) if (!report_gathering) { for (n = 0; n < n_reports; ++n) { - if ((report_string[n] != (char*) NULL) && + if ((report_string[n] != NULL) && s - temp >= (report_len = strlen(report_string[n])) && strncmp(s - report_len, report_string[n], report_len) == 0) { - time_t time_now = time ((time_t*) NULL); + time_t time_now = time (NULL); struct tm* tm_now = localtime (&time_now); strftime (report_buffer, 20, "%b %d %H:%M:%S ", tm_now); strcat (report_buffer, report_string[n]); - report_string[n] = (char *) NULL; + report_string[n] = NULL; report_gathering = 1; break; } diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index 658ef33a11..2a86eddcff 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -163,14 +163,14 @@ main(int argc, char **argv) /* protect p_shell -- it thinks NULL is /bin/sh */ if (!arg[0]) usage(); - if (p_shell(arg, pw, (ENTRY *)NULL) == -1) + if (p_shell(arg, pw, NULL) == -1) exit(1); } if (op == NEWEXP) { if (uid) /* only root can change expire */ baduser(); - if (p_expire(arg, pw, (ENTRY *)NULL) == -1) + if (p_expire(arg, pw, NULL) == -1) exit(1); } diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c index 54e3c43520..8f8fcfef15 100644 --- a/usr.bin/chpass/util.c +++ b/usr.bin/chpass/util.c @@ -106,10 +106,10 @@ atot(char *p, time_t *store) } } } - if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + if (!(t = strtok(NULL, " \t,")) || !isdigit(*t)) goto bad; day = atoi(t); - if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + if (!(t = strtok(NULL, " \t,")) || !isdigit(*t)) goto bad; year = atoi(t); if (day < 1 || day > 31 || month < 1 || month > 12) diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c index 22af52ad8a..471351b14d 100644 --- a/usr.bin/col/col.c +++ b/usr.bin/col/col.c @@ -278,7 +278,7 @@ main(int argc, char **argv) need = l->l_lsize ? l->l_lsize * 2 : 90; if ((l->l_line = realloc(l->l_line, (unsigned)need * sizeof(CHAR))) == NULL) - err(1, (char *)NULL); + err(1, NULL); l->l_lsize = need; } c = &l->l_line[l->l_line_len++]; @@ -394,13 +394,13 @@ flush_line(LINE *l) sorted_size = l->l_lsize; if ((sorted = realloc(sorted, (unsigned)sizeof(CHAR) * sorted_size)) == NULL) - err(1, (char *)NULL); + err(1, NULL); } if (l->l_max_col >= count_size) { count_size = l->l_max_col + 1; if ((count = realloc(count, (unsigned)sizeof(int) * count_size)) == NULL) - err(1, (char *)NULL); + err(1, NULL); } memset(count, 0, sizeof(int) * l->l_max_col + 1); for (i = nchars, c = l->l_line; --i >= 0; c++) @@ -488,7 +488,7 @@ alloc_line(void) if (!line_freelist) { if ((l = realloc(NULL, sizeof(LINE) * NALLOC)) == NULL) - err(1, (char *)NULL); + err(1, NULL); line_freelist = l; for (i = 1; i < NALLOC; i++, l++) l->l_next = l + 1; diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c index 37187d2558..dc31eef250 100644 --- a/usr.bin/column/column.c +++ b/usr.bin/column/column.c @@ -208,11 +208,11 @@ maketbl(void) char **cols; if ((t = tbl = calloc(entries, sizeof(TBL))) == NULL) - err(1, (char *)NULL); + err(1, NULL); if ((cols = calloc((maxcols = DEFCOLS), sizeof(char *))) == NULL) - err(1, (char *)NULL); + err(1, NULL); if ((lens = calloc(maxcols, sizeof(int))) == NULL) - err(1, (char *)NULL); + err(1, NULL); for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) { for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator)); p = NULL) @@ -227,9 +227,9 @@ maketbl(void) maxcols += DEFCOLS; } if ((t->list = calloc(coloff, sizeof(char *))) == NULL) - err(1, (char *)NULL); + err(1, NULL); if ((t->len = calloc(coloff, sizeof(int))) == NULL) - err(1, (char *)NULL); + err(1, NULL); for (t->cols = coloff; --coloff >= 0;) { t->list[coloff] = cols[coloff]; t->len[coloff] = strlen(cols[coloff]); @@ -258,7 +258,7 @@ input(FILE *fp) if (!list) if ((list = calloc((maxentry = DEFNUM), sizeof(char *))) == NULL) - err(1, (char *)NULL); + err(1, NULL); while (fgets(buf, MAXLINELEN, fp)) { for (p = buf; *p && isspace(*p); ++p); if (!*p) diff --git a/usr.bin/find/getdate.y b/usr.bin/find/getdate.y index 53a450a2a2..307afa9584 100644 --- a/usr.bin/find/getdate.y +++ b/usr.bin/find/getdate.y @@ -956,7 +956,7 @@ main(int ac, char *av[]) (void)printf("Enter date, or blank line to exit.\n\t> "); (void)fflush(stdout); while (gets(buff) && buff[0]) { - d = get_date(buff, (struct timeb *)NULL); + d = get_date(buff, NULL); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c index eb0fa823a9..a958d363f9 100644 --- a/usr.bin/gcore/elfcore.c +++ b/usr.bin/gcore/elfcore.c @@ -108,9 +108,7 @@ elf_coredump(int fd, pid_t pid) * size is calculated. */ hdrsize = 0; - elf_puthdr(map, NULL, &hdrsize, - (const prstatus_t *)NULL, (const prfpregset_t *)NULL, - (const prpsinfo_t *)NULL, seginfo.count); + elf_puthdr(map, NULL, &hdrsize, NULL, NULL, NULL, seginfo.count); /* * Allocate memory for building the header, fill it up, diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index b96012b84d..74ea3c8260 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -83,10 +83,10 @@ main(int argc, char **argv) if (valid > 0 && alt_path != NULL) { if (argv[optind + 1] == NULL) execl(alt_path, "getconf", argv[optind], - (char *)NULL); + NULL); else execl(alt_path, "getconf", argv[optind], - argv[optind + 1], (char *)NULL); + argv[optind + 1], NULL); err(EX_OSERR, "execl: %s", alt_path); } diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 99b7edf127..59a012aeba 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -253,17 +253,17 @@ get(void) * and no other files are available, zero-pad the rest of the * block and set the end flag. */ - if (!length || (ateof && !next((char **)NULL))) { + if (!length || (ateof && !next(NULL))) { if (odmode && address < skip) errx(1, "cannot skip past end of input"); if (need == blocksize) - return((u_char *)NULL); + return(NULL); if (vflag != ALL && valid_save && bcmp(curp, savp, nread) == 0) { if (vflag != DUP) (void)printf("*\n"); - return((u_char *)NULL); + return(NULL); } bzero((char *)curp + nread, need); eaddress = address + nread; diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index a701d5bca4..b2e4ec6b40 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -213,7 +213,7 @@ main(int argc, char **argv) break; case 0: if (is_shlib == 0) { - execl(*argv, *argv, (char *)NULL); + execl(*argv, *argv, NULL); warn("%s", *argv); } else { dlopen(*argv, RTLD_TRACE); diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c index c3030760af..2b72015f40 100644 --- a/usr.bin/lock/lock.c +++ b/usr.bin/lock/lock.c @@ -130,7 +130,7 @@ main(int argc, char **argv) gethostname(hostname, sizeof(hostname)); if (!(ttynam = ttyname(0))) errx(1, "not a terminal?"); - if (gettimeofday(&timval, (struct timezone *)NULL)) + if (gettimeofday(&timval, NULL)) err(1, "gettimeofday"); nexttime = timval.tv_sec + (sectimeout * 60); timval_sec = timval.tv_sec; @@ -245,7 +245,7 @@ hi(int signo __unused) { struct timeval timval; - if (!gettimeofday(&timval, (struct timezone *)NULL)) { + if (!gettimeofday(&timval, NULL)) { printf("lock: type in the unlock key. "); if (no_timeout) { putchar('\n'); diff --git a/usr.bin/m4/gnum4.c b/usr.bin/m4/gnum4.c index abc23a2afa..7977a2a468 100644 --- a/usr.bin/m4/gnum4.c +++ b/usr.bin/m4/gnum4.c @@ -499,7 +499,7 @@ doesyscmd(const char *cmd) (void) close(p[0]); (void) dup2(p[1], 1); (void) close(p[1]); - execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL); + execl(_PATH_BSHELL, "sh", "-c", cmd, NULL); exit(1); default: /* Read result in two stages, since m4's buffer is diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c index 1130bbd908..57f2d95f35 100644 --- a/usr.bin/mail/aux.c +++ b/usr.bin/mail/aux.c @@ -323,7 +323,7 @@ alter(char *name) if (stat(name, &sb)) return; - gettimeofday(&tv[0], (struct timezone *)NULL); + gettimeofday(&tv[0], NULL); tv[0].tv_sec++; TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec); utimes(name, tv); diff --git a/usr.bin/mail/cmd2.c b/usr.bin/mail/cmd2.c index 9d75c9adce..e0ba5e075e 100644 --- a/usr.bin/mail/cmd2.c +++ b/usr.bin/mail/cmd2.c @@ -179,7 +179,7 @@ save1(char *str, int mark, const char *cmd, struct ignoretab *ignore) else disp = "[New file]"; if ((obuf = Fopen(file, "a")) == NULL) { - warn((char *)NULL); + warn(NULL); return (1); } for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c index 9f5fc39cb6..238be06d46 100644 --- a/usr.bin/mail/collect.c +++ b/usr.bin/mail/collect.c @@ -510,7 +510,7 @@ exwrite(char *name, FILE *fp, int f) return (-1); } if ((of = Fopen(name, "w")) == NULL) { - warn((char *)NULL); + warn(NULL); return (-1); } lc = 0; diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index 48d8dd2dfb..b6f6d5e010 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -628,7 +628,7 @@ prmesg(int length) if (!outf) outf = stdout; else - setbuf(outf, (char *)NULL); + setbuf(outf, NULL); } else outf = stdout; diff --git a/usr.bin/newgrp/newgrp.c b/usr.bin/newgrp/newgrp.c index 5e6966b364..4513b171b6 100644 --- a/usr.bin/newgrp/newgrp.c +++ b/usr.bin/newgrp/newgrp.c @@ -307,6 +307,6 @@ doshell(void) shell = pwd->pw_shell; if (*shell == '\0') shell = _PATH_BSHELL; - execl(shell, basename(shell), (char *)NULL); + execl(shell, basename(shell), NULL); err(1, "%s", shell); } diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index fa430a1608..120752e188 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -116,15 +116,15 @@ main(int argc, char **argv) pw = getpwnam(argv[2]); if (pw == NULL) errx(1, "unknown user: %s", argv[2]); - (void)user2netname(name, (int)pw->pw_uid, (char *)NULL); + (void)user2netname(name, (int)pw->pw_uid, NULL); } else { #ifdef undef h = gethostbyname(argv[2]); if (h == NULL) errx(1, "unknown host: %s", argv[1]); - (void)host2netname(name, h->h_name, (char *)NULL); + (void)host2netname(name, h->h_name, NULL); #else - (void)host2netname(name, argv[2], (char *)NULL); + (void)host2netname(name, argv[2], NULL); #endif } diff --git a/usr.bin/rdist/rshrcmd.c b/usr.bin/rdist/rshrcmd.c index 39005b840d..f83b24d0b2 100644 --- a/usr.bin/rdist/rshrcmd.c +++ b/usr.bin/rdist/rshrcmd.c @@ -88,11 +88,11 @@ rshrcmd(char **ahost, u_short port, char *luser, char *ruser, char *cmd, int *fd if (strcmp(*ahost, "localhost") == 0 && strcmp(luser, ruser) == 0) { execlp(_PATH_BSHELL, xbasename(_PATH_BSHELL), "-c", - cmd, (char *) NULL); + cmd, NULL); error("execlp %s failed: %s.", _PATH_BSHELL, strerror(errno)); } else { execlp(path_rsh, xbasename(path_rsh), - *ahost, "-l", ruser, cmd, (char *) NULL); + *ahost, "-l", ruser, cmd, NULL); error("execlp %s failed: %s.", path_rsh, strerror(errno)); } diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index 4c58e2ed2e..7dbc8cb682 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -305,7 +305,7 @@ open_input(const char *infile, const char *define) addarg(define); if (infile) addarg(infile); - addarg((char *)NULL); + addarg(NULL); close(1); dup2(pd[1], 1); close(pd[0]); diff --git a/usr.bin/rpcgen/rpc_sample.c b/usr.bin/rpcgen/rpc_sample.c index dc565e320c..c40fc950a3 100644 --- a/usr.bin/rpcgen/rpc_sample.c +++ b/usr.bin/rpcgen/rpc_sample.c @@ -125,10 +125,10 @@ write_sample_client(const char *program_name, version_list *vp) f_print(fout, "\n#ifndef\tDEBUG\n"); f_print(fout, "\tclnt = clnt_create(host, %s, %s, \"%s\");\n", program_name, vp->vers_name, tirpcflag? "netpath" : "udp"); - f_print(fout, "\tif (clnt == (CLIENT *) NULL) {\n"); + f_print(fout, "\tif (clnt == NULL) {\n"); f_print(fout, "\t\tclnt_pcreateerror(host);\n"); f_print(fout, "\t\texit(1);\n\t}\n"); - f_print(fout, "#endif\t/* DEBUG */\n\n"); + f_print(fout, "#endif\t/* !DEBUG */\n\n"); /* generate calls to procedures */ i = 0; @@ -167,20 +167,17 @@ write_sample_client(const char *program_name, version_list *vp) f_print(fout, "clnt);\n"); } - if (mtflag) { + if (mtflag) f_print(fout, "\tif (retval_%d != RPC_SUCCESS) {\n", i); - } else { - f_print(fout, "\tif (result_%d == (", i); - ptype(proc->res_prefix, proc->res_type, 1); - f_print(fout, "*) NULL) {\n"); - } + else + f_print(fout, "\tif (result_%d == NULL) {\n", i); f_print(fout, "\t\tclnt_perror(clnt, \"call failed\");\n"); f_print(fout, "\t}\n"); } f_print(fout, "#ifndef\tDEBUG\n"); f_print(fout, "\tclnt_destroy(clnt);\n"); - f_print(fout, "#endif\t /* DEBUG */\n"); + f_print(fout, "#endif\t /* !DEBUG */\n"); f_print(fout, "}\n"); } diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 4f77ad5804..07e973b75a 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -121,7 +121,7 @@ write_most(const char *infile, int netflag, int nomain) write_svc_aux(nomain); } /* write out dispatcher and stubs */ - write_programs((char *)NULL); + write_programs(NULL); if (nomain) return; @@ -265,7 +265,7 @@ write_rest(void) { f_print(fout, "\n"); if (inetdflag) { - f_print(fout, "\tif (%s == (SVCXPRT *)NULL) {\n", TRANSP); + f_print(fout, "\tif (%s == NULL) {\n", TRANSP); sprintf(_errbuf, "could not create a handle"); print_err_message("\t\t"); f_print(fout, "\t\texit(1);\n"); @@ -451,7 +451,7 @@ write_program(definition *def, const char *storage) f_print(fout, "\tcase NULLPROC:\n"); f_print(fout, "\t\tsvc_sendreply(%s,\n\t\t\t" - "(xdrproc_t) xdr_void, (char *)NULL);\n", + "(xdrproc_t) xdr_void, NULL);\n", TRANSP); print_return("\t\t"); f_print(fout, "\n"); @@ -898,7 +898,7 @@ write_rpc_svc_fg(const char *infile, const char *sp) f_print(fout, "%si = open(\"/dev/tty\", 2);\n", sp); f_print(fout, "%sif (i >= 0) {\n", sp); f_print(fout, - "%s\tioctl(i, TIOCNOTTY, (char *)NULL);\n", sp); + "%s\tioctl(i, TIOCNOTTY, NULL);\n", sp); f_print(fout, "%s\tclose(i);\n", sp); f_print(fout, "%s}\n", sp); } diff --git a/usr.bin/symorder/symorder.c b/usr.bin/symorder/symorder.c index c230f04f5e..4677342e5d 100644 --- a/usr.bin/symorder/symorder.c +++ b/usr.bin/symorder/symorder.c @@ -189,7 +189,7 @@ main(int argc, char **argv) i = n / sizeof(struct nlist); if (!clean) { newtab = (struct nlist *)malloc(n); - if (newtab == (struct nlist *)NULL) + if (newtab == NULL) err(ERREXIT, NULL); memset(newtab, 0, n); diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index df52686ef8..a5f03e35a3 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -101,10 +101,10 @@ main(int argc, char **argv) if (ofn) { if ((out = fopen(ofn, aflag ? "a" : "w")) == NULL) err(1, "%s", ofn); - setvbuf(out, (char *)NULL, _IONBF, (size_t)0); + setvbuf(out, NULL, _IONBF, (size_t)0); } - if (gettimeofday(&before, (struct timezone *)NULL) == -1) + if (gettimeofday(&before, NULL) == -1) err(1, "gettimeofday failed"); switch (pid = fork()) { case -1: /* error */ @@ -122,7 +122,7 @@ main(int argc, char **argv) err(1, "signal failed"); while (wait4(pid, &status, 0, &ru) != pid) /* XXX use waitpid */ ; - if (gettimeofday(&after, (struct timezone *)NULL) == -1) + if (gettimeofday(&after, NULL) == -1) err(1, "gettimeofday failed"); if (!WIFEXITED(status)) warnx("command terminated abnormally"); diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 6bc784cfd6..34d451de21 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -109,7 +109,7 @@ main(int argc, char **argv) sflag = 1; break; case 'u': - setbuf(stdout, (char *)NULL); + setbuf(stdout, NULL); break; case '?': default: diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c index 3b8ec6c73d..ccfa4d4ccd 100644 --- a/usr.bin/whereis/whereis.c +++ b/usr.bin/whereis/whereis.c @@ -611,8 +611,7 @@ main(int argc, char **argv) cp2, buf); } free(cp2); - if (regexec(&re2, buf, 0, - (regmatch_t *)NULL, 0) + if (regexec(&re2, buf, 0, NULL, 0) == 0) { unusual = unusual & ~NO_SRC_FOUND; diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index 9a5101b492..ce98cec48e 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -260,7 +260,7 @@ do_write(const char *tty, const char *mytty, uid_t myuid, int *mymsgok) /* print greeting */ if (gethostname(host, sizeof(host)) < 0) strlcpy(host, "???", sizeof host); - now = time((time_t *)NULL); + now = time(NULL); nows = ctime(&now); nows[16] = '\0'; printf("\r\n\007\007\007Message from %s@%s on %s at %s (%s %s replies)...\r\n", diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index e977b4673b..882f65f8eb 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -796,7 +796,7 @@ strip(const char *to_name) stripbin = getenv("STRIPBIN"); if (stripbin == NULL) stripbin = "strip"; - execlp(stripbin, stripbin, to_name, (char *)NULL); + execlp(stripbin, stripbin, to_name, NULL); err(EX_OSERR, "exec(%s)", stripbin); default: if (wait(&status) == -1 || status) { diff --git a/usr.sbin/IPXrouted/main.c b/usr.sbin/IPXrouted/main.c index 5577d4bd6f..8c583c06c7 100644 --- a/usr.sbin/IPXrouted/main.c +++ b/usr.sbin/IPXrouted/main.c @@ -240,8 +240,7 @@ main(int argc, char *argv[]) } FD_SET(ripsock, &fdvar); - if(select(nfds, &fdvar, (fd_set *)NULL, (fd_set *)NULL, - (struct timeval *)NULL) < 0) { + if(select(nfds, &fdvar, NULL, NULL, NULL) < 0) { if(errno == EINTR) continue; perror("during select"); diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index bcefcde4be..e1ca991729 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -117,7 +117,7 @@ event_cmd_exec_act(void *this) goto out; case 0: /* child process */ - execl(_PATH_BSHELL, "sh", "-c", p->line, (char *)NULL); + execl(_PATH_BSHELL, "sh", "-c", p->line, NULL); _exit(127); default: /* parent process */ diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index bbfe99272c..d2bc0fd4e9 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -126,7 +126,7 @@ main(int argc, char *argv[]) strlcat(destdir, PREFIX, sizeof(destdir)); } - p = path((char *)NULL); + p = path(NULL); if (stat(p, &buf)) { if (mkdir(p, 0777)) err(2, "%s", p); diff --git a/usr.sbin/cron/cron/cron.h b/usr.sbin/cron/cron/cron.h index 7fecb1b8f8..b1dd3f217f 100644 --- a/usr.sbin/cron/cron/cron.h +++ b/usr.sbin/cron/cron/cron.h @@ -91,7 +91,6 @@ #define DBIT 0x0080 /* bit twiddling shown (long) */ #define CRON_TAB(u) "%s/%s", SPOOL_DIR, u -#define PPC_NULL ((char **)NULL) #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 diff --git a/usr.sbin/cron/cron/job.c b/usr.sbin/cron/cron/job.c index 1574870cfc..b01df9cc3c 100644 --- a/usr.sbin/cron/cron/job.c +++ b/usr.sbin/cron/cron/job.c @@ -43,7 +43,7 @@ job_add(entry *e, user *u) /* build a job queue element */ if ((j = (job*)malloc(sizeof(job))) == NULL) return; - j->next = (job*) NULL; + j->next = NULL; j->e = e; j->u = u; diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c index f52df88108..f1ad17980c 100644 --- a/usr.sbin/cron/lib/entry.c +++ b/usr.sbin/cron/lib/entry.c @@ -196,7 +196,7 @@ load_entry(FILE *file, void (*error_func)(), struct passwd *pw, char **envp) Debug(DPARS, ("load_entry()...about to parse numerics\n")) ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE, - PPC_NULL, ch, file); + NULL, ch, file); if (ch == EOF) { ecode = e_minute; goto eof; @@ -206,7 +206,7 @@ load_entry(FILE *file, void (*error_func)(), struct passwd *pw, char **envp) */ ch = get_list(e->hour, FIRST_HOUR, LAST_HOUR, - PPC_NULL, ch, file); + NULL, ch, file); if (ch == EOF) { ecode = e_hour; goto eof; @@ -218,7 +218,7 @@ load_entry(FILE *file, void (*error_func)(), struct passwd *pw, char **envp) if (ch == '*') e->flags |= DOM_STAR; ch = get_list(e->dom, FIRST_DOM, LAST_DOM, - PPC_NULL, ch, file); + NULL, ch, file); if (ch == EOF) { ecode = e_dom; goto eof; @@ -531,7 +531,7 @@ get_range(bitstr_t *bits, int low, int high, char **names, int ch, FILE *file) * element id, it's a step size. 'low' is * sent as a 0 since there is no offset either. */ - ch = get_number(&num3, 0, PPC_NULL, ch, file); + ch = get_number(&num3, 0, NULL, ch, file); if (ch == EOF || num3 == 0) return EOF; } else { diff --git a/usr.sbin/i4b/isdnd/log.c b/usr.sbin/i4b/isdnd/log.c index 07adfde1ad..ebb6af0dc9 100644 --- a/usr.sbin/i4b/isdnd/log.c +++ b/usr.sbin/i4b/isdnd/log.c @@ -83,7 +83,7 @@ init_log(void) /* set unbuffered operation */ - setvbuf(logfp, (char *)NULL, _IONBF, 0); + setvbuf(logfp, NULL, _IONBF, 0); } else { diff --git a/usr.sbin/i4b/isdnd/main.c b/usr.sbin/i4b/isdnd/main.c index 951eea4723..8cde0eeccb 100644 --- a/usr.sbin/i4b/isdnd/main.c +++ b/usr.sbin/i4b/isdnd/main.c @@ -353,7 +353,7 @@ main(int argc, char **argv) dolog(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile); exit(1); } - setvbuf(acctfp, (char *)NULL, _IONBF, 0); + setvbuf(acctfp, NULL, _IONBF, 0); } /* initialize alias processing */ @@ -799,7 +799,7 @@ reopenfiles(int dummy) dolog(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile); error_exit(1, "ERROR, can't open acctfile %s for writing, terminating!", acctfile); } - setvbuf(acctfp, (char *)NULL, _IONBF, 0); + setvbuf(acctfp, NULL, _IONBF, 0); } if(uselogfile) @@ -831,7 +831,7 @@ reopenfiles(int dummy) /* set unbuffered operation */ - setvbuf(logfp, (char *)NULL, _IONBF, 0); + setvbuf(logfp, NULL, _IONBF, 0); } } diff --git a/usr.sbin/i4b/isdnd/process.c b/usr.sbin/i4b/isdnd/process.c index 5838509529..3295cec874 100644 --- a/usr.sbin/i4b/isdnd/process.c +++ b/usr.sbin/i4b/isdnd/process.c @@ -192,7 +192,7 @@ daemonize(void) /* curses output && fork NEEDS controlling tty */ - if((ioctl(STDIN_FILENO, TIOCSCTTY, (char *)NULL)) < 0) + if((ioctl(STDIN_FILENO, TIOCSCTTY, NULL)) < 0) { dolog(LL_ERR, "ERROR, cannot setup tty as controlling terminal: %s", strerror(errno)); exit(1); diff --git a/usr.sbin/i4b/isdndecode/main.c b/usr.sbin/i4b/isdndecode/main.c index f9c38f7d0c..a0d39d868c 100644 --- a/usr.sbin/i4b/isdndecode/main.c +++ b/usr.sbin/i4b/isdndecode/main.c @@ -236,7 +236,7 @@ main(int argc, char *argv[]) exit(1); } - if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(BP, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -301,7 +301,7 @@ main(int argc, char *argv[]) exit(1); } - if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(Fout, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -311,7 +311,7 @@ main(int argc, char *argv[]) } } - if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0) + if((setvbuf(stdout, NULL, _IOLBF, 0)) != 0) { char buffer[80]; @@ -661,7 +661,7 @@ reopenfiles(int dummy) exit(1); } - if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(Fout, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -685,7 +685,7 @@ reopenfiles(int dummy) exit(1); } - if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(BP, NULL, _IONBF, 0)) != 0) { char buffer[80]; diff --git a/usr.sbin/i4b/isdntrace/trace.c b/usr.sbin/i4b/isdntrace/trace.c index 401c1a625d..e7b63a3f07 100644 --- a/usr.sbin/i4b/isdntrace/trace.c +++ b/usr.sbin/i4b/isdntrace/trace.c @@ -261,7 +261,7 @@ main(int argc, char *argv[]) exit(1); } - if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(BP, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -331,7 +331,7 @@ main(int argc, char *argv[]) exit(1); } - if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(Fout, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -341,7 +341,7 @@ main(int argc, char *argv[]) } } - if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0) + if((setvbuf(stdout, NULL, _IOLBF, 0)) != 0) { char buffer[80]; @@ -780,7 +780,7 @@ reopenfiles(int dummy) exit(1); } - if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(Fout, NULL, _IONBF, 0)) != 0) { char buffer[80]; @@ -806,7 +806,7 @@ reopenfiles(int dummy) exit(1); } - if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0) + if((setvbuf(BP, NULL, _IONBF, 0)) != 0) { char buffer[80]; diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index 0b56967fa9..6ff8df07d2 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -680,7 +680,7 @@ machtime(void) { struct timeval tv; - if (gettimeofday(&tv, (struct timezone *)NULL) < 0) { + if (gettimeofday(&tv, NULL) < 0) { if (debug) warnx("unable to get time of day"); return (0L); diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 8eb9ba74cb..8bf3f93341 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -652,11 +652,11 @@ main(int argc, char **argv) */ if (dofork) { if (sep->se_count++ == 0) - gettimeofday(&sep->se_time, (struct timezone *)NULL); + gettimeofday(&sep->se_time, NULL); else if (toomany > 0 && sep->se_count >= toomany) { struct timeval now; - gettimeofday(&now, (struct timezone *)NULL); + gettimeofday(&now, NULL); if (now.tv_sec - sep->se_time.tv_sec > CNT_INTVL) { sep->se_time = now; diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c index 24ce5fed4c..92d1bb03a0 100644 --- a/usr.sbin/keyserv/keyserv.c +++ b/usr.sbin/keyserv/keyserv.c @@ -522,7 +522,7 @@ key_gen_1_svc_prog(void *v, struct svc_req *s) static des_block keygen; static des_block key; - gettimeofday(&time, (struct timezone *) NULL); + gettimeofday(&time, NULL); keygen.key.high += (time.tv_sec ^ time.tv_usec); keygen.key.low += (time.tv_sec ^ time.tv_usec); ecb_crypt((char *)&masterkey, (char *)&keygen, sizeof (keygen), diff --git a/usr.sbin/keyserv/setkey.c b/usr.sbin/keyserv/setkey.c index 91e724dce5..5ef5688950 100644 --- a/usr.sbin/keyserv/setkey.c +++ b/usr.sbin/keyserv/setkey.c @@ -351,7 +351,7 @@ store_netname(uid_t uid, key_netstarg *netstore) if (netstore->st_netname) new->keynetdata.st_netname = strdup(netstore->st_netname); else - new->keynetdata.st_netname = (char *)NULL; + new->keynetdata.st_netname = NULL; new->sc_flag = KEY_NAME; return (1); diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 682682e5b6..471c83ee49 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -370,13 +370,13 @@ upstat(struct printer *pp, const char *msg, int notifyuser) return; } ftruncate(fd, 0); - if (msg == (char *)NULL) + if (msg == NULL) write(fd, "\n", 1); else write(fd, msg, strlen(msg)); close(fd); if (notifyuser) { - if ((msg == (char *)NULL) || (strcmp(msg, "\n") == 0)) + if ((msg == NULL) || (strcmp(msg, "\n") == 0)) printf("\tstatus message is now set to nothing.\n"); else printf("\tstatus message is now: %s", msg); diff --git a/usr.sbin/mrouted/kern.c b/usr.sbin/mrouted/kern.c index d37aa7bfaa..1a4227a95d 100644 --- a/usr.sbin/mrouted/kern.c +++ b/usr.sbin/mrouted/kern.c @@ -137,7 +137,7 @@ k_init_dvmrp(void) { #ifdef OLD_KERNEL if (setsockopt(igmp_socket, IPPROTO_IP, MRT_INIT, - (char *)NULL, 0) < 0) + NULL, 0) < 0) #else int v=1; @@ -151,7 +151,7 @@ void k_stop_dvmrp(void) { if (setsockopt(igmp_socket, IPPROTO_IP, MRT_DONE, - (char *)NULL, 0) < 0) + NULL, 0) < 0) dolog(LOG_WARNING, errno, "can't disable Multicast routing in kernel"); } diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c index efefc56824..d2d04fee2c 100644 --- a/usr.sbin/ngctl/main.c +++ b/usr.sbin/ngctl/main.c @@ -135,7 +135,7 @@ main(int ac, char *av[]) break; case '?': default: - Usage((char *)NULL); + Usage(NULL); break; } } diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index ea72f58944..bec80abb33 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -672,7 +672,7 @@ ShellCommand(struct cmdargs const *arg, int bg) if (arg->prompt) printf("ppp: Pausing until %s finishes\n", shell); prompt_TtyOldMode(arg->prompt); - execl(shell, shell, (char *)NULL); + execl(shell, shell, NULL); } log_Printf(LogWARN, "exec() of %s failed: %s\n", diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c index 336c3b624f..dbc2d3f349 100644 --- a/usr.sbin/pppd/auth.c +++ b/usr.sbin/pppd/auth.c @@ -173,7 +173,7 @@ link_terminated(int unit) if (logged_in) plogout(); phase = PHASE_DEAD; - etime = time((time_t *) NULL); + etime = time(NULL); minutes = (etime-stime)/60; syslog(LOG_NOTICE, "Connection terminated, connected for %d minutes\n", minutes > 1 ? minutes : 1); @@ -926,7 +926,7 @@ plogin(char *user, char *passwd, char **msg, int *msglen) return (UPAP_AUTHNAK); if (pw->pw_expire) { - gettimeofday(&tp, (struct timezone *)NULL); + gettimeofday(&tp, NULL); if (tp.tv_sec >= pw->pw_expire) { syslog(LOG_INFO, "pap user %s account expired", user); return (UPAP_AUTHNAK); diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index 4181e8a7ac..c908017ce9 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -277,7 +277,7 @@ main(int argc, char *argv[]) detach(); pid = getpid(); p = getlogin(); - stime = time((time_t *) NULL); + stime = time(NULL); if (p == NULL) { pw = getpwuid(uid); if (pw != NULL && pw->pw_name != NULL) @@ -545,7 +545,7 @@ main(int argc, char *argv[]) * incoming events (reply, timeout, etc.). */ syslog(LOG_NOTICE, "Connect: %s <--> %s", ifname, devnam); - stime = time((time_t *) NULL); + stime = time(NULL); lcp_lowerup(0); lcp_open(0); /* Start protocol */ for (phase = PHASE_ESTABLISH; phase != PHASE_DEAD; ) { @@ -704,7 +704,7 @@ get_input(void) return; if (len == 0) { - etime = time((time_t *) NULL); + etime = time(NULL); minutes = (etime-stime)/60; syslog(LOG_NOTICE, "Modem hangup, connected for %d minutes", (minutes >1) ? minutes : 1); hungup = 1; diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 8e0bdfa76c..34d4460d3e 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -161,7 +161,7 @@ main(int argc, char *argv[]) sigaddset(&set, SIGINT); sigaddset(&set, SIGQUIT); sigaddset(&set, SIGTERM); - sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); + sigprocmask(SIG_BLOCK, &set, NULL); /* We don't care what the user wants. */ umask(0); diff --git a/usr.sbin/resident/resident.c b/usr.sbin/resident/resident.c index f43c1d5fbe..2bea465af3 100644 --- a/usr.sbin/resident/resident.c +++ b/usr.sbin/resident/resident.c @@ -283,7 +283,7 @@ force_target: } break; case 0: - execl(*argv, *argv, (char *)NULL); + execl(*argv, *argv, NULL); warn("%s", *argv); _exit(1); } diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 9a1a9100fc..8982ff7522 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -578,7 +578,7 @@ init(void) struct addrinfo hints, *res; char port[10]; - ifc = (struct ifc *)NULL; + ifc = NULL; nifc = 0; nindex2ifc = 0; /*initial guess*/ index2ifc = NULL; @@ -3321,7 +3321,7 @@ ifc_find(char *name) if (strcmp(name, ifcp->ifc_name) == 0) return ifcp; } - return (struct ifc *)NULL; + return NULL; } struct iff * diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 17f13cd27a..78c8888917 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -421,7 +421,7 @@ create_service(struct netconfig *nconf) transp = svc_tli_create(fd, nconf, NULL, RPC_MAXDATASIZE, RPC_MAXDATASIZE); - if (transp != (SVCXPRT *) NULL) { + if (transp != NULL) { if (!svc_reg(transp, NLM_PROG, NLM_SM, nlm_prog_0, NULL)) syslog(LOG_ERR, diff --git a/usr.sbin/rpc.umntall/mounttab.c b/usr.sbin/rpc.umntall/mounttab.c index 75d7d41c3e..f4321db619 100644 --- a/usr.sbin/rpc.umntall/mounttab.c +++ b/usr.sbin/rpc.umntall/mounttab.c @@ -123,7 +123,7 @@ read_mtab(void) { mtabp->mtab_host[RPCMNT_NAMELEN - 1] = '\0'; memmove(mtabp->mtab_dirp, dirp, RPCMNT_PATHLEN); mtabp->mtab_dirp[RPCMNT_PATHLEN - 1] = '\0'; - mtabp->mtab_next = (struct mtablist *)NULL; + mtabp->mtab_next = NULL; *mtabpp = mtabp; mtabpp = &mtabp->mtab_next; } diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c index 13c7dcc266..052cfc78b5 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c @@ -317,7 +317,7 @@ the %s domain -- aborting", yppasswd_domain); if (chmod(sockname, 0)) err(1, "chmod of %s failed", sockname); - if (transp == (SVCXPRT *)NULL) { + if (transp == NULL) { yp_error("could not create a handle"); exit(1); } diff --git a/usr.sbin/rpc.ypupdated/ypupdated_main.c b/usr.sbin/rpc.ypupdated/ypupdated_main.c index 4007aeb1b6..d1b26868fa 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_main.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_main.c @@ -263,7 +263,7 @@ main(int argc, char *argv[]) } } - if (transp == (SVCXPRT *)NULL) { + if (transp == NULL) { _msgout("could not create a handle"); exit(1); } diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c index e5aec86d17..51aad46c9f 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c @@ -242,7 +242,7 @@ main(int argc, char *argv[]) dup2(i, 2); i = open(_PATH_TTY, 2); if (i >= 0) { - ioctl(i, TIOCNOTTY, (char *)NULL); + ioctl(i, TIOCNOTTY, NULL); close(i); } openlog("rpc.ypxfrd", LOG_PID, LOG_DAEMON); @@ -279,7 +279,7 @@ main(int argc, char *argv[]) } } - if (transp == (SVCXPRT *)NULL) { + if (transp == NULL) { _msgout("could not create a handle"); exit(1); } diff --git a/usr.sbin/rpcbind/rpcb_svc_com.c b/usr.sbin/rpcbind/rpcb_svc_com.c index 0e72ef29dc..3401f08c74 100644 --- a/usr.sbin/rpcbind/rpcb_svc_com.c +++ b/usr.sbin/rpcbind/rpcb_svc_com.c @@ -606,7 +606,7 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp, char *buf_alloc = NULL, *outbufp; char *outbuf_alloc = NULL; char buf[RPC_BUF_MAX], outbuf[RPC_BUF_MAX]; - struct netbuf *na = (struct netbuf *) NULL; + struct netbuf *na = NULL; struct rpc_msg call_msg; int outlen; u_int sendsz; diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index ecc118cd06..cbd6812cb4 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -451,7 +451,7 @@ init_transport(struct netconfig *nconf) my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE); - if (my_xprt == (SVCXPRT *)NULL) { + if (my_xprt == NULL) { syslog(LOG_ERR, "%s: could not create service", nconf->nc_netid); goto error; @@ -499,7 +499,7 @@ init_transport(struct netconfig *nconf) my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE); - if (my_xprt == (SVCXPRT *)NULL) { + if (my_xprt == NULL) { syslog(LOG_ERR, "%s: could not create service", nconf->nc_netid); goto error; diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 2fed0a3b8c..4d1c5ec5a6 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -781,6 +781,6 @@ autoifprobe(void) if (target) return argv; else - return (char **)NULL; + return NULL; #endif } diff --git a/usr.sbin/stallion/stlload/stlload.c b/usr.sbin/stallion/stlload/stlload.c index 2fca08a6d4..98db957ee2 100644 --- a/usr.sbin/stallion/stlload/stlload.c +++ b/usr.sbin/stallion/stlload/stlload.c @@ -373,11 +373,11 @@ download(void) return(-1); } - strttime = time((time_t *) NULL); + strttime = time(NULL); if (verbose) printf("Waiting for slave alive marker, time=%x timeout=%d\n", strttime, TIMEOUT); - while (time((time_t *) NULL) < (strttime + TIMEOUT)) { + while (time(NULL) < (strttime + TIMEOUT)) { if (lseek(memfd, CDK_RDYADDR, SEEK_SET) != CDK_RDYADDR) { warn("lseek(%x) failed on memory device", CDK_RDYADDR); return(-1); @@ -472,7 +472,7 @@ main(int argc, char *argv[]) } } - if (memdevice == (char *) NULL) { + if (memdevice == NULL) { if ((brdnr < 0) || (brdnr >= 8)) errx(1, "invalid board number %d specified", brdnr); sprintf(devstr, defdevice, brdnr); diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 95a025d3ab..4aca424bde 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1027,13 +1027,13 @@ logmsg(int pri, const char *msg, const char *from, int flags) * in the future. */ if (now > REPEATTIME(f)) { - fprintlog(f, flags, (char *)NULL); + fprintlog(f, flags, NULL); BACKOFF(f); } } else { /* new line, save it */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog(f, 0, NULL); f->f_repeatcount = 0; f->f_prevpri = pri; strlcpy(f->f_lasttime, timestamp, @@ -1042,7 +1042,7 @@ logmsg(int pri, const char *msg, const char *from, int flags) if (msglen < MAXSVLINE) { f->f_prevlen = msglen; strlcpy(f->f_prevline, msg, sizeof(f->f_prevline)); - fprintlog(f, flags, (char *)NULL); + fprintlog(f, flags, NULL); } else { f->f_prevline[0] = 0; f->f_prevlen = 0; @@ -1409,7 +1409,7 @@ reapchild(int signo __unused) pid_t pid; struct filed *f; - while ((pid = wait3(&status, WNOHANG, (struct rusage *)NULL)) > 0) { + while ((pid = wait3(&status, WNOHANG, NULL)) > 0) { if (!Initialized) /* Don't tell while we are initting. */ continue; @@ -1524,7 +1524,7 @@ die(int signo) for (f = Files; f != NULL; f = f->f_next) { /* flush any pending output */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog(f, 0, NULL); if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) { close(f->f_file); f->f_un.f_pipe.f_pid = 0; @@ -1585,7 +1585,7 @@ init(int signo) for (f = Files; f != NULL; f = next) { /* flush any pending output */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog(f, 0, NULL); switch (f->f_type) { case F_FILE: @@ -2108,7 +2108,7 @@ markit(void) struct filed *f; dq_t q, next; - now = time((time_t *)NULL); + now = time(NULL); MarkSeq += TIMERINTVL; if (MarkSeq >= MarkInterval) { logmsg(LOG_INFO, "-- MARK --", @@ -2121,7 +2121,7 @@ markit(void) dprintf("flush %s: repeated %d times, %d sec.\n", TypeNames[f->f_type], f->f_prevcount, repeatinterval[f->f_repeatcount]); - fprintlog(f, 0, (char *)NULL); + fprintlog(f, 0, NULL); BACKOFF(f); } } diff --git a/usr.sbin/timed/timed/slave.c b/usr.sbin/timed/timed/slave.c index 9399502b51..8021e7c748 100644 --- a/usr.sbin/timed/timed/slave.c +++ b/usr.sbin/timed/timed/slave.c @@ -684,6 +684,5 @@ answerdelay(void) timeout.tv_sec = 0; timeout.tv_usec = delay1; - select(0, (fd_set *)NULL, (fd_set *)NULL, (fd_set *)NULL, - &timeout); + select(0, NULL, NULL, NULL, &timeout); } diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c index e7f79e1b56..41c07f100c 100644 --- a/usr.sbin/usbd/usbd.c +++ b/usr.sbin/usbd/usbd.c @@ -802,7 +802,7 @@ execute_command(char *cmd) sigaction(SIGQUIT, &quitact, NULL); sigprocmask(SIG_SETMASK, &oldsigblock, NULL); - execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL); + execl(_PATH_BSHELL, "sh", "-c", cmd, NULL); /* should only be reached in case of error */ exit(127); diff --git a/usr.sbin/vipw/vipw.c b/usr.sbin/vipw/vipw.c index d4f882ff69..2b69dfbe96 100644 --- a/usr.sbin/vipw/vipw.c +++ b/usr.sbin/vipw/vipw.c @@ -105,9 +105,9 @@ main(int argc, char *argv[]) pw_error(tempname, 1, 1); if (begin.st_mtime == end.st_mtime) { warnx("no changes made"); - pw_error((char *)NULL, 0, 0); + pw_error(NULL, 0, 0); } - if (pw_mkdb((char *)NULL)) + if (pw_mkdb(NULL)) break; pw_prompt(); } diff --git a/usr.sbin/ypbind/yp_ping.c b/usr.sbin/ypbind/yp_ping.c index 423f7c97bc..758aceb464 100644 --- a/usr.sbin/ypbind/yp_ping.c +++ b/usr.sbin/ypbind/yp_ping.c @@ -120,7 +120,7 @@ __pmap_getport(struct sockaddr_in *address, u_long program, u_long version, client = clntudp_bufcreate(address, PMAPPROG, PMAPVERS, timeout, &sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); - if (client != (CLIENT *)NULL) { + if (client != NULL) { parms.pm_prog = program; parms.pm_vers = version; parms.pm_prot = protocol; diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index c01eccf493..ec9d3d65ac 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -773,7 +773,7 @@ ping(struct _dom_binding *ypdb) if ((client_handle = clntudp_bufcreate(&ypdb->dom_server_addr, YPPROG, YPVERS, interval, &rpcsock, RPCSMALLMSGSIZE, - RPCSMALLMSGSIZE)) == (CLIENT *)NULL) { + RPCSMALLMSGSIZE)) == NULL) { /* Can't get a handle: we're dead. */ ypdb->dom_alive = 0; ypdb->dom_vers = -1; diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 6af29f902e..3debd1cbdc 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -367,7 +367,7 @@ main(int argc, char **argv) } } - if (transp == (SVCXPRT *)NULL) { + if (transp == NULL) { _msgout("could not create a handle"); exit(1); } diff --git a/usr.sbin/zic/ialloc.c b/usr.sbin/zic/ialloc.c index c1ce785a37..3c69147239 100644 --- a/usr.sbin/zic/ialloc.c +++ b/usr.sbin/zic/ialloc.c @@ -57,7 +57,7 @@ icatalloc(char *const old, const char *new) char * icpyalloc(const char *string) { - return icatalloc((char *) NULL, string); + return icatalloc(NULL, string); } void -- 2.41.0