git: Sweep-fix comparing pointers with 0 (and assigning 0 to pointers).

Sascha Wildner swildner at crater.dragonflybsd.org
Tue Mar 6 11:08:50 PST 2012


commit 678e8cc6002ecd3a79cdae95ac8b454437219fc5
Author: Sascha Wildner <saw at online.de>
Date:   Mon Mar 5 22:05:24 2012 +0100

    Sweep-fix comparing pointers with 0 (and assigning 0 to pointers).
    
    For better readability, don't compare pointers with 0 or assign 0
    to them. Use NULL instead.
    
    The change was done with coccinelle.

Summary of changes:
 bin/df/df.c                                    |    7 +-
 bin/ps/fmt.c                                   |    7 +-
 bin/ps/ps.c                                    |    3 +-
 bin/rcp/rcp.c                                  |    2 +-
 bin/sh/miscbltin.c                             |    2 +-
 bin/sh/parser.c                                |    2 +-
 bin/test/test.c                                |    2 +-
 games/adventure/io.c                           |    5 +-
 games/adventure/subr.c                         |    5 +-
 games/backgammon/backgammon/move.c             |   21 +++---
 games/backgammon/backgammon/text.c             |    3 +-
 games/backgammon/common_source/fancy.c         |    3 +-
 games/backgammon/common_source/subs.c          |    3 +-
 games/battlestar/save.c                        |    7 +-
 games/canfield/canfield/canfield.c             |    5 +-
 games/canfield/cfscores/cfscores.c             |    7 +-
 games/hack/hack.Decl.c                         |   13 ++--
 games/hack/hack.c                              |    3 +-
 games/hack/hack.dog.c                          |    5 +-
 games/hack/hack.end.c                          |    5 +-
 games/hack/hack.engrave.c                      |    9 +--
 games/hack/hack.invent.c                       |    5 +-
 games/hack/hack.lev.c                          |    5 +-
 games/hack/hack.main.c                         |    7 +-
 games/hack/hack.objnam.c                       |    3 +-
 games/hack/hack.pager.c                        |    5 +-
 games/hack/hack.rumors.c                       |    3 +-
 games/hack/hack.save.c                         |    9 +--
 games/hack/hack.shk.c                          |   17 ++---
 games/hack/hack.termcap.c                      |    3 +-
 games/hack/hack.topl.c                         |    5 +-
 games/hack/hack.unix.c                         |    7 +-
 games/hack/hack.vault.c                        |   11 ++--
 games/hack/hack.worm.c                         |    5 +-
 games/hack/hack.worn.c                         |    3 +-
 games/larn/data.c                              |    3 +-
 games/larn/diag.c                              |    5 +-
 games/larn/io.c                                |    5 +-
 games/larn/main.c                              |   11 ++--
 games/larn/monster.c                           |   11 ++--
 games/larn/movem.c                             |    5 +-
 games/larn/tok.c                               |   11 ++--
 games/rogue/hit.c                              |    9 +--
 games/sail/dr_1.c                              |    9 +--
 games/sail/dr_3.c                              |    5 +-
 games/sail/dr_5.c                              |    3 +-
 games/sail/lo_main.c                           |    3 +-
 games/sail/misc.c                              |    3 +-
 games/sail/pl_2.c                              |    3 +-
 games/sail/pl_3.c                              |    3 +-
 games/sail/pl_7.c                              |    3 +-
 games/sail/sync.c                              |    5 +-
 games/trek/getpar.c                            |    3 +-
 games/trek/kill.c                              |    3 +-
 games/trek/klmove.c                            |    3 +-
 lib/libalias/alias_db.c                        |    3 +-
 lib/libbluetooth/bluetooth.c                   |    5 +-
 lib/libc/citrus/citrus_iconv.h                 |    3 +-
 lib/libc/citrus/citrus_none.c                  |    3 +-
 lib/libc/citrus/modules/citrus_big5.c          |    5 +-
 lib/libc/citrus/modules/citrus_euc.c           |    5 +-
 lib/libc/citrus/modules/citrus_euctw.c         |    5 +-
 lib/libc/citrus/modules/citrus_iso2022.c       |    7 +-
 lib/libc/citrus/modules/citrus_johab.c         |    3 +-
 lib/libc/citrus/modules/citrus_mskanji.c       |    3 +-
 lib/libc/citrus/modules/citrus_utf1632.c       |    5 +-
 lib/libc/citrus/modules/citrus_utf8.c          |    5 +-
 lib/libc/gen/err.c                             |    9 +--
 lib/libc/gen/getmntinfo.c                      |    3 +-
 lib/libc/gen/getmntvinfo.c                     |    5 +-
 lib/libc/gen/getvfsent.c                       |   15 ++--
 lib/libc/gen/tls.c                             |    5 +-
 lib/libc/locale/_wcstol.h                      |    3 +-
 lib/libc/locale/_wcstoul.h                     |    3 +-
 lib/libc/locale/setlocale.c                    |    3 +-
 lib/libc/net/base64.c                          |    3 +-
 lib/libc/net/gethostbyht.c                     |    3 +-
 lib/libc/net/getifaddrs.c                      |    3 +-
 lib/libc/net/getnetbyht.c                      |    3 +-
 lib/libc/net/getprotoname.c                    |    3 +-
 lib/libc/net/getservent.c                      |    5 +-
 lib/libc/net/rcmd.c                            |    3 +-
 lib/libc/resolv/mtctxres.c                     |    8 +-
 lib/libc/resolv/res_init.c                     |    4 +-
 lib/libc/resolv/res_mkupdate.c                 |    4 +-
 lib/libc/rpc/auth_none.c                       |    5 +-
 lib/libc/rpc/clnt_perror.c                     |    7 +-
 lib/libc/rpc/des_crypt.c                       |    3 +-
 lib/libc/rpc/getnetpath.c                      |    2 +-
 lib/libc/rpc/getpublickey.c                    |    3 +-
 lib/libc/rpc/key_call.c                        |    6 +-
 lib/libc/rpc/mt_misc.c                         |    4 +-
 lib/libc/rpc/rpcdname.c                        |    7 +-
 lib/libc/stdio/fputwc.c                        |    3 +-
 lib/libc/stdio/ungetwc.c                       |    3 +-
 lib/libc/stdlib/_strtol.h                      |    4 +-
 lib/libc/stdlib/_strtoul.h                     |    4 +-
 lib/libc/stdlib/tsearch.c                      |    3 +-
 lib/libc/uuid/uuid_to_string.c                 |    3 +-
 lib/libc/xdr/xdr_mem.c                         |    3 +-
 lib/libcompat/4.1/getpw.c                      |    3 +-
 lib/libcompat/4.3/rexec.c                      |   12 ++--
 lib/libcompat/regexp/regexp.c                  |    3 +-
 lib/libedit/filecomplete.c                     |    4 +-
 lib/libevtr/ktrfmt.yy.c                        |    8 +-
 lib/libfetch/ftp.c                             |    3 +-
 lib/libipsec/pfkey.c                           |    3 +-
 lib/libipx/ipx_addr.c                          |    5 +-
 lib/libkcore/kcore_proc.c                      |    4 +-
 lib/libkvm/kvm.c                               |    7 +-
 lib/libkvm/kvm_file.c                          |    3 +-
 lib/libkvm/kvm_i386.c                          |    3 +-
 lib/libkvm/kvm_minidump_i386.c                 |    2 +-
 lib/libkvm/kvm_minidump_x86_64.c               |    2 +-
 lib/libkvm/kvm_proc.c                          |   19 +++---
 lib/libkvm/kvm_sparc.c                         |    3 +-
 lib/libkvm/kvm_x86_64.c                        |    2 +-
 lib/libm/src/e_j0.c                            |    5 +-
 lib/libm/src/e_j0f.c                           |    5 +-
 lib/libm/src/e_j1.c                            |    5 +-
 lib/libm/src/e_j1f.c                           |    5 +-
 lib/libpuffs/null.c                            |    2 +-
 lib/libstand/cd9660.c                          |    5 +-
 lib/libstand/nfs.c                             |    7 +-
 lib/libstand/strtol.c                          |    3 +-
 lib/libtelnet/auth.c                           |    5 +-
 lib/libtelnet/encrypt.c                        |   21 +++---
 lib/libtelnet/genget.c                         |    8 +-
 lib/libtelnet/kerberos5.c                      |    3 +-
 lib/libtelnet/krb4encpwd.c                     |    5 +-
 lib/libtelnet/misc.c                           |    3 +-
 lib/libtelnet/pk.c                             |    3 +-
 lib/libtelnet/rsaencpwd.c                      |    3 +-
 lib/libthread_xu/thread/thr_private.h          |    4 +-
 lib/libusbhid/usage.c                          |    7 +-
 lib/libvgl/text.c                              |    3 +-
 lib/libypclnt/ypclnt_passwd.c                  |    4 +-
 lib/pam_module/pam_login_access/login_access.c |    4 +-
 libexec/bootpd/tools/bootptest/print-bootp.c   |    5 +-
 libexec/ftpd/ftpd.c                            |   13 ++--
 libexec/ftpd/popen.c                           |    3 +-
 libexec/getty/subr.c                           |    3 +-
 libexec/rbootd/bpf.c                           |    5 +-
 libexec/rlogind/rlogind.c                      |    3 +-
 libexec/rtld-elf/rtld.c                        |    2 +-
 libexec/telnetd/state.c                        |    7 +-
 libexec/telnetd/sys_term.c                     |    6 +-
 libexec/telnetd/telnetd.c                      |    5 +-
 libexec/tftpd/tftpd.c                          |    3 +-
 sbin/disklabel32/disklabel.c                   |   12 ++--
 sbin/disklabel64/disklabel64.c                 |    4 +-
 sbin/dump/itime.c                              |    2 +-
 sbin/fsck/fsutil.c                             |    4 +-
 sbin/fsck/inode.c                              |    3 +-
 sbin/fsck/pass4.c                              |    3 +-
 sbin/fsck/pass5.c                              |    3 +-
 sbin/fsck/preen.c                              |    9 +--
 sbin/fsck/utilities.c                          |    3 +-
 sbin/fsck_msdosfs/dir.c                        |    2 +-
 sbin/fsdb/fsdbutil.c                           |    3 +-
 sbin/ifconfig/af_inet.c                        |    4 +-
 sbin/init/init.c                               |   56 +++++++-------
 sbin/ip6fw/ip6fw.c                             |    5 +-
 sbin/ipfw/ipfw2.c                              |    4 +-
 sbin/iscontrol/config.c                        |    2 +-
 sbin/iscontrol/iscontrol.c                     |    2 +-
 sbin/mkinitrd/mini_init/oinit.c                |    2 +-
 sbin/mount_portal/conf.c                       |    7 +-
 sbin/mount_portal/pt_tcp.c                     |    7 +-
 sbin/mount_portal/pt_tcplisten.c               |    7 +-
 sbin/mountd/mountd.c                           |    3 +-
 sbin/ping6/ping6.c                             |    5 +-
 sbin/quotacheck/quotacheck.c                   |    5 +-
 sbin/restore/utilities.c                       |    3 +-
 sbin/route/route.c                             |    6 +-
 sbin/routed/if.c                               |   93 ++++++++++++------------
 sbin/routed/input.c                            |   53 +++++++-------
 sbin/routed/main.c                             |   23 +++---
 sbin/routed/output.c                           |   39 +++++-----
 sbin/routed/parms.c                            |   25 +++----
 sbin/routed/radix.c                            |   25 +++----
 sbin/routed/rdisc.c                            |   37 +++++-----
 sbin/routed/rtquery/rtquery.c                  |   37 +++++-----
 sbin/routed/table.c                            |   91 ++++++++++++------------
 sbin/routed/trace.c                            |   53 +++++++-------
 sbin/slattach/slattach.c                       |    7 +-
 sbin/startslip/startslip.c                     |    3 +-
 sbin/umount/umount.c                           |    3 +-
 test/interbench/hackbench.c                    |    2 +-
 test/stress/stress2/testcases/fts/fts.c        |    2 +-
 test/stress/stress2/testcases/run/run.c        |    2 +-
 test/stress/stress2/testcases/shm/shm.c        |    2 +-
 test/testcases/crypto/aesctr/aesctr.c          |    4 +-
 tools/regression/p1003_1b/sched.c              |    3 +-
 tools/test/malloc/main.c                       |    8 +--
 tools/tools/net80211/stumbler/stumbler.c       |    8 +-
 tools/tools/net80211/w00t/assoc/assoc.c        |    2 +-
 tools/tools/net80211/w00t/expand/expand.c      |    2 +-
 tools/tools/net80211/w00t/libw00t/w00t.c       |    2 +-
 tools/tools/net80211/w00t/redir/redir.c        |    4 +-
 tools/tools/net80211/wesside/dics/dics.c       |    2 +-
 tools/tools/net80211/wesside/wesside/wesside.c |   14 ++--
 tools/tools/net80211/wlanwatch/wlanwatch.c     |    4 +-
 usr.bin/chat/chat.c                            |    3 +-
 usr.bin/doscmd/AsyncIO.c                       |   13 ++--
 usr.bin/doscmd/config.c                        |    3 +-
 usr.bin/doscmd/cwd.c                           |   13 ++--
 usr.bin/doscmd/doscmd.c                        |   15 ++--
 usr.bin/doscmd/int13.c                         |   27 ++++----
 usr.bin/doscmd/int17.c                         |    7 +-
 usr.bin/doscmd/intff.c                         |    7 +-
 usr.bin/doscmd/mouse.c                         |    3 +-
 usr.bin/doscmd/port.c                          |    7 +-
 usr.bin/doscmd/tty.c                           |   13 ++--
 usr.bin/ee/new_curse.c                         |    3 +-
 usr.bin/find/find.c                            |    3 +-
 usr.bin/find/function.c                        |    3 +-
 usr.bin/finger/net.c                           |    5 +-
 usr.bin/fmt/fmt.c                              |    5 +-
 usr.bin/gzip/gzip.c                            |    3 +-
 usr.bin/indent/lexi.c                          |    4 +-
 usr.bin/indent/pr_comment.c                    |    8 +-
 usr.bin/killall/killall.c                      |    3 +-
 usr.bin/lex/initscan.c                         |    8 +-
 usr.bin/lex/main.c                             |    3 +-
 usr.bin/lex/misc.c                             |    2 +-
 usr.bin/lex/sym.c                              |    3 +-
 usr.bin/login/login_fbtab.c                    |    7 +-
 usr.bin/m4/gnum4.c                             |    5 +-
 usr.bin/mail/cmd2.c                            |    9 +--
 usr.bin/mail/cmd3.c                            |    3 +-
 usr.bin/mail/lex.c                             |    5 +-
 usr.bin/mail/send.c                            |    5 +-
 usr.bin/make/job.c                             |    3 +-
 usr.bin/mkstr/mkstr.c                          |    5 +-
 usr.bin/netstat/if.c                           |    2 +-
 usr.bin/netstat/inet.c                         |    9 +--
 usr.bin/netstat/inet6.c                        |    5 +-
 usr.bin/netstat/ipx.c                          |    5 +-
 usr.bin/netstat/iso.c                          |    5 +-
 usr.bin/netstat/main.c                         |    2 +-
 usr.bin/netstat/route.c                        |   14 ++--
 usr.bin/netstat/unix.c                         |    3 +-
 usr.bin/newkey/generic.c                       |    3 +-
 usr.bin/nfsstat/nfsstat.c                      |    3 +-
 usr.bin/quota/quota.c                          |    3 +-
 usr.bin/rdist/expand.c                         |    7 +-
 usr.bin/rdist/main.c                           |    3 +-
 usr.bin/rdist/rshrcmd.c                        |    5 +-
 usr.bin/rdist/server.c                         |    3 +-
 usr.bin/rpcgen/rpc_main.c                      |   15 ++--
 usr.bin/rs/rs.c                                |    3 +-
 usr.bin/sed/compile.c                          |    7 +-
 usr.bin/sort/sort.c                            |    2 +-
 usr.bin/systat/mbufs.c                         |    5 +-
 usr.bin/systat/netcmds.c                       |   14 ++--
 usr.bin/systat/netstat.c                       |    7 +-
 usr.bin/talk/get_addrs.c                       |    2 +-
 usr.bin/telnet/commands.c                      |   69 +++++++++---------
 usr.bin/telnet/main.c                          |    3 +-
 usr.bin/telnet/telnet.c                        |   21 +++---
 usr.bin/telnet/utilities.c                     |    3 +-
 usr.bin/tftp/main.c                            |    6 +-
 usr.bin/tip/libacu/v831.c                      |    2 +-
 usr.bin/tip/tip/value.c                        |    2 +-
 usr.bin/units/units.c                          |    5 +-
 usr.bin/usbhidctl/usbhid.c                     |   12 ++--
 usr.bin/vmstat/vmstat.c                        |    3 +-
 usr.bin/whereis/whereis.c                      |    9 +--
 usr.bin/window/cmd.c                           |   20 +++---
 usr.bin/window/cmd2.c                          |    2 +-
 usr.bin/window/cmd6.c                          |    6 +-
 usr.bin/window/cmd7.c                          |    6 +-
 usr.bin/window/compress.c                      |   56 +++++++-------
 usr.bin/window/context.c                       |    4 +-
 usr.bin/window/error.c                         |    8 +-
 usr.bin/window/lcmd1.c                         |   20 +++---
 usr.bin/window/lcmd2.c                         |   24 +++---
 usr.bin/window/main.c                          |    8 +-
 usr.bin/window/parser2.c                       |   34 +++++-----
 usr.bin/window/parser4.c                       |    2 +-
 usr.bin/window/parser5.c                       |    4 +-
 usr.bin/window/startup.c                       |    4 +-
 usr.bin/window/string.c                        |    8 +-
 usr.bin/window/ttgeneric.c                     |   22 +++---
 usr.bin/window/ttinit.c                        |    4 +-
 usr.bin/window/tttermcap.c                     |    6 +-
 usr.bin/window/ttwyse60.c                      |    4 +-
 usr.bin/window/ttwyse75.c                      |    4 +-
 usr.bin/window/var.c                           |   12 ++--
 usr.bin/window/win.c                           |   16 ++--
 usr.bin/window/wwalloc.c                       |    2 +-
 usr.bin/window/wwinit.c                        |    2 +-
 usr.bin/window/wwiomux.c                       |    2 +-
 usr.bin/window/wwopen.c                        |    4 +-
 usr.bin/window/wwsize.c                        |   30 ++++----
 usr.bin/window/wwunframe.c                     |    2 +-
 usr.bin/window/wwwrite.c                       |   10 ++--
 usr.bin/window/xx.c                            |   12 ++--
 usr.bin/window/xxflush.c                       |    6 +-
 usr.bin/yacc/error.c                           |    3 +-
 usr.bin/yacc/lr0.c                             |    5 +-
 usr.bin/yacc/main.c                            |   35 +++++-----
 usr.bin/yacc/mkpar.c                           |    7 +-
 usr.bin/yacc/output.c                          |    9 +--
 usr.bin/yacc/reader.c                          |   91 ++++++++++++------------
 usr.bin/yacc/symtab.c                          |    9 +--
 usr.bin/yacc/verbose.c                         |    3 +-
 usr.sbin/IPXrouted/af.c                        |    3 +-
 usr.sbin/IPXrouted/if.c                        |    7 +-
 usr.sbin/IPXrouted/input.c                     |   19 +++---
 usr.sbin/IPXrouted/sap_input.c                 |    7 +-
 usr.sbin/IPXrouted/startup.c                   |    4 +-
 usr.sbin/IPXrouted/tables.c                    |    7 +-
 usr.sbin/arp/arp.c                             |    3 +-
 usr.sbin/cdcontrol/cdcontrol.c                 |    3 +-
 usr.sbin/config/mkheaders.c                    |    3 +-
 usr.sbin/config/mkmakefile.c                   |   12 ++--
 usr.sbin/config/mkoptions.c                    |    5 +-
 usr.sbin/cron/cron/popen.c                     |    3 +-
 usr.sbin/daemon/daemon.c                       |    3 +-
 usr.sbin/edquota/edquota.c                     |    2 +-
 usr.sbin/gifconfig/gifconfig.c                 |    3 +-
 usr.sbin/inetd/builtins.c                      |    3 +-
 usr.sbin/inetd/inetd.c                         |    7 +-
 usr.sbin/kernbb/kernbb.c                       |    5 +-
 usr.sbin/kgmon/kgmon.c                         |    3 +-
 usr.sbin/lpr/chkprintcap/chkprintcap.c         |    9 +--
 usr.sbin/lpr/common_source/common.c            |    5 +-
 usr.sbin/lpr/common_source/net.c               |    3 +-
 usr.sbin/lpr/common_source/printcap.c          |    9 +--
 usr.sbin/lpr/common_source/request.c           |    5 +-
 usr.sbin/lpr/common_source/rmjob.c             |    2 +-
 usr.sbin/lpr/lpc/lpc.c                         |    9 +--
 usr.sbin/lpr/lpd/printjob.c                    |    7 +-
 usr.sbin/lpr/lpr/lpr.c                         |    5 +-
 usr.sbin/mfiutil/mfi_patrol.c                  |    2 +-
 usr.sbin/mrouted/callout.c                     |    9 +--
 usr.sbin/mrouted/main.c                        |    2 +-
 usr.sbin/mrouted/mapper.c                      |    9 +--
 usr.sbin/mrouted/mtrace.c                      |    7 +-
 usr.sbin/mrouted/prune.c                       |    3 +-
 usr.sbin/mrouted/route.c                       |    3 +-
 usr.sbin/mrouted/vif.c                         |   17 ++---
 usr.sbin/mtree/excludes.c                      |    7 +-
 usr.sbin/ppp/command.c                         |    3 +-
 usr.sbin/ppp/filter.c                          |    3 +-
 usr.sbin/pppctl/pppctl.c                       |    3 +-
 usr.sbin/pppd/main.c                           |   21 +++---
 usr.sbin/pstat/pstat.c                         |    5 +-
 usr.sbin/puffs/mount_psshfs/fs.c               |    2 +-
 usr.sbin/quot/quot.c                           |    3 +-
 usr.sbin/repquota/repquota.c                   |   11 ++--
 usr.sbin/rmt/rmt.c                             |    7 +-
 usr.sbin/route6d/route6d.c                     |   12 ++--
 usr.sbin/rtadvd/rtadvd.c                       |    2 +-
 usr.sbin/timed/timed/acksend.c                 |    5 +-
 usr.sbin/timed/timed/master.c                  |    7 +-
 usr.sbin/timed/timed/readmsg.c                 |    5 +-
 usr.sbin/timed/timed/slave.c                   |    7 +-
 usr.sbin/timed/timed/timed.c                   |   49 ++++++-------
 usr.sbin/timed/timedc/cmds.c                   |    9 +--
 usr.sbin/timed/timedc/timedc.c                 |   13 ++--
 usr.sbin/traceroute/traceroute.c               |    7 +-
 usr.sbin/traceroute6/traceroute6.c             |    3 +-
 usr.sbin/tzsetup/tzsetup.c                     |   13 ++--
 usr.sbin/usbdevs/usbdevs.c                     |    5 +-
 usr.sbin/zic/zic.c                             |   12 ++--
 368 files changed, 1305 insertions(+), 1568 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/678e8cc6002ecd3a79cdae95ac8b454437219fc5


-- 
DragonFly BSD source repository





More information about the Commits mailing list