From 3641b7cac336b1a276f869505f71996e145378c4 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 5 Jun 2008 18:06:33 +0000 Subject: [PATCH] * Fix some cases where NULL was used but 0 was meant (and vice versa). * Remove some bogus casts of NULL to (void *). --- bin/mined/mined1.c | 10 +++++----- bin/pax/options.c | 4 ++-- games/larn/io.c | 12 ++++++------ games/larn/main.c | 4 ++-- games/mille/comp.c | 4 ++-- games/number/number.c | 4 ++-- gnu/usr.bin/gdb/kgdb/trgt_i386.c | 8 ++++---- gnu/usr.bin/gdb/libgdb/freebsd-uthread.c | 4 ++-- lib/libc/gen/dlfcn.c | 4 ++-- lib/libc/regex/cclass.h | 4 ++-- lib/libkvm/kvm_proc.c | 4 ++-- lib/libncp/ncpl_nls.c | 4 ++-- sbin/jscan/jscan.c | 4 ++-- sbin/kget/kget.c | 6 +++--- sbin/restore/restore.c | 4 ++-- sbin/vinum/commands.c | 4 ++-- sys/boot/pc32/loader/main.c | 6 +++--- sys/bus/pci/pci.c | 4 ++-- sys/dev/acpica5/Osd/OsdSchedule.c | 4 ++-- sys/dev/acpica5/acpi.c | 4 ++-- sys/dev/atm/hfa/fore_buffer.c | 6 +++--- sys/dev/disk/mpt/mpt_pci.c | 4 ++-- sys/dev/disk/nsp/nsp.c | 6 +++--- sys/dev/netif/bfe/if_bfe.c | 4 ++-- sys/dev/netif/wi/if_wi_pci.c | 4 ++-- sys/dev/raid/asr/asr.c | 10 +++++----- sys/dev/raid/twe/twe.c | 4 ++-- sys/dev/raid/vinum/vinumdaemon.c | 4 ++-- sys/dev/raid/vinum/vinumio.c | 4 ++-- sys/dev/serial/cy/cy.c | 4 ++-- sys/dev/serial/sio/sio.c | 4 ++-- sys/dev/serial/stl/stallion.c | 4 ++-- sys/dev/serial/stli/istallion.c | 6 +++--- sys/kern/kern_cputimer.c | 10 +++++----- sys/kern/subr_disk.c | 4 ++-- sys/kern/sys_pipe.c | 10 +++++----- sys/kern/uipc_domain.c | 4 ++-- sys/kern/uipc_mbuf.c | 4 ++-- sys/net/if_atmsubr.c | 4 ++-- sys/net/pf/pf.c | 5 ++--- sys/net/tun/if_tun.c | 4 ++-- sys/netinet/sctp_indata.c | 6 +++--- sys/netinet/tcp_usrreq.c | 6 +++--- sys/netinet6/ip6_mroute.c | 4 ++-- sys/netinet6/ip6_output.c | 12 ++++++------ sys/platform/pc32/i386/busdma_machdep.c | 4 ++-- sys/platform/pc32/i386/est.c | 6 +++--- sys/platform/pc32/i386/pmap.c | 4 ++-- test/stress/fsstress/fsstress.c | 4 ++-- usr.bin/doscmd/xms.c | 4 ++-- usr.bin/finger/finger.c | 4 ++-- usr.bin/gcore/elfcore.c | 4 ++-- usr.bin/head/head.c | 6 +++--- usr.bin/login/login_access.c | 4 ++-- usr.bin/mkstr/mkstr.c | 4 ++-- usr.bin/newkey/generic.c | 4 ++-- usr.bin/systat/ifstat.c | 6 +++--- usr.bin/whereis/whereis.c | 7 +++---- usr.bin/who/who.c | 8 +++----- usr.sbin/burncd/burncd.c | 4 ++-- usr.sbin/keyserv/setkey.c | 12 ++++++------ usr.sbin/rtadvd/rrenum.c | 4 ++-- usr.sbin/setkey/token.l | 10 +++++----- usr.sbin/vidcontrol/vidcontrol.c | 6 +++--- 64 files changed, 170 insertions(+), 174 deletions(-) diff --git a/bin/mined/mined1.c b/bin/mined/mined1.c index b3b2795690..e47dc85736 100644 --- a/bin/mined/mined1.c +++ b/bin/mined/mined1.c @@ -33,7 +33,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * [original code from minix codebase] - * $DragonFly: src/bin/mined/mined1.c,v 1.8 2005/11/06 11:44:02 swildner Exp $* + * $DragonFly: src/bin/mined/mined1.c,v 1.9 2008/06/05 18:06:30 swildner Exp $* */ /* * Part one of the mined editor. @@ -643,10 +643,10 @@ bottom_line(FLAG revfl, const char *s1, const char *s2, char *inbuf, *p++ = ' '; if (s1 != NIL_PTR) - while ((*p = *s1++) != NULL) + while ((*p = *s1++) != 0) p++; if (s2 != NIL_PTR) - while ((*p = *s2++) != NULL) + while ((*p = *s2++) != 0) p++; *p++ = ' '; *p++ = 0; @@ -868,7 +868,7 @@ length_of(char *string) void copy_string(char *to, const char *from) { - while ((*to++ = *from++) != NULL) + while ((*to++ = *from++) != 0) ; } @@ -1851,7 +1851,7 @@ build_string(char *buf, const char *fmt, ...) default : scanp = ""; } - while ((*buf++ = *scanp++) != NULL) + while ((*buf++ = *scanp++) != 0) ; buf--; } diff --git a/bin/pax/options.c b/bin/pax/options.c index 78f1baa4fd..50687c3491 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -36,7 +36,7 @@ * * @(#)options.c 8.2 (Berkeley) 4/18/94 * $FreeBSD: src/bin/pax/options.c,v 1.13.2.3 2001/08/01 05:03:11 obrien Exp $ - * $DragonFly: src/bin/pax/options.c,v 1.8 2006/09/27 21:58:08 pavalos Exp $ + * $DragonFly: src/bin/pax/options.c,v 1.9 2008/06/05 18:06:30 swildner Exp $ */ #include @@ -1245,7 +1245,7 @@ cpio_options(int argc, char **argv) */ maxflt = 0; while ((str = getline(stdin)) != NULL) { - ftree_add(str, NULL); + ftree_add(str, 0); } if (getline_error) { paxwarn(1, "Problem while reading stdin"); diff --git a/games/larn/io.c b/games/larn/io.c index 18cfcc50f0..5678c84017 100644 --- a/games/larn/io.c +++ b/games/larn/io.c @@ -1,6 +1,6 @@ /* io.c Larn is copyrighted 1986 by Noah Morgan. * $FreeBSD: src/games/larn/io.c,v 1.7 1999/11/16 02:57:22 billf Exp $ - * $DragonFly: src/games/larn/io.c,v 1.6 2006/08/26 17:05:05 pavalos Exp $ + * $DragonFly: src/games/larn/io.c,v 1.7 2008/06/05 18:06:30 swildner Exp $ * * Below are the functions in this file: * @@ -403,11 +403,11 @@ lgetw(void) char *lgp,cc; int n=LINBUFSIZE,quote=0; lgp = lgetwbuf; - do cc=lgetc(); while ((cc <= 32) && (cc > NULL)); /* eat whitespace */ + do cc=lgetc(); while ((cc <= 32) && (cc > 0)); /* eat whitespace */ for ( ; ; --n,cc=lgetc()) { - if ((cc==NULL) && (lgp==lgetwbuf)) return(NULL); /* EOF */ - if ((n<=1) || ((cc<=32) && (quote==0))) { *lgp=NULL; return(lgetwbuf); } + if ((cc==0) && (lgp==lgetwbuf)) return(NULL); /* EOF */ + if ((n<=1) || ((cc<=32) && (quote==0))) { *lgp=0; return(lgetwbuf); } if (cc != '"') *lgp++ = cc; else quote ^= 1; } } @@ -424,10 +424,10 @@ lgetl(void) char *str=lgetwbuf; for ( ; ; --i) { - if ((*str++ = ch = lgetc()) == NULL) + if ((*str++ = ch = lgetc()) == 0) { if (str == lgetwbuf+1) return(NULL); /* EOF */ - ot: *str = NULL; return(lgetwbuf); /* line ended by EOF */ + ot: *str = 0; return(lgetwbuf); /* line ended by EOF */ } if ((ch=='\n') || (i<=1)) goto ot; /* line ended by \n */ } diff --git a/games/larn/main.c b/games/larn/main.c index 0e2df15655..58c0a25813 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -1,6 +1,6 @@ /* main.c */ /* $FreeBSD: src/games/larn/main.c,v 1.9 1999/11/30 03:48:59 billf Exp $ */ -/* $DragonFly: src/games/larn/main.c,v 1.4 2006/08/26 17:05:05 pavalos Exp $ */ +/* $DragonFly: src/games/larn/main.c,v 1.5 2008/06/05 18:06:30 swildner Exp $ */ #include #include #include "header.h" @@ -475,7 +475,7 @@ static void show1(int idx, const char *str2[]) { lprintf("\n%c) %s",idx+'a',objectname[(int)iven[idx]]); - if(str2 != NULL && str2[ivenarg[idx]][0] != NULL) + if(str2 != NULL && str2[ivenarg[idx]][0] != 0) lprintf(" of%s", str2[ivenarg[idx]]); } diff --git a/games/mille/comp.c b/games/mille/comp.c index 24466021a4..39a37da054 100644 --- a/games/mille/comp.c +++ b/games/mille/comp.c @@ -32,7 +32,7 @@ * * @(#)comp.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/mille/comp.c,v 1.5 1999/12/12 06:17:24 billf Exp $ - * $DragonFly: src/games/mille/comp.c,v 1.3 2006/08/27 17:17:23 pavalos Exp $ + * $DragonFly: src/games/mille/comp.c,v 1.4 2008/06/05 18:06:30 swildner Exp $ */ # include "mille.h" @@ -73,7 +73,7 @@ calcmove(void) switch (card) { case C_STOP: case C_CRASH: case C_FLAT: case C_EMPTY: - if ((playit[i] = canplay(pp, op, card)) != NULL) + if ((playit[i] = canplay(pp, op, card)) != 0) canstop = TRUE; goto norm; case C_LIMIT: diff --git a/games/number/number.c b/games/number/number.c index a1178587ce..6078973aea 100644 --- a/games/number/number.c +++ b/games/number/number.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)number.c 8.3 (Berkeley) 5/4/95 * $FreeBSD: src/games/number/number.c,v 1.12 1999/12/12 03:22:35 billf Exp $ - * $DragonFly: src/games/number/number.c,v 1.4 2005/04/25 16:10:24 liamfoy Exp $ + * $DragonFly: src/games/number/number.c,v 1.5 2008/06/05 18:06:30 swildner Exp $ */ #include @@ -121,7 +121,7 @@ convert(char *line) int flen, len, rval; char *p, *fraction; - flen = NULL; + flen = 0; fraction = NULL; for (p = line; *p != '\0' && *p != '\n'; ++p) { if (isblank(*p)) { diff --git a/gnu/usr.bin/gdb/kgdb/trgt_i386.c b/gnu/usr.bin/gdb/kgdb/trgt_i386.c index c0b6d443a8..febd216686 100644 --- a/gnu/usr.bin/gdb/kgdb/trgt_i386.c +++ b/gnu/usr.bin/gdb/kgdb/trgt_i386.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v 1.5 2005/09/11 05:36:30 marcel Exp $ - * $DragonFly: src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v 1.5 2008/01/14 21:36:38 corecode Exp $ + * $DragonFly: src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v 1.6 2008/06/05 18:06:30 swildner Exp $ */ #include @@ -61,9 +61,9 @@ kgdb_trgt_fetch_registers(struct regcache *regcache, int regno) } /* - * kt->pcb == NULL is a marker for "non-dumping kernel thread". + * kt->pcb == 0 is a marker for "non-dumping kernel thread". */ - if (kt->pcb == NULL) { + if (kt->pcb == 0) { uintptr_t regs[5]; uintptr_t addr; uintptr_t sp; @@ -236,7 +236,7 @@ kgdb_trgt_trapframe_sniffer(const struct frame_unwind *self, pname = NULL; find_pc_partial_function(pc, &pname, NULL, NULL); if (pname == NULL) - return (NULL); + return (0); if (strcmp(pname, "calltrap") == 0 || strcmp(pname, "dblfault_handler") == 0 || (pname[0] == 'X' && pname[1] != '_')) diff --git a/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c b/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c index 44e6cfaad8..d0376ba74f 100644 --- a/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c +++ b/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* $FreeBSD: ports/devel/gdb6/files/freebsd-uthread.c,v 1.2 2004/06/20 18:45:36 obrien Exp $ */ -/* $DragonFly: src/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c,v 1.3 2006/10/23 09:14:55 corecode Exp $ */ +/* $DragonFly: src/gnu/usr.bin/gdb/libgdb/freebsd-uthread.c,v 1.4 2008/06/05 18:06:30 swildner Exp $ */ /* This module implements a sort of half target that sits between the machine-independent parts of GDB and the ptrace interface (infptrace.c) to @@ -281,7 +281,7 @@ find_pthread_addr (ptid_t ptid) ptr = read_pthread_next(ptr); } - return NULL; + return 0; } static struct cached_pthread * diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index f85c76796c..d7ffc5c97c 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libc/gen/dlfcn.c,v 1.6.2.1 2003/02/20 20:42:45 kan Exp $ - * $DragonFly: src/lib/libc/gen/dlfcn.c,v 1.4 2005/04/27 11:57:57 joerg Exp $ + * $DragonFly: src/lib/libc/gen/dlfcn.c,v 1.5 2008/06/05 18:06:30 swildner Exp $ */ #include @@ -94,5 +94,5 @@ int dlinfo(void *handle __unused, int request __unused, void *p __unused) { _rtld_error(sorry); - return NULL; + return 0; } diff --git a/lib/libc/regex/cclass.h b/lib/libc/regex/cclass.h index 7fee7a49c2..4e601a3cd4 100644 --- a/lib/libc/regex/cclass.h +++ b/lib/libc/regex/cclass.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)cclass.h 8.3 (Berkeley) 3/20/94 - * $DragonFly: src/lib/libc/regex/cclass.h,v 1.2 2005/11/20 09:18:37 swildner Exp $ + * $DragonFly: src/lib/libc/regex/cclass.h,v 1.3 2008/06/05 18:06:30 swildner Exp $ */ @@ -59,5 +59,5 @@ static struct cclass { {"space", CSPACE}, {"upper", CUPPER}, {"xdigit", CXDIGIT}, - {NULL, NULL} + {NULL, 0} }; diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 7d14941f07..e7e2681eb3 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.25.2.3 2002/08/24 07:27:46 kris Exp $ - * $DragonFly: src/lib/libkvm/kvm_proc.c,v 1.17 2007/08/15 19:37:52 dillon Exp $ + * $DragonFly: src/lib/libkvm/kvm_proc.c,v 1.18 2008/06/05 18:06:30 swildner Exp $ * * @(#)kvm_proc.c 8.3 (Berkeley) 9/23/93 */ @@ -785,7 +785,7 @@ kvm_doargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr, static u_long ps_strings; size_t len; - if (ps_strings == NULL) { + if (ps_strings == 0) { len = sizeof(ps_strings); if (sysctlbyname("kern.ps_strings", &ps_strings, &len, NULL, 0) == -1) diff --git a/lib/libncp/ncpl_nls.c b/lib/libncp/ncpl_nls.c index d3ce706294..4efdb2690e 100644 --- a/lib/libncp/ncpl_nls.c +++ b/lib/libncp/ncpl_nls.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libncp/ncpl_nls.c,v 1.2.2.1 2002/04/30 08:18:24 bp Exp $ - * $DragonFly: src/lib/libncp/ncpl_nls.c,v 1.2 2003/06/17 04:26:50 dillon Exp $ + * $DragonFly: src/lib/libncp/ncpl_nls.c,v 1.3 2008/06/05 18:06:30 swildner Exp $ */ /* @@ -228,7 +228,7 @@ static struct ncp_nlsdesc ncp_nlslist[] = { {NCP_NLS_SE, NCP_NLS_SE_NAME, {def2lower, def2upper, se_nw2unix, se_unix2nw, 0} }, - {NULL, 0} + {0, NULL} }; struct ncp_nlstables ncp_nls; diff --git a/sbin/jscan/jscan.c b/sbin/jscan/jscan.c index 53925e11d8..c020e7b9da 100644 --- a/sbin/jscan/jscan.c +++ b/sbin/jscan/jscan.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sbin/jscan/jscan.c,v 1.12 2007/08/09 21:53:02 swildner Exp $ + * $DragonFly: src/sbin/jscan/jscan.c,v 1.13 2008/06/05 18:06:30 swildner Exp $ */ #include "jscan.h" @@ -226,7 +226,7 @@ main(int ac, char **av) jf = jopen_fd(input_fd); } else if (stat(av[optind], &st) == 0 && S_ISREG(st.st_mode)) { input_prefix = av[optind]; - if ((input_fd = open(av[optind], O_RDONLY)) != NULL) { + if ((input_fd = open(av[optind], O_RDONLY)) != 0) { jf = jopen_fd(input_fd); } else { jf = NULL; diff --git a/sbin/kget/kget.c b/sbin/kget/kget.c index 075846b3ad..ed32198b3c 100644 --- a/sbin/kget/kget.c +++ b/sbin/kget/kget.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/kget/kget.c,v 1.4.2.2 2001/08/01 08:19:51 obrien Exp $ - * $DragonFly: src/sbin/kget/kget.c,v 1.5 2005/01/15 08:36:25 cpressey Exp $ + * $DragonFly: src/sbin/kget/kget.c,v 1.6 2008/06/05 18:06:30 swildner Exp $ */ #include @@ -64,7 +64,7 @@ main(int argc, char *argv[]) /* Print the changes made to ISA devices */ /* get the buffer size */ - i=sysctlbyname(mib1,NULL,&len,NULL,NULL); + i=sysctlbyname(mib1,NULL,&len,NULL,0); if(i) { perror("buffer sizing"); exit(-1); @@ -74,7 +74,7 @@ main(int argc, char *argv[]) perror("malloc"); exit(-1); } - i=sysctlbyname(mib1,buf,&len,NULL,NULL); + i=sysctlbyname(mib1,buf,&len,NULL,0); if(i) { perror("retrieving data"); exit(-1); diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index fc09ccc460..24f03fba02 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -32,7 +32,7 @@ * * @(#)restore.c 8.3 (Berkeley) 9/13/94 * $FreeBSD: src/sbin/restore/restore.c,v 1.7.2.1 2002/03/01 21:32:28 iedowse Exp $ - * $DragonFly: src/sbin/restore/restore.c,v 1.8 2005/11/06 12:49:25 swildner Exp $ + * $DragonFly: src/sbin/restore/restore.c,v 1.9 2008/06/05 18:06:31 swildner Exp $ */ #include @@ -454,7 +454,7 @@ nodeupdates(char *name, ufs1_ino_t ino, int type) * for it, we discard the name knowing that it will be on the * next incremental tape. */ - case NULL: + case 0: fprintf(stderr, "%s: (inode %d) not found on tape\n", name, ino); break; diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c index f6bdfcb2f4..6dd7ad9470 100644 --- a/sbin/vinum/commands.c +++ b/sbin/vinum/commands.c @@ -34,7 +34,7 @@ * * $Id: commands.c,v 1.14 2000/11/14 20:01:23 grog Exp grog $ * $FreeBSD: src/sbin/vinum/commands.c,v 1.31.2.6 2003/06/06 05:13:29 grog Exp $ - * $DragonFly: src/sbin/vinum/commands.c,v 1.9 2007/07/29 23:27:34 dillon Exp $ + * $DragonFly: src/sbin/vinum/commands.c,v 1.10 2008/06/05 18:06:31 swildner Exp $ */ #define _KERNEL_STRUCTURES @@ -349,7 +349,7 @@ void initplex(int plexno, char *name) { int sdno; - int plexfh = NULL; /* file handle for plex */ + int plexfh = 0; /* file handle for plex */ pid_t pid; char filename[MAXPATHLEN]; /* create a file name here */ diff --git a/sys/boot/pc32/loader/main.c b/sys/boot/pc32/loader/main.c index 05bd0237b5..a81090d144 100644 --- a/sys/boot/pc32/loader/main.c +++ b/sys/boot/pc32/loader/main.c @@ -56,7 +56,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/loader/main.c,v 1.28 2003/08/25 23:28:32 obrien Exp $ - * $DragonFly: src/sys/boot/pc32/loader/main.c,v 1.8 2004/09/09 03:47:08 joerg Exp $ + * $DragonFly: src/sys/boot/pc32/loader/main.c,v 1.9 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -204,7 +204,7 @@ main(void) /* * Special handling for PXE and CD booting. */ - if (kargs->bootinfo == NULL) { + if (kargs->bootinfo == 0) { /* * We only want the PXE disk to try to init itself in the below * walk through devsw if we actually booted off of PXE. @@ -273,7 +273,7 @@ extract_currdev(void) new_currdev.d_dev = &biosdisk; /* new-style boot loaders such as pxeldr and cdldr */ - if (kargs->bootinfo == NULL) { + if (kargs->bootinfo == 0) { if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { /* we are booting from a CD with cdboot */ new_currdev.d_dev = &bioscd; diff --git a/sys/bus/pci/pci.c b/sys/bus/pci/pci.c index 45e9cce4e1..f92d3c6052 100644 --- a/sys/bus/pci/pci.c +++ b/sys/bus/pci/pci.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/pci.c,v 1.141.2.15 2002/04/30 17:48:18 tmm Exp $ - * $DragonFly: src/sys/bus/pci/pci.c,v 1.51 2008/01/06 16:55:49 swildner Exp $ + * $DragonFly: src/sys/bus/pci/pci.c,v 1.52 2008/06/05 18:06:31 swildner Exp $ * */ @@ -1886,7 +1886,7 @@ pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) * The generic accessor doesn't deal with failure, so * we set the return value, then return an error. */ - *result = NULL; + *result = 0; return (EINVAL); case PCI_IVAR_PCIXCAP_PTR: *result = cfg->pcixcap_ptr; diff --git a/sys/dev/acpica5/Osd/OsdSchedule.c b/sys/dev/acpica5/Osd/OsdSchedule.c index a2c6e0017a..5ec1dac731 100644 --- a/sys/dev/acpica5/Osd/OsdSchedule.c +++ b/sys/dev/acpica5/Osd/OsdSchedule.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.28 2004/05/06 02:18:58 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/Osd/OsdSchedule.c,v 1.9 2007/05/24 05:51:28 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/Osd/OsdSchedule.c,v 1.10 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -96,7 +96,7 @@ acpi_task_thread(void *arg) struct acpi_task *at; for (;;) { - at = (void *)lwkt_waitport(&curthread->td_msgport, NULL); + at = (void *)lwkt_waitport(&curthread->td_msgport, 0); func = (ACPI_OSD_EXEC_CALLBACK)at->at_function; func((void *)at->at_context); lwkt_replymsg(&at->at_msg, 0); diff --git a/sys/dev/acpica5/acpi.c b/sys/dev/acpica5/acpi.c index 667f30e3fe..2120119e0a 100644 --- a/sys/dev/acpica5/acpi.c +++ b/sys/dev/acpica5/acpi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.160 2004/06/14 03:52:19 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.33 2007/11/25 00:13:28 swildner Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.34 2008/06/05 18:06:31 swildner Exp $ */ #include "opt_acpi.h" @@ -344,7 +344,7 @@ acpi_map_rsdt_header(void) ACPI_PHYSICAL_ADDRESS rsdp_addr, addr; ACPI_TABLE_RSDP *rsdp; - if ((rsdp_addr = AcpiOsGetRootPointer()) == NULL) + if ((rsdp_addr = AcpiOsGetRootPointer()) == 0) return(NULL); if ((rsdp = AcpiOsMapMemory(rsdp_addr, sizeof(*rsdp))) == NULL) return(NULL); diff --git a/sys/dev/atm/hfa/fore_buffer.c b/sys/dev/atm/hfa/fore_buffer.c index 53797f006b..9128a5cddf 100644 --- a/sys/dev/atm/hfa/fore_buffer.c +++ b/sys/dev/atm/hfa/fore_buffer.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hfa/fore_buffer.c,v 1.5 2000/01/15 21:01:04 mks Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_buffer.c,v 1.5 2008/03/01 22:03:13 swildner Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_buffer.c,v 1.6 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -377,7 +377,7 @@ fore_buf_supply_1s(Fore_unit *fup) KB_DATASTART(m, cp, caddr_t); bhp->bh_dma = bdp->bsd_buffer = (H_dma) DMA_GET_ADDR( cp, BUF1_SM_SIZE, BUF_DATA_ALIGN, 0); - if (bdp->bsd_buffer == NULL) { + if (bdp->bsd_buffer == 0) { /* * Unable to assign dma address - free up * this descriptor's buffer @@ -518,7 +518,7 @@ fore_buf_supply_1l(Fore_unit *fup) KB_DATASTART(m, cp, caddr_t); bhp->bh_dma = bdp->bsd_buffer = (H_dma) DMA_GET_ADDR( cp, BUF1_LG_SIZE, BUF_DATA_ALIGN, 0); - if (bdp->bsd_buffer == NULL) { + if (bdp->bsd_buffer == 0) { /* * Unable to assign dma address - free up * this descriptor's buffer diff --git a/sys/dev/disk/mpt/mpt_pci.c b/sys/dev/disk/mpt/mpt_pci.c index 120663fc00..ad325dcf9e 100644 --- a/sys/dev/disk/mpt/mpt_pci.c +++ b/sys/dev/disk/mpt/mpt_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.3.2.3 2002/09/24 21:37:25 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.11 2008/01/06 16:55:49 swildner Exp $ */ +/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.12 2008/06/05 18:06:31 swildner Exp $ */ /* * PCI specific probe and attach routines for LSI '909 FC adapters. * FreeBSD Version. @@ -424,7 +424,7 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt) device_t dev = mpt->dev; /* Check if we alreay have allocated the reply memory */ - if (mpt->reply_phys != NULL) { + if (mpt->reply_phys != 0) { return 0; } diff --git a/sys/dev/disk/nsp/nsp.c b/sys/dev/disk/nsp/nsp.c index e420481dd3..9a1df9b411 100644 --- a/sys/dev/disk/nsp/nsp.c +++ b/sys/dev/disk/nsp/nsp.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/nsp/nsp.c,v 1.1.2.6 2001/12/17 13:30:18 non Exp $ */ -/* $DragonFly: src/sys/dev/disk/nsp/nsp.c,v 1.12 2007/01/06 08:28:54 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/nsp/nsp.c,v 1.13 2008/06/05 18:06:31 swildner Exp $ */ /* $NecBSD: nsp.c,v 1.21.12.6 2001/06/29 06:27:52 honda Exp $ */ /* $NetBSD$ */ @@ -665,7 +665,7 @@ nsp_setup_fifo(struct nsp_softc *sc, int on, int direction, int datalen) /* determine a transfer type */ if (datalen < DEV_BSIZE || (datalen & 3) != 0) { - if (sc->sc_memh != NULL && + if (sc->sc_memh != 0 && (nsp_io_control & NSP_USE_MEMIO) != 0) xfermode = XFERMR_XEN | XFERMR_MEM8; else @@ -673,7 +673,7 @@ nsp_setup_fifo(struct nsp_softc *sc, int on, int direction, int datalen) } else { - if (sc->sc_memh != NULL && + if (sc->sc_memh != 0 && (nsp_io_control & NSP_USE_MEMIO) != 0) xfermode = XFERMR_XEN | XFERMR_MEM32; else diff --git a/sys/dev/netif/bfe/if_bfe.c b/sys/dev/netif/bfe/if_bfe.c index b66013cfc7..707f9ce520 100644 --- a/sys/dev/netif/bfe/if_bfe.c +++ b/sys/dev/netif/bfe/if_bfe.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bfe/if_bfe.c 1.4.4.7 2004/03/02 08:41:33 julian Exp v - * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.33 2008/05/14 11:59:18 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.34 2008/06/05 18:06:31 swildner Exp $ */ #include @@ -1494,7 +1494,7 @@ bfe_tick(void *xsc) bfe_stats_update(sc); callout_reset(&sc->bfe_stat_timer, hz, bfe_tick, sc); - if (sc->bfe_link == NULL) { + if (sc->bfe_link == 0) { mii_tick(mii); if (!sc->bfe_link && mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { diff --git a/sys/dev/netif/wi/if_wi_pci.c b/sys/dev/netif/wi/if_wi_pci.c index a16c366c3e..bcd82b78b9 100644 --- a/sys/dev/netif/wi/if_wi_pci.c +++ b/sys/dev/netif/wi/if_wi_pci.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/wi/if_wi_pci.c,v 1.22 2004/03/17 17:50:48 njl Exp $ - * $DragonFly: src/sys/dev/netif/wi/if_wi_pci.c,v 1.9 2006/10/25 20:56:00 dillon Exp $ + * $DragonFly: src/sys/dev/netif/wi/if_wi_pci.c,v 1.10 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -126,7 +126,7 @@ wi_pci_probe(device_t dev) vendor = pci_get_vendor(dev); device = pci_get_device(dev); - for (p = wi_pci_cards; p->vendor != NULL; p++) { + for (p = wi_pci_cards; p->vendor != 0; p++) { if (vendor == p->vendor && device == p->device) { sc = device_get_softc(dev); sc->wi_bus_type = p->bus_type; diff --git a/sys/dev/raid/asr/asr.c b/sys/dev/raid/asr/asr.c index 0e98c5e6fd..627fa26c64 100644 --- a/sys/dev/raid/asr/asr.c +++ b/sys/dev/raid/asr/asr.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/asr/asr.c,v 1.3.2.2 2001/08/23 05:21:29 scottl Exp $ */ -/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.35 2008/05/18 20:30:23 pavalos Exp $ */ +/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.36 2008/06/05 18:06:31 swildner Exp $ */ /* * Copyright (c) 1996-2000 Distributed Processing Technology Corporation * Copyright (c) 2000-2001 Adaptec Corporation @@ -1539,7 +1539,7 @@ ASR_queue( I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT | (Flags)); \ I2O_SGE_SIMPLE_ELEMENT_setPhysicalAddress( \ &(((PI2O_SG_ELEMENT)(SGL))->u.Simple[Index]), \ - (Buffer == NULL) ? NULL : KVTOPHYS(Buffer)) + (Buffer == NULL) ? 0 : KVTOPHYS(Buffer)) /* * Retrieve Parameter Group. @@ -1611,7 +1611,7 @@ ASR_getParams( && (Buffer_Ptr->Header.ResultCount)) { return ((void *)(Buffer_Ptr->Info)); } - return ((void *)NULL); + return (NULL); } /* ASR_getParams */ /* @@ -2403,7 +2403,7 @@ asr_pci_map_mem ( return (0); } sc->ha_Base = (void *)rman_get_start(sc->ha_mem_res); - if (sc->ha_Base == (void *)NULL) { + if (sc->ha_Base == NULL) { return (0); } sc->ha_Virt = (i2oRegs_t *) rman_get_virtual(sc->ha_mem_res); @@ -2425,7 +2425,7 @@ asr_pci_map_mem ( if (sc->ha_mes_res == (struct resource *)NULL) { return (0); } - if ((void *)rman_get_start(sc->ha_mes_res) == (void *)NULL) { + if ((void *)rman_get_start(sc->ha_mes_res) == NULL) { return (0); } sc->ha_Fvirt = (U8 *) rman_get_virtual(sc->ha_mes_res); diff --git a/sys/dev/raid/twe/twe.c b/sys/dev/raid/twe/twe.c index edd21bcf94..95a137d57f 100644 --- a/sys/dev/raid/twe/twe.c +++ b/sys/dev/raid/twe/twe.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/twe/twe.c,v 1.1.2.10 2004/06/11 18:57:31 vkashyap Exp $ - * $DragonFly: src/sys/dev/raid/twe/twe.c,v 1.19 2008/01/06 16:55:51 swildner Exp $ + * $DragonFly: src/sys/dev/raid/twe/twe.c,v 1.20 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -868,7 +868,7 @@ twe_init_connection(struct twe_softc *sc, int mode) /* get a command */ if (twe_get_request(sc, &tr)) - return(NULL); + return(0); /* build the command */ cmd = &tr->tr_command; diff --git a/sys/dev/raid/vinum/vinumdaemon.c b/sys/dev/raid/vinum/vinumdaemon.c index cd9639175c..7dab8f4c67 100644 --- a/sys/dev/raid/vinum/vinumdaemon.c +++ b/sys/dev/raid/vinum/vinumdaemon.c @@ -36,7 +36,7 @@ * * $Id: vinumdaemon.c,v 1.8 2000/01/03 05:22:03 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumdaemon.c,v 1.16 2000/01/05 06:03:56 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumdaemon.c,v 1.11 2006/09/10 01:26:36 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumdaemon.c,v 1.12 2008/06/05 18:06:31 swildner Exp $ */ #include "vinumhdr.h" @@ -257,7 +257,7 @@ vinum_finddaemon(void) int result; if (daemonpid != 0) { /* we think we have a daemon, */ - queue_daemon_request(daemonrq_ping, (union daemoninfo) NULL); /* queue a ping */ + queue_daemon_request(daemonrq_ping, (union daemoninfo) 0); /* queue a ping */ result = tsleep(&vinum_finddaemon, 0, "reap", 2 * hz); if (result == 0) /* yup, the daemon's up and running */ return 0; diff --git a/sys/dev/raid/vinum/vinumio.c b/sys/dev/raid/vinum/vinumio.c index 356676225c..3702fae139 100644 --- a/sys/dev/raid/vinum/vinumio.c +++ b/sys/dev/raid/vinum/vinumio.c @@ -35,7 +35,7 @@ * * $Id: vinumio.c,v 1.30 2000/05/10 23:23:30 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumio.c,v 1.52.2.6 2002/05/02 08:43:44 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.30 2007/12/09 17:23:53 corecode Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.31 2008/06/05 18:06:31 swildner Exp $ */ #include "vinumhdr.h" @@ -560,7 +560,7 @@ format_config(char *config, int len) void save_config(void) { - queue_daemon_request(daemonrq_saveconfig, (union daemoninfo) NULL); + queue_daemon_request(daemonrq_saveconfig, (union daemoninfo) 0); } /* diff --git a/sys/dev/serial/cy/cy.c b/sys/dev/serial/cy/cy.c index 82f8306650..f43101099a 100644 --- a/sys/dev/serial/cy/cy.c +++ b/sys/dev/serial/cy/cy.c @@ -28,7 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/cy.c,v 1.97.2.2 2001/08/22 13:04:58 bde Exp $ - * $DragonFly: src/sys/dev/serial/cy/cy.c,v 1.27 2007/04/12 18:35:08 swildner Exp $ + * $DragonFly: src/sys/dev/serial/cy/cy.c,v 1.28 2008/06/05 18:06:31 swildner Exp $ */ #include "opt_compat.h" @@ -2500,7 +2500,7 @@ siosettimeout(void) } else { /* Flush error messages, if any. */ sio_timeouts_until_log = 1; - comwakeup((void *)NULL); + comwakeup(NULL); callout_stop(&sio_timeout_handle); } } diff --git a/sys/dev/serial/sio/sio.c b/sys/dev/serial/sio/sio.c index 8cd2732884..0ae6325fba 100644 --- a/sys/dev/serial/sio/sio.c +++ b/sys/dev/serial/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/sio.c,v 1.291.2.35 2003/05/18 08:51:15 murray Exp $ - * $DragonFly: src/sys/dev/serial/sio/sio.c,v 1.42 2007/10/23 03:04:49 y0netan1 Exp $ + * $DragonFly: src/sys/dev/serial/sio/sio.c,v 1.43 2008/06/05 18:06:32 swildner Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -2637,7 +2637,7 @@ siosettimeout(void) } else { /* Flush error messages, if any. */ sio_timeouts_until_log = 1; - comwakeup((void *)NULL); + comwakeup(NULL); callout_stop(&sio_timeout_handle); } } diff --git a/sys/dev/serial/stl/stallion.c b/sys/dev/serial/stl/stallion.c index 1bdb554d9c..6d1c91c8cd 100644 --- a/sys/dev/serial/stl/stallion.c +++ b/sys/dev/serial/stl/stallion.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/stallion.c,v 1.39.2.2 2001/08/30 12:29:57 murray Exp $ - * $DragonFly: src/sys/dev/serial/stl/stallion.c,v 1.25 2007/04/12 18:35:09 swildner Exp $ + * $DragonFly: src/sys/dev/serial/stl/stallion.c,v 1.26 2008/06/05 18:06:32 swildner Exp $ */ /*****************************************************************************/ @@ -1078,7 +1078,7 @@ void stlpciattach(pcici_t tag, int unit) brdp->unitid = brdp->brdnr; /* PCI units auto-assigned */ brdp->irq = ((int) pci_conf_read(tag, 0x3c)) & 0xff; brdp->irqtype = 0; - if (pci_map_int(tag, stlpciintr, (void *) NULL) == 0) { + if (pci_map_int(tag, stlpciintr, NULL) == 0) { kprintf("STALLION: failed to map interrupt irq=%d for unit=%d\n", brdp->irq, brdp->brdnr); return; diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c index f2a68dcdb8..53fc024ac9 100644 --- a/sys/dev/serial/stli/istallion.c +++ b/sys/dev/serial/stli/istallion.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/istallion.c,v 1.36.2.2 2001/08/30 12:29:57 murray Exp $ - * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.21 2006/12/22 23:26:25 swildner Exp $ + * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.22 2008/06/05 18:06:32 swildner Exp $ */ /*****************************************************************************/ @@ -2094,10 +2094,10 @@ static __inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp) if ((cp->cmd == 0) && (rc != 0)) { if (rc > 0) rc--; - if (portp->argp != (void *) NULL) { + if (portp->argp != NULL) { bcopy(&(cp->args[0]), portp->argp, portp->argsize); - portp->argp = (void *) NULL; + portp->argp = NULL; } cp->status = 0; portp->rc = rc; diff --git a/sys/kern/kern_cputimer.c b/sys/kern/kern_cputimer.c index 16a2c1aae3..7ef1184682 100644 --- a/sys/kern/kern_cputimer.c +++ b/sys/kern/kern_cputimer.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_cputimer.c,v 1.4 2005/06/09 19:14:12 eirikn Exp $ + * $DragonFly: src/sys/kern/kern_cputimer.c,v 1.5 2008/06/05 18:06:32 swildner Exp $ */ /* * Generic cputimer - access to a reliable, free-running counter. @@ -266,12 +266,12 @@ SYSCTL_DECL(_kern_cputimer); SYSCTL_NODE(_kern, OID_AUTO, cputimer, CTLFLAG_RW, NULL, "cputimer"); SYSCTL_PROC(_kern_cputimer, OID_AUTO, select, CTLTYPE_STRING|CTLFLAG_RD, - NULL, NULL, sysctl_cputimer_reglist, "A", ""); + NULL, 0, sysctl_cputimer_reglist, "A", ""); SYSCTL_PROC(_kern_cputimer, OID_AUTO, name, CTLTYPE_STRING|CTLFLAG_RD, - NULL, NULL, sysctl_cputimer_name, "A", ""); + NULL, 0, sysctl_cputimer_name, "A", ""); SYSCTL_PROC(_kern_cputimer, OID_AUTO, clock, CTLTYPE_UINT|CTLFLAG_RD, - NULL, NULL, sysctl_cputimer_clock, "IU", ""); + NULL, 0, sysctl_cputimer_clock, "IU", ""); SYSCTL_PROC(_kern_cputimer, OID_AUTO, freq, CTLTYPE_INT|CTLFLAG_RD, - NULL, NULL, sysctl_cputimer_freq, "I", ""); + NULL, 0, sysctl_cputimer_freq, "I", ""); diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 68edf24448..1e7ebacf6b 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -77,7 +77,7 @@ * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_disk.c,v 1.20.2.6 2001/10/05 07:14:57 peter Exp $ * $FreeBSD: src/sys/ufs/ufs/ufs_disksubr.c,v 1.44.2.3 2001/03/05 05:42:19 obrien Exp $ - * $DragonFly: src/sys/kern/subr_disk.c,v 1.39 2007/07/30 08:02:38 dillon Exp $ + * $DragonFly: src/sys/kern/subr_disk.c,v 1.40 2008/06/05 18:06:32 swildner Exp $ */ #include @@ -277,7 +277,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD, 0, NULL, +SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_disks, "A", "names of available disks"); /* diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 395f2035f0..e6dd0e0b6b 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -17,7 +17,7 @@ * are met. * * $FreeBSD: src/sys/kern/sys_pipe.c,v 1.60.2.13 2002/08/05 15:05:15 des Exp $ - * $DragonFly: src/sys/kern/sys_pipe.c,v 1.48 2008/05/10 01:25:55 dillon Exp $ + * $DragonFly: src/sys/kern/sys_pipe.c,v 1.49 2008/06/05 18:06:32 swildner Exp $ */ /* @@ -683,7 +683,7 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio) switch(wpipe->pipe_feature) { case PIPE_KMEM: case PIPE_SFBUF2: - if (wpipe->pipe_kva == NULL) { + if (wpipe->pipe_kva == 0) { wpipe->pipe_kva = kmem_alloc_nofault(&kernel_map, XIO_INTERNAL_SIZE); wpipe->pipe_kvamask = 0; @@ -741,7 +741,7 @@ pipe_clone_write_buffer(struct pipe *wpipe) if (wpipe->pipe_kva) { pmap_qremove(wpipe->pipe_kva, XIO_INTERNAL_PAGES); kmem_free(&kernel_map, wpipe->pipe_kva, XIO_INTERNAL_SIZE); - wpipe->pipe_kva = NULL; + wpipe->pipe_kva = 0; } } @@ -812,7 +812,7 @@ retry: if (wpipe->pipe_kva) { pmap_qremove(wpipe->pipe_kva, XIO_INTERNAL_PAGES); kmem_free(&kernel_map, wpipe->pipe_kva, XIO_INTERNAL_SIZE); - wpipe->pipe_kva = NULL; + wpipe->pipe_kva = 0; } pipeunlock(wpipe); pipeselwakeup(wpipe); @@ -1423,7 +1423,7 @@ pipeclose(struct pipe *cpipe) if (cpipe->pipe_kva) { pmap_qremove(cpipe->pipe_kva, XIO_INTERNAL_PAGES); kmem_free(&kernel_map, cpipe->pipe_kva, XIO_INTERNAL_SIZE); - cpipe->pipe_kva = NULL; + cpipe->pipe_kva = 0; } /* diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index e9d73c8189..dc82b9faca 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -32,7 +32,7 @@ * * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 * $FreeBSD: src/sys/kern/uipc_domain.c,v 1.22.2.1 2001/07/03 11:01:37 ume Exp $ - * $DragonFly: src/sys/kern/uipc_domain.c,v 1.10 2008/05/27 01:10:39 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_domain.c,v 1.11 2008/06/05 18:06:32 swildner Exp $ */ #include @@ -198,7 +198,7 @@ kpfctlinput(int cmd, struct sockaddr *sa) SLIST_FOREACH(dp, &domains, dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_ctlinput) - (*pr->pr_ctlinput)(cmd, sa, (void *)NULL); + (*pr->pr_ctlinput)(cmd, sa, NULL); } void diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 3726ef6cd5..c88274dfc3 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -65,7 +65,7 @@ * * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/uipc_mbuf.c,v 1.51.2.24 2003/04/15 06:59:29 silby Exp $ - * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.65 2007/08/12 01:46:26 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_mbuf.c,v 1.66 2008/06/05 18:06:32 swildner Exp $ */ #include "opt_param.h" @@ -1695,7 +1695,7 @@ m_defrag_nofree(struct mbuf *m0, int how) goto nospace; m_final->m_len = 0; /* in case m0->m_pkthdr.len is zero */ - if (m_dup_pkthdr(m_final, m0, how) == NULL) + if (m_dup_pkthdr(m_final, m0, how) == 0) goto nospace; m_new = m_final; diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index 488d4dfdca..1a5251302a 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_atmsubr.c,v 1.10.2.1 2001/03/06 00:29:26 obrien Exp $ - * $DragonFly: src/sys/net/if_atmsubr.c,v 1.19 2008/05/14 11:59:23 sephe Exp $ + * $DragonFly: src/sys/net/if_atmsubr.c,v 1.20 2008/06/05 18:06:32 swildner Exp $ */ /* @@ -133,7 +133,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, if (rt->rt_flags & RTF_GATEWAY) { if (rt->rt_gwroute == NULL) goto lookup; - if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == NULL) { + if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) { rtfree(rt); rt = rt0; lookup: rt->rt_gwroute = RTALLOC1(rt->rt_gateway, 0); if ((rt = rt->rt_gwroute) == NULL) diff --git a/sys/net/pf/pf.c b/sys/net/pf/pf.c index c1cce9b3fe..6322b1743d 100644 --- a/sys/net/pf/pf.c +++ b/sys/net/pf/pf.c @@ -1,7 +1,7 @@ /* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.19 2004/09/11 11:18:25 mlaier Exp $ */ /* $OpenBSD: pf.c,v 1.433.2.2 2004/07/17 03:22:34 brad Exp $ */ /* add $OpenBSD: pf.c,v 1.448 2004/05/11 07:34:11 dhartmei Exp $ */ -/* $DragonFly: src/sys/net/pf/pf.c,v 1.19 2008/05/14 11:59:23 sephe Exp $ */ +/* $DragonFly: src/sys/net/pf/pf.c,v 1.20 2008/06/05 18:06:32 swildner Exp $ */ /* * Copyright (c) 2004 The DragonFly Project. All rights reserved. @@ -1395,8 +1395,7 @@ pf_send_tcp(const struct pf_rule *r, sa_family_t af, h->ip_off = path_mtu_discovery ? IP_DF : 0; h->ip_ttl = ttl ? ttl : ip_defttl; h->ip_sum = 0; - ip_output(m, (void *)NULL, (void *)NULL, 0, (void *)NULL, - (void *)NULL); + ip_output(m, NULL, NULL, 0, NULL, NULL); break; #endif /* INET */ #ifdef INET6 diff --git a/sys/net/tun/if_tun.c b/sys/net/tun/if_tun.c index 015f0eaed3..468954dfea 100644 --- a/sys/net/tun/if_tun.c +++ b/sys/net/tun/if_tun.c @@ -14,7 +14,7 @@ * operation though. * * $FreeBSD: src/sys/net/if_tun.c,v 1.74.2.8 2002/02/13 00:43:11 dillon Exp $ - * $DragonFly: src/sys/net/tun/if_tun.c,v 1.36 2008/05/14 11:59:24 sephe Exp $ + * $DragonFly: src/sys/net/tun/if_tun.c,v 1.37 2008/06/05 18:06:32 swildner Exp $ */ #include "opt_atalk.h" @@ -138,7 +138,7 @@ tunopen(struct dev_open_args *ap) struct tun_softc *tp; int error; - if ((error = suser_cred(ap->a_cred, 0)) != NULL) + if ((error = suser_cred(ap->a_cred, 0)) != 0) return (error); tp = dev->si_drv1; diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 105c6469a5..8662c64b6c 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -1,5 +1,5 @@ /* $KAME: sctp_indata.c,v 1.35 2004/08/17 04:06:17 itojun Exp $ */ -/* $DragonFly: src/sys/netinet/sctp_indata.c,v 1.7 2007/04/22 01:13:14 dillon Exp $ */ +/* $DragonFly: src/sys/netinet/sctp_indata.c,v 1.8 2008/06/05 18:06:32 swildner Exp $ */ /* * Copyright (C) 2002, 2003, 2004 Cisco Systems Inc, @@ -4683,7 +4683,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, */ asoc->fragmented_delivery_inprogress = 0; sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, - stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)NULL); + stcb, SCTP_PARTIAL_DELIVERY_ABORTED, NULL); } break; @@ -4698,7 +4698,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * flag. */ sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, - stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)NULL); + stcb, SCTP_PARTIAL_DELIVERY_ABORTED, NULL); asoc->fragmented_delivery_inprogress = 0; } /*************************************************************/ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 44341335bf..c86a93a48e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -65,7 +65,7 @@ * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 * $FreeBSD: src/sys/netinet/tcp_usrreq.c,v 1.51.2.17 2002/10/11 11:46:44 ume Exp $ - * $DragonFly: src/sys/netinet/tcp_usrreq.c,v 1.47 2008/02/10 11:14:25 sephe Exp $ + * $DragonFly: src/sys/netinet/tcp_usrreq.c,v 1.48 2008/06/05 18:06:32 swildner Exp $ */ #include "opt_ipsec.h" @@ -1083,7 +1083,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) inp->in6p_laddr = *addr6; inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; - if ((sin6->sin6_flowinfo & IPV6_FLOWINFO_MASK) != NULL) + if ((sin6->sin6_flowinfo & IPV6_FLOWINFO_MASK) != 0) inp->in6p_flowinfo = sin6->sin6_flowinfo; in_pcbinsconnhash(inp); @@ -1265,7 +1265,7 @@ tcp_attach(struct socket *so, struct pru_attach_info *ai) int error; int cpu; #ifdef INET6 - int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != NULL; + int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0; #endif if (so->so_snd.ssb_hiwat == 0 || so->so_rcv.ssb_hiwat == 0) { diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 2285dd5ac1..a6b9b9a149 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ip6_mroute.c,v 1.2.2.9 2003/01/23 21:06:47 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/ip6_mroute.c,v 1.16 2008/05/14 11:59:24 sephe Exp $ */ +/* $DragonFly: src/sys/netinet6/ip6_mroute.c,v 1.17 2008/06/05 18:06:32 swildner Exp $ */ /* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ /* @@ -1753,7 +1753,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) #endif rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m, - dst.sin6_family, NULL); + dst.sin6_family, 0); /* prepare the register head to send to the mrouting daemon */ m = mcp; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index e9bd88c439..6001431c93 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ip6_output.c,v 1.13.2.18 2003/01/24 05:11:35 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/ip6_output.c,v 1.33 2008/01/06 16:55:52 swildner Exp $ */ +/* $DragonFly: src/sys/netinet6/ip6_output.c,v 1.34 2008/06/05 18:06:32 swildner Exp $ */ /* $KAME: ip6_output.c,v 1.279 2002/01/26 06:12:30 jinmei Exp $ */ /* @@ -1295,10 +1295,10 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) struct mbuf *m; error = soopt_getm(sopt, &m); /* XXX */ - if (error != NULL) + if (error != 0) break; error = soopt_mcopyin(sopt, m); /* XXX */ - if (error != NULL) + if (error != 0) break; error = ip6_pcbopts(&in6p->in6p_outputopts, m, so, sopt); @@ -1645,10 +1645,10 @@ do { \ struct mbuf **mp = &m; error = soopt_getm(sopt, &m); /* XXX */ - if (error != NULL) + if (error != 0) break; error = soopt_mcopyin(sopt, m); /* XXX */ - if (error != NULL) + if (error != 0) break; if (m) { req = mtod(m, caddr_t); @@ -2466,7 +2466,7 @@ ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) in6_clearscope(&ip6->ip6_src); in6_clearscope(&ip6->ip6_dst); - if_simloop(ifp, copym, dst->sin6_family, NULL); + if_simloop(ifp, copym, dst->sin6_family, 0); } /* diff --git a/sys/platform/pc32/i386/busdma_machdep.c b/sys/platform/pc32/i386/busdma_machdep.c index a8001a0537..659af36ca8 100644 --- a/sys/platform/pc32/i386/busdma_machdep.c +++ b/sys/platform/pc32/i386/busdma_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.16.2.2 2003/01/23 00:55:27 scottl Exp $ - * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.22 2008/01/05 14:02:41 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.23 2008/06/05 18:06:32 swildner Exp $ */ #include @@ -840,7 +840,7 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) dmat->lowaddr, PAGE_SIZE, 0); - if (bpage->vaddr == NULL) { + if (bpage->vaddr == 0) { kfree(bpage, M_DEVBUF); break; } diff --git a/sys/platform/pc32/i386/est.c b/sys/platform/pc32/i386/est.c index 372bb19f7a..d58253d174 100644 --- a/sys/platform/pc32/i386/est.c +++ b/sys/platform/pc32/i386/est.c @@ -85,7 +85,7 @@ * ACPI objects: _PCT is MSR location, _PSS is freq/voltage, _PPC is caps. * * $NetBSD: est.c,v 1.25 2006/06/18 16:39:56 nonaka Exp $ - * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.10 2008/04/02 21:25:30 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.11 2008/06/05 18:06:32 swildner Exp $ */ #include @@ -721,13 +721,13 @@ est_init(void) if (oid == NULL) return(EOPNOTSUPP); leaf = SYSCTL_ADD_PROC(&machdep_est_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "target", CTLTYPE_INT | CTLFLAG_RW, NULL, NULL, + OID_AUTO, "target", CTLTYPE_INT | CTLFLAG_RW, NULL, 0, est_sysctl_helper, "I", "Target CPU frequency for Enhanced SpeedStep"); if (leaf == NULL) return(EOPNOTSUPP); leaf = SYSCTL_ADD_PROC(&machdep_est_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "current", CTLTYPE_INT | CTLFLAG_RD, NULL, NULL, + OID_AUTO, "current", CTLTYPE_INT | CTLFLAG_RD, NULL, 0, est_sysctl_helper, "I", "Current CPU frequency for Enhanced SpeedStep"); if (leaf == NULL) diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index b7b90cdc33..e4d3942dae 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -40,7 +40,7 @@ * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.250.2.18 2002/03/06 22:48:53 silby Exp $ - * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.85 2008/05/11 17:20:53 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.86 2008/06/05 18:06:32 swildner Exp $ */ /* @@ -2392,7 +2392,7 @@ pmap_prefault(pmap_t pmap, vm_offset_t addra, vm_map_entry_t entry) if (addr < starta || addr >= entry->end) continue; - if ((*pmap_pde(pmap, addr)) == NULL) + if ((*pmap_pde(pmap, addr)) == 0) continue; pte = (unsigned *) vtopte(addr); diff --git a/test/stress/fsstress/fsstress.c b/test/stress/fsstress/fsstress.c index 363fd8e8ed..009ae59349 100644 --- a/test/stress/fsstress/fsstress.c +++ b/test/stress/fsstress/fsstress.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ /* - * $DragonFly: src/test/stress/fsstress/fsstress.c,v 1.1 2004/05/07 17:51:02 dillon Exp $ + * $DragonFly: src/test/stress/fsstress/fsstress.c,v 1.2 2008/06/05 18:06:33 swildner Exp $ */ #include "global.h" @@ -400,7 +400,7 @@ int main(int argc, char **argv) dcache_init(); setlinebuf(stdout); if (!seed) { - gettimeofday(&t, (void *)NULL); + gettimeofday(&t, NULL); seed = (int)t.tv_sec ^ (int)t.tv_usec; printf("seed = %ld\n", seed); } diff --git a/usr.bin/doscmd/xms.c b/usr.bin/doscmd/xms.c index 260148456f..aeb5ad3309 100644 --- a/usr.bin/doscmd/xms.c +++ b/usr.bin/doscmd/xms.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/xms.c,v 1.6.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/xms.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ + * $DragonFly: src/usr.bin/doscmd/xms.c,v 1.4 2008/06/05 18:06:33 swildner Exp $ */ /* @@ -788,7 +788,7 @@ xms_entry(regcontext_t *REGS) if (eptr->dst_handle != 0) { dstptr = xms_hand[dstidx].addr; - if (dstptr == NULL || dstptr == XMS_NULL_ALLOC) { + if (dstptr == 0 || dstptr == XMS_NULL_ALLOC) { R_AX = 0x0; R_BL = XMS_INVALID_DESTINATION_HANDLE; debug(D_XMS, " Invalid dest handle\n"); diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c index 2f8b9582ec..4089f76e0b 100644 --- a/usr.bin/finger/finger.c +++ b/usr.bin/finger/finger.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)finger.c 8.5 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/finger/finger.c,v 1.15.2.9 2002/07/29 18:52:52 ume Exp $ - * $DragonFly: src/usr.bin/finger/finger.c,v 1.5 2004/09/03 19:13:23 dillon Exp $ + * $DragonFly: src/usr.bin/finger/finger.c,v 1.6 2008/06/05 18:06:33 swildner Exp $ */ /* @@ -312,7 +312,7 @@ userlist(int argc, char **argv) continue; *conf_realname = '\0'; /* Replace : with NUL */ for (p = argv; *p; ++p) { - if (strcmp(*p, conf_alias) == NULL) { + if (strcmp(*p, conf_alias) == 0) { if ((*p = strdup(conf_realname+1)) == NULL) { err(1, NULL); } diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c index a2d6d0f338..eb0fa823a9 100644 --- a/usr.bin/gcore/elfcore.c +++ b/usr.bin/gcore/elfcore.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/gcore/elfcore.c,v 1.5.2.3 2001/07/11 23:59:11 obrien Exp $ - * $DragonFly: src/usr.bin/gcore/elfcore.c,v 1.4 2004/08/09 14:53:38 eirikn Exp $ + * $DragonFly: src/usr.bin/gcore/elfcore.c,v 1.5 2008/06/05 18:06:33 swildner Exp $ */ #define _KERNEL_STRUCTURES @@ -108,7 +108,7 @@ elf_coredump(int fd, pid_t pid) * size is calculated. */ hdrsize = 0; - elf_puthdr(map, (void *)NULL, &hdrsize, + elf_puthdr(map, NULL, &hdrsize, (const prstatus_t *)NULL, (const prfpregset_t *)NULL, (const prpsinfo_t *)NULL, seginfo.count); diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c index 062a1b4b07..ca1ca77f94 100644 --- a/usr.bin/head/head.c +++ b/usr.bin/head/head.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1987, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)head.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/head/head.c,v 1.10.2.1 2002/02/16 12:29:04 dwmalone Exp $ - * $DragonFly: src/usr.bin/head/head.c,v 1.5 2005/03/12 11:10:02 liamfoy Exp $ + * $DragonFly: src/usr.bin/head/head.c,v 1.6 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -67,12 +67,12 @@ main(int argc, char **argv) switch(ch) { case 'c': bytecnt = strtol(optarg, &ep, 10); - if (*ep != NULL || bytecnt <= 0) + if (*ep != 0 || bytecnt <= 0) errx(1, "illegal byte count -- %s", optarg); break; case 'n': linecnt = strtol(optarg, &ep, 10); - if (*ep != NULL || linecnt <= 0) + if (*ep != 0 || linecnt <= 0) errx(1, "illegal line count -- %s", optarg); break; default: diff --git a/usr.bin/login/login_access.c b/usr.bin/login/login_access.c index 575f551ac8..0b5aa1a655 100644 --- a/usr.bin/login/login_access.c +++ b/usr.bin/login/login_access.c @@ -6,7 +6,7 @@ * * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. * - * $DragonFly: src/usr.bin/login/login_access.c,v 1.3 2004/06/19 17:28:28 cpressey Exp $ + * $DragonFly: src/usr.bin/login/login_access.c,v 1.4 2008/06/05 18:06:33 swildner Exp $ */ #ifdef LOGIN_ACCESS @@ -118,7 +118,7 @@ static int list_match(char *list, char *item, int (*match_fn)()) for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) { if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */ break; - if ((match = (*match_fn)(tok, item)) != NULL) /* YES */ + if ((match = (*match_fn)(tok, item)) != 0) /* YES */ break; } /* Process exceptions to matches. */ diff --git a/usr.bin/mkstr/mkstr.c b/usr.bin/mkstr/mkstr.c index 7fb4581bc9..13934407c2 100644 --- a/usr.bin/mkstr/mkstr.c +++ b/usr.bin/mkstr/mkstr.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)mkstr.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mkstr/mkstr.c,v 1.4.2.1 2002/11/16 01:07:42 tjr Exp $ - * $DragonFly: src/usr.bin/mkstr/mkstr.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/mkstr/mkstr.c,v 1.3 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -236,7 +236,7 @@ copystr(void) } out: *cp = 0; - printf("%d", hashit(buf, 1, NULL)); + printf("%d", hashit(buf, 1, 0)); } int diff --git a/usr.bin/newkey/generic.c b/usr.bin/newkey/generic.c index 92dbeec932..bab8634da3 100644 --- a/usr.bin/newkey/generic.c +++ b/usr.bin/newkey/generic.c @@ -29,7 +29,7 @@ * * @(#)generic.c 1.2 91/03/11 Copyr 1986 Sun Micro * $FreeBSD: src/usr.bin/newkey/generic.c,v 1.3.2.1 2001/07/04 22:32:20 kris Exp $ - * $DragonFly: src/usr.bin/newkey/generic.c,v 1.7 2005/01/11 13:08:35 joerg Exp $ + * $DragonFly: src/usr.bin/newkey/generic.c,v 1.8 2008/06/05 18:06:33 swildner Exp $ */ /* @@ -106,7 +106,7 @@ genkeys(char *public, char *secret, char *pass) base = itobn(BASE); root = itobn(PROOT); modulus = NULL; - if (BN_hex2bn(&modulus, HEXMODULUS) == NULL) + if (BN_hex2bn(&modulus, HEXMODULUS) == 0) errx(1, "could not convert modulus to BIGNUM: %s", ERR_error_string(ERR_get_error(), 0)); diff --git a/usr.bin/systat/ifstat.c b/usr.bin/systat/ifstat.c index 89af391a0d..ea744e9444 100644 --- a/usr.bin/systat/ifstat.c +++ b/usr.bin/systat/ifstat.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/systat/ifstat.c,v 1.1 2003/01/04 22:07:24 phk Exp $ - * $DragonFly: src/usr.bin/systat/ifstat.c,v 1.3 2007/11/25 01:28:23 swildner Exp $ + * $DragonFly: src/usr.bin/systat/ifstat.c,v 1.4 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -381,7 +381,7 @@ getifnum(void) 5, (void *)&data, (size_t *)&datalen, - (void *)NULL, + NULL, (size_t)0); if (error) IFSTAT_ERR(1, "sysctl error"); @@ -407,7 +407,7 @@ getifmibdata(int row, struct ifmibdata *data) 6, (void *)data, (size_t *)&datalen, - (void *)NULL, + NULL, (size_t)0); if (error != 0 && errno != ENOENT) IFSTAT_ERR(2, "sysctl error getting interface data"); diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c index 6ff3bc6d34..3b8ec6c73d 100644 --- a/usr.bin/whereis/whereis.c +++ b/usr.bin/whereis/whereis.c @@ -22,7 +22,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * $FreeBSD: src/usr.bin/whereis/whereis.c,v 1.12 2002/08/22 01:50:51 johan Exp $ - * $DragonFly: src/usr.bin/whereis/whereis.c,v 1.5 2006/07/01 19:34:43 swildner Exp $ + * $DragonFly: src/usr.bin/whereis/whereis.c,v 1.6 2008/06/05 18:06:33 swildner Exp $ */ /* @@ -267,12 +267,11 @@ defaults(void) /* -b defaults to default path + /usr/libexec + * /usr/games + user's path */ if (!bindirs) { - if (sysctlbyname("user.cs_path", (void *)NULL, &s, - (void *)NULL, 0) == -1) + if (sysctlbyname("user.cs_path", NULL, &s, NULL, 0) == -1) err(EX_OSERR, "sysctlbyname(\"user.cs_path\")"); if ((b = malloc(s + 1)) == NULL) abort(); - if (sysctlbyname("user.cs_path", b, &s, (void *)NULL, 0) == -1) + if (sysctlbyname("user.cs_path", b, &s, NULL, 0) == -1) err(EX_OSERR, "sysctlbyname(\"user.cs_path\")"); nele = 0; decolonify(b, &bindirs, &nele); diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c index 681b46c3a1..1176155112 100644 --- a/usr.bin/who/who.c +++ b/usr.bin/who/who.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/who/who.c,v 1.9.2.4 2002/12/21 00:44:58 tjr Exp $ - * $DragonFly: src/usr.bin/who/who.c,v 1.6 2005/02/15 14:15:16 liamfoy Exp $ + * $DragonFly: src/usr.bin/who/who.c,v 1.7 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -179,10 +179,10 @@ row(struct utmp *ut) { char buf[80], tty[sizeof(_PATH_DEV) + UT_LINESIZE]; struct stat sb; - time_t idle = NULL; + time_t idle = 0; static int d_first = -1; struct tm *tm; - char state = NULL; + char state = '?'; if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); @@ -190,8 +190,6 @@ row(struct utmp *ut) if (Tflag || uflag) { snprintf(tty, sizeof(tty), "%s%.*s", _PATH_DEV, UT_LINESIZE, ut->ut_line); - state = '?'; - idle = 0; if (stat(tty, &sb) == 0) { state = sb.st_mode & (S_IWOTH|S_IWGRP) ? '+' : '-'; diff --git a/usr.sbin/burncd/burncd.c b/usr.sbin/burncd/burncd.c index 87b256765f..d164d05529 100644 --- a/usr.sbin/burncd/burncd.c +++ b/usr.sbin/burncd/burncd.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/burncd/burncd.c,v 1.10.2.6 2002/11/20 00:26:18 njl Exp $ - * $DragonFly: src/usr.sbin/burncd/burncd.c,v 1.3 2006/02/02 17:00:29 eirikn Exp $ + * $DragonFly: src/usr.sbin/burncd/burncd.c,v 1.4 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -243,7 +243,7 @@ main(int argc, char **argv) if (*file_buf == '#' || *file_buf == '\n') continue; if ((eol = strchr(file_buf, '\n'))) - *eol = NULL; + *eol = 0; add_track(file_buf, block_size, block_type, nogap); } if (feof(fp)) diff --git a/usr.sbin/keyserv/setkey.c b/usr.sbin/keyserv/setkey.c index d231b3d02e..91e724dce5 100644 --- a/usr.sbin/keyserv/setkey.c +++ b/usr.sbin/keyserv/setkey.c @@ -28,7 +28,7 @@ * * @(#)setkey.c 1.11 94/04/25 SMI * $FreeBSD: src/usr.sbin/keyserv/setkey.c,v 1.3 1999/08/28 01:16:41 peter Exp $ - * $DragonFly: src/usr.sbin/keyserv/setkey.c,v 1.9 2005/07/17 19:16:35 joerg Exp $ + * $DragonFly: src/usr.sbin/keyserv/setkey.c,v 1.10 2008/06/05 18:06:33 swildner Exp $ */ /* @@ -83,7 +83,7 @@ void setmodulus(char *modx) { modulus = NULL; - if (BN_hex2bn(&modulus, modx) == NULL) + if (BN_hex2bn(&modulus, modx) == 0) errx(1, "could not convert modulus to BIGNUM: %s", ERR_error_string(ERR_get_error(), 0)); } @@ -183,12 +183,12 @@ pk_crypt(uid_t uid, char *remote_name, netobj *remote_key, des_block *key, if ((ctx = BN_CTX_new()) == NULL) return (KEY_SYSTEMERR); public = NULL; - if (BN_hex2bn(&public, xpublic) == NULL) { + if (BN_hex2bn(&public, xpublic) == 0) { BN_CTX_free(ctx); return (KEY_SYSTEMERR); } secret = NULL; - if (BN_hex2bn(&secret, xsecret) == NULL) { + if (BN_hex2bn(&secret, xsecret) == 0) { BN_free(public); BN_CTX_free(ctx); return (KEY_SYSTEMERR); @@ -244,12 +244,12 @@ pk_get_conv_key(uid_t uid, keybuf xpublic, cryptkeyres *result) if ((ctx = BN_CTX_new()) == NULL) return (KEY_SYSTEMERR); public = NULL; - if (BN_hex2bn(&public, xpublic) == NULL) { + if (BN_hex2bn(&public, xpublic) == 0) { BN_CTX_free(ctx); return (KEY_SYSTEMERR); } secret = NULL; - if (BN_hex2bn(&secret, xsecret) == NULL) { + if (BN_hex2bn(&secret, xsecret) == 0) { BN_free(public); BN_CTX_free(ctx); return (KEY_SYSTEMERR); diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c index 6db9c7ab87..b0aaebfd1b 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/rtadvd/rrenum.c,v 1.2.2.2 2001/07/03 11:02:14 ume Exp $ - * $DragonFly: src/usr.sbin/rtadvd/rrenum.c,v 1.4 2005/02/17 14:00:10 joerg Exp $ + * $DragonFly: src/usr.sbin/rtadvd/rrenum.c,v 1.5 2008/06/05 18:06:33 swildner Exp $ */ #include #include @@ -248,7 +248,7 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm) int ifindex = 0; struct in6_rrenumreq irr; - if ((rr_pco_check(len, rpm) != NULL)) + if ((rr_pco_check(len, rpm) != 0)) return 1; if (s == -1 && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { diff --git a/usr.sbin/setkey/token.l b/usr.sbin/setkey/token.l index 7df76d9856..27d9e8a59a 100644 --- a/usr.sbin/setkey/token.l +++ b/usr.sbin/setkey/token.l @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.sbin/setkey/token.l,v 1.2.2.3 2001/07/03 11:02:17 ume Exp $ */ -/* $DragonFly: src/usr.sbin/setkey/token.l,v 1.3 2003/11/03 19:31:43 eirikn Exp $ */ +/* $DragonFly: src/usr.sbin/setkey/token.l,v 1.4 2008/06/05 18:06:33 swildner Exp $ */ /* $KAME: token.l,v 1.21 2001/05/18 05:35:01 sakane Exp $ */ /* @@ -60,7 +60,7 @@ #define CMDARG \ { \ char *__buf__ = strdup(yytext), *__p__; \ - for (__p__ = __buf__; *__p__ != NULL; __p__++) \ + for (__p__ = __buf__; *__p__ != 0; __p__++) \ if (*__p__ == '\n' || *__p__ == '\t') \ *__p__ = ' '; \ strcat(cmdarg, __buf__); \ @@ -143,7 +143,7 @@ spdflush { PREPROC; return(SPDFLUSH); } /* count up for nl */ { char *p; - for (p = yytext; *p != NULL; p++) + for (p = yytext; *p != 0; p++) if (*p == '\n') lineno++; } @@ -241,7 +241,7 @@ any { PREPROC; return(ANY); } char *p = yytext; PREPROC; while (*++p != ']') ; - *p = NULL; + *p = 0; yytext++; yylval.num = atoi(yytext); return(PORT); @@ -270,7 +270,7 @@ any { PREPROC; return(ANY); } char *p = yytext; PREPROC; while (*++p != '"') ; - *p = NULL; + *p = 0; yytext++; yylval.val.len = yyleng - 2; yylval.val.buf = strdup(yytext); diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index 37bd2ae9e0..45221b06f5 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.32.2.7 2002/09/15 22:31:50 dd Exp $ - * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.12 2007/08/19 11:39:11 swildner Exp $ + * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.13 2008/06/05 18:06:33 swildner Exp $ */ #include @@ -320,7 +320,7 @@ print_scrnmap(void) if (i > 0 && i % 16 == 0) fprintf(stdout, "\n"); - if (hex != NULL) + if (hex != 0) fprintf(stdout, " %02x", map[i]); else fprintf(stdout, " %03d", map[i]); @@ -554,7 +554,7 @@ video_mode(int argc, char **argv, int *mode_index) { "VESA_132x50", M_VESA_C132x50 }, { "VESA_132x60", M_VESA_C132x60 }, { "VESA_800x600", M_VESA_800x600 }, - { NULL, NULL }, + { NULL, 0 }, }; int new_mode_num = 0; -- 2.41.0