Skip to content

Commit

Permalink
NULL does not need a cast, here
Browse files Browse the repository at this point in the history
  • Loading branch information
plunky committed Sep 16, 2011
1 parent f532a3c commit bf7947b
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 65 deletions.
6 changes: 3 additions & 3 deletions lib/libedit/filecomplete.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: filecomplete.c,v 1.30 2011/08/16 16:25:15 christos Exp $ */
/* $NetBSD: filecomplete.c,v 1.31 2011/09/16 16:13:16 plunky Exp $ */

/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -31,7 +31,7 @@

#include "config.h"
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: filecomplete.c,v 1.30 2011/08/16 16:25:15 christos Exp $");
__RCSID("$NetBSD: filecomplete.c,v 1.31 2011/09/16 16:13:16 plunky Exp $");
#endif /* not lint && not SCCSID */

#include <sys/types.h>
Expand Down Expand Up @@ -333,7 +333,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;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/libutil/login_tty.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: login_tty.c,v 1.12 2008/02/09 05:07:26 dholland Exp $ */
/* $NetBSD: login_tty.c,v 1.13 2011/09/16 16:13:16 plunky Exp $ */

/*-
* Copyright (c) 1990, 1993
Expand Down Expand Up @@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)login_tty.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: login_tty.c,v 1.12 2008/02/09 05:07:26 dholland Exp $");
__RCSID("$NetBSD: login_tty.c,v 1.13 2011/09/16 16:13:16 plunky Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

Expand All @@ -53,7 +53,7 @@ login_tty(int fd)
_DIAGASSERT(fd != -1);

(void) setsid();
if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
if (ioctl(fd, TIOCSCTTY, NULL) == -1)
return (-1);
(void) dup2(fd, STDIN_FILENO);
(void) dup2(fd, STDOUT_FILENO);
Expand Down
6 changes: 3 additions & 3 deletions libexec/atrun/atrun.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: atrun.c,v 1.20 2011/08/01 12:28:54 mbalmer Exp $ */
/* $NetBSD: atrun.c,v 1.21 2011/09/16 16:13:17 plunky Exp $ */

/*
* atrun.c - run jobs queued by at; run with root privileges.
Expand Down Expand Up @@ -59,7 +59,7 @@
#if 0
static char rcsid[] = "$OpenBSD: atrun.c,v 1.7 1997/09/08 22:12:10 millert Exp $";
#else
__RCSID("$NetBSD: atrun.c,v 1.20 2011/08/01 12:28:54 mbalmer Exp $");
__RCSID("$NetBSD: atrun.c,v 1.21 2011/09/16 16:13:17 plunky Exp $");
#endif

static int debug = 0;
Expand Down Expand Up @@ -327,7 +327,7 @@ run_file(const char *filename, uid_t uid, gid_t gid)
/* We're the parent. Let's wait. */
(void)close(fd_in);
(void)close(fd_out);
(void)waitpid(pid, (int *)NULL, 0);
(void)waitpid(pid, NULL, 0);

/*
* Send mail. Unlink the output file first, so it is deleted
Expand Down
6 changes: 3 additions & 3 deletions libexec/ftpd/ftpcmd.y
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: ftpcmd.y,v 1.92 2011/07/01 02:46:15 joerg Exp $ */
/* $NetBSD: ftpcmd.y,v 1.93 2011/09/16 16:13:17 plunky Exp $ */

/*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -72,7 +72,7 @@
#if 0
static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94";
#else
__RCSID("$NetBSD: ftpcmd.y,v 1.92 2011/07/01 02:46:15 joerg Exp $");
__RCSID("$NetBSD: ftpcmd.y,v 1.93 2011/09/16 16:13:17 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -1633,7 +1633,7 @@ yylex(void)
c = cmdp[cpos];
cmdp[cpos] = '\0';
yylval.u.i = atoi(cp);
yylval.u.ll = STRTOLL(cp, (char **)NULL, 10);
yylval.u.ll = STRTOLL(cp, NULL, 10);
cmdp[cpos] = c;
return (NUMBER);
}
Expand Down
6 changes: 3 additions & 3 deletions libexec/ftpd/ftpd.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: ftpd.c,v 1.196 2011/09/04 23:16:41 lukem Exp $ */
/* $NetBSD: ftpd.c,v 1.197 2011/09/16 16:13:17 plunky Exp $ */

/*
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -97,7 +97,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1988, 1990, 1992, 1993, 1994\
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: ftpd.c,v 1.196 2011/09/04 23:16:41 lukem Exp $");
__RCSID("$NetBSD: ftpd.c,v 1.197 2011/09/16 16:13:17 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -2547,7 +2547,7 @@ statcmd(void)
int ispassive, af;
off_t otbi, otbo, otb;

a = p = (unsigned char *)NULL;
a = p = NULL;

reply(-211, "%s FTP server status:", hostname);
reply(0, "Version: %s", EMPTYSTR(version) ? "<suppressed>" : version);
Expand Down
6 changes: 3 additions & 3 deletions libexec/ftpd/logutmp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: logutmp.c,v 1.11 2008/06/09 01:00:23 lukem Exp $ */
/* $NetBSD: logutmp.c,v 1.12 2011/09/16 16:13:17 plunky Exp $ */

/*
* Portions Copyright (c) 1988, 1993
Expand Down Expand Up @@ -56,7 +56,7 @@

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: logutmp.c,v 1.11 2008/06/09 01:00:23 lukem Exp $");
__RCSID("$NetBSD: logutmp.c,v 1.12 2011/09/16 16:13:17 plunky Exp $");
#endif /* not lint */

#include <sys/types.h>
Expand Down Expand Up @@ -98,7 +98,7 @@ ftpd_login(const struct utmp *ut)
*/
if (topslot < 0) {
topslot = 0;
while (getttyent() != (struct ttyent *)NULL)
while (getttyent() != NULL)
topslot++;
}
if ((topslot < 0) || ((fd < 0)
Expand Down
6 changes: 3 additions & 3 deletions libexec/rlogind/rlogind.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rlogind.c,v 1.40 2011/08/27 15:45:52 joerg Exp $ */
/* $NetBSD: rlogind.c,v 1.41 2011/09/16 16:13:17 plunky Exp $ */

/*
* Copyright (C) 1998 WIDE Project.
Expand Down Expand Up @@ -69,7 +69,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1989, 1993\
#if 0
static char sccsid[] = "@(#)rlogind.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: rlogind.c,v 1.40 2011/08/27 15:45:52 joerg Exp $");
__RCSID("$NetBSD: rlogind.c,v 1.41 2011/09/16 16:13:17 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -365,7 +365,7 @@ doit(int f, struct sockaddr_storage *fromp)
"Connection received using IP options (ignored):%s",
lbuf);
if (setsockopt(0, ipproto, IP_OPTIONS,
(char *)NULL, optsize) != 0) {
NULL, optsize) != 0) {
syslog(LOG_ERR,
"setsockopt IP_OPTIONS NULL: %m");
exit(1);
Expand Down
8 changes: 4 additions & 4 deletions libexec/rpc.rquotad/rquotad.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* $NetBSD: rquotad.c,v 1.29 2011/08/30 17:06:20 plunky Exp $ */
/* $NetBSD: rquotad.c,v 1.30 2011/09/16 16:13:17 plunky Exp $ */

/*
* by Manuel Bouyer (bouyer@ensta.fr). Public domain.
*/

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: rquotad.c,v 1.29 2011/08/30 17:06:20 plunky Exp $");
__RCSID("$NetBSD: rquotad.c,v 1.30 2011/09/16 16:13:17 plunky Exp $");
#endif

#include <sys/param.h>
Expand Down Expand Up @@ -126,7 +126,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:
Expand All @@ -147,7 +147,7 @@ ext_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:
Expand Down
6 changes: 3 additions & 3 deletions libexec/rpc.rstatd/rstat_proc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rstat_proc.c,v 1.45 2011/08/30 17:06:20 plunky Exp $ */
/* $NetBSD: rstat_proc.c,v 1.46 2011/09/16 16:13:17 plunky Exp $ */

/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
Expand Down Expand Up @@ -35,7 +35,7 @@
static char sccsid[] = "from: @(#)rpc.rstatd.c 1.1 86/09/25 Copyr 1984 Sun Micro";
static char sccsid[] = "from: @(#)rstat_proc.c 2.2 88/08/01 4.0 RPCSRC";
#else
__RCSID("$NetBSD: rstat_proc.c,v 1.45 2011/08/30 17:06:20 plunky Exp $");
__RCSID("$NetBSD: rstat_proc.c,v 1.46 2011/09/16 16:13:17 plunky Exp $");
#endif
#endif

Expand Down Expand Up @@ -378,7 +378,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)

switch (rqstp->rq_proc) {
case NULLPROC:
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
goto leave;

case RSTATPROC_STATS:
Expand Down
6 changes: 3 additions & 3 deletions libexec/rpc.rwalld/rwalld.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rwalld.c,v 1.22 2011/08/30 17:06:20 plunky Exp $ */
/* $NetBSD: rwalld.c,v 1.23 2011/09/16 16:13:17 plunky Exp $ */

/*
* Copyright (c) 1993 Christopher G. Demetriou
Expand Down Expand Up @@ -36,7 +36,7 @@

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: rwalld.c,v 1.22 2011/08/30 17:06:20 plunky Exp $");
__RCSID("$NetBSD: rwalld.c,v 1.23 2011/09/16 16:13:17 plunky Exp $");
#endif /* not lint */

#include <unistd.h>
Expand Down Expand Up @@ -157,7 +157,7 @@ wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)

switch (rqstp->rq_proc) {
case NULLPROC:
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
goto leave;

case WALLPROC_WALL:
Expand Down
6 changes: 3 additions & 3 deletions libexec/rpc.sprayd/sprayd.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: sprayd.c,v 1.17 2011/08/30 17:06:21 plunky Exp $ */
/* $NetBSD: sprayd.c,v 1.18 2011/09/16 16:13:17 plunky Exp $ */

/*
* Copyright (c) 1994 Christos Zoulas
Expand Down Expand Up @@ -27,7 +27,7 @@

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: sprayd.c,v 1.17 2011/08/30 17:06:21 plunky Exp $");
__RCSID("$NetBSD: sprayd.c,v 1.18 2011/09/16 16:13:17 plunky Exp $");
#endif /* not lint */

#include <stdio.h>
Expand Down Expand Up @@ -131,7 +131,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp)
/*FALLTHROUGH*/

case NULLPROC:
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
return;

case SPRAYPROC_SPRAY:
Expand Down
6 changes: 3 additions & 3 deletions sbin/dump/tape.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: tape.c,v 1.49 2008/02/16 17:58:01 matt Exp $ */
/* $NetBSD: tape.c,v 1.50 2011/09/16 16:13:17 plunky Exp $ */

/*-
* Copyright (c) 1980, 1991, 1993
Expand Down Expand Up @@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tape.c 8.4 (Berkeley) 5/1/95";
#else
__RCSID("$NetBSD: tape.c,v 1.49 2008/02/16 17:58:01 matt Exp $");
__RCSID("$NetBSD: tape.c,v 1.50 2011/09/16 16:13:17 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -383,7 +383,7 @@ trewind(int eject)
}
(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)
Expand Down
6 changes: 3 additions & 3 deletions sbin/fsck_ext2fs/setup.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: setup.c,v 1.27 2009/10/19 18:41:08 bouyer Exp $ */
/* $NetBSD: setup.c,v 1.28 2011/09/16 16:13:18 plunky Exp $ */

/*
* Copyright (c) 1980, 1986, 1993
Expand Down Expand Up @@ -58,7 +58,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.5 (Berkeley) 11/23/94";
#else
__RCSID("$NetBSD: setup.c,v 1.27 2009/10/19 18:41:08 bouyer Exp $");
__RCSID("$NetBSD: setup.c,v 1.28 2011/09/16 16:13:18 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -134,7 +134,7 @@ setup(const char *dev)
asblk.b_un.b_buf = malloc(SBSIZE);
if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL)
errexit("cannot allocate space for superblock");
if ((lp = getdisklabel((char *)NULL, fsreadfd)) != NULL)
if ((lp = getdisklabel(NULL, fsreadfd)) != NULL)
dev_bsize = secsize = lp->d_secsize;
else
dev_bsize = secsize = DEV_BSIZE;
Expand Down
6 changes: 3 additions & 3 deletions sbin/ping6/ping6.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: ping6.c,v 1.77 2011/08/31 22:27:26 christos Exp $ */
/* $NetBSD: ping6.c,v 1.78 2011/09/16 16:13:18 plunky Exp $ */
/* $KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $ */

/*
Expand Down Expand Up @@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
#else
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ping6.c,v 1.77 2011/08/31 22:27:26 christos Exp $");
__RCSID("$NetBSD: ping6.c,v 1.78 2011/09/16 16:13:18 plunky Exp $");
#endif
#endif

Expand Down Expand Up @@ -401,7 +401,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;
Expand Down
6 changes: 3 additions & 3 deletions sbin/restore/symtab.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: symtab.c,v 1.27 2011/01/04 23:46:34 wiz Exp $ */
/* $NetBSD: symtab.c,v 1.28 2011/09/16 16:13:18 plunky Exp $ */

/*
* Copyright (c) 1983, 1993
Expand Down Expand Up @@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)symtab.c 8.3 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: symtab.c,v 1.27 2011/01/04 23:46:34 wiz Exp $");
__RCSID("$NetBSD: symtab.c,v 1.28 2011/09/16 16:13:18 plunky Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -549,7 +549,7 @@ initsymtable(const 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;
Expand Down
4 changes: 2 additions & 2 deletions tests/fs/nfs/nfsservice/rpcbind/rpcb_svc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rpcb_svc.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
/* $NetBSD: rpcb_svc.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */

/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
Expand Down Expand Up @@ -89,7 +89,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
#endif
/* This call just logs, no actual checks */
check_access(transp, rqstp->rq_proc, NULL, RPCBVERS);
(void) svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
(void) svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
return;

case RPCBPROC_SET:
Expand Down
5 changes: 2 additions & 3 deletions tests/fs/nfs/nfsservice/rpcbind/rpcb_svc_4.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rpcb_svc_4.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
/* $NetBSD: rpcb_svc_4.c,v 1.2 2011/09/16 16:13:18 plunky Exp $ */

/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
Expand Down Expand Up @@ -91,8 +91,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
fprintf(stderr, "RPCBPROC_NULL\n");
#endif
check_access(transp, rqstp->rq_proc, NULL, RPCBVERS4);
(void) svc_sendreply(transp, (xdrproc_t) xdr_void,
(char *)NULL);
(void) svc_sendreply(transp, (xdrproc_t) xdr_void, NULL);
return;

case RPCBPROC_SET:
Expand Down
Loading

0 comments on commit bf7947b

Please sign in to comment.