* If -d or -t, set the timezone or daylight savings time; this
* doesn't belong here; the kernel should not know about either.
*/
- if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
+ if (set_timezone && settimeofday(NULL, &tz))
err(1, "settimeofday (timezone)");
if (!rflag && time(&tval) == -1)
logwtmp("|", "date", "");
tv.tv_sec = tval;
tv.tv_usec = 0;
- if (settimeofday(&tv, (struct timezone *)NULL))
+ if (settimeofday(&tv, NULL))
err(1, "settimeofday (timeval)");
logwtmp("{", "date", "");
}
ctab = casetab;
}
- gettimeofday(&tv, (struct timezone *)NULL);
+ gettimeofday(&tv, NULL);
st.start = tv.tv_sec + tv.tv_usec * 1e-6;
}
double secs;
char buf[100];
- gettimeofday(&tv, (struct timezone *)NULL);
+ gettimeofday(&tv, NULL);
secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start;
if (secs < 1e-6)
secs = 1e-6;
/* vp->type == numeric_string, make it numeric */
errno = 0;
- i = strtoll(vp->u.s, (char**)NULL, 10);
+ i = strtoll(vp->u.s, NULL, 10);
if (errno != 0) {
errx (2, "overflow");
}
if ((pid = fork()) == 0) {
execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to,
- (char *)NULL);
+ NULL);
warn("%s", _PATH_CP);
_exit(1);
}
return (1);
}
if (!(pid = vfork())) {
- execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL);
+ execl(_PATH_RM, "mv", "-rf", "--", from, NULL);
warn("%s", _PATH_RM);
_exit(1);
}
}
close(fds[0]);
close(fds[1]);
- if (execlp(gzip_program, gzip_program, gzip_flags,
- (char *)NULL) < 0)
+ if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0)
err(1, "could not exec");
/* NOTREACHED */
}
if (d_first < 0)
d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
- if ((arcn->sb.st_mtime + SIXMONTHS) <= time((time_t *)NULL))
+ if ((arcn->sb.st_mtime + SIXMONTHS) <= time(NULL))
timefrmt = d_first ? OLDFRMTD : OLDFRMTM;
else
timefrmt = d_first ? CURFRMTD : CURFRMTM;
ki->ki_args = NULL;
}
if (needenv) {
- ki->ki_env = getfmt(kvm_getenvv, ki, (char *)NULL, 0);
+ ki->ki_env = getfmt(kvm_getenvv, ki, NULL, 0);
} else {
ki->ki_env = NULL;
}
case 0:
setuid(userid);
- execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL);
+ execl(_PATH_BSHELL, "sh", "-c", s, NULL);
_exit(127);
}
istat = signal(SIGINT, SIG_IGN);
do_etest = !(flags & EV_TESTED);
break;
case NCMD:
- evalcommand(n, flags, (struct backcmd *)NULL);
+ evalcommand(n, flags, NULL);
do_etest = !(flags & EV_TESTED);
break;
default:
}
if (! backgnd) {
INTOFF;
- exitstatus = waitforjob(jp, (int *)NULL);
+ exitstatus = waitforjob(jp, NULL);
INTON;
}
}
INTON;
if (n->npipe.backgnd == 0) {
INTOFF;
- exitstatus = waitforjob(jp, (int *)NULL);
+ exitstatus = waitforjob(jp, NULL);
TRACE(("evalpipe: job done exit status %d\n", exitstatus));
INTON;
}
expandhere(union node *arg, int fd)
{
herefd = fd;
- expandarg(arg, (struct arglist *)NULL, 0);
+ expandarg(arg, NULL, 0);
xwrite(fd, stackblock(), expdest - stackblock());
}
if (in.buf)
ckfree(in.buf);
if (in.jp)
- exitstatus = waitforjob(in.jp, (int *)NULL);
+ exitstatus = waitforjob(in.jp, NULL);
if (quoted == 0)
recordregion(startloc, dest - stackblock(), 0);
TRACE(("evalbackq: size=%d: \"%.*s\"\n",
case VSQUESTION:
if (*p != CTLENDVAR) {
outfmt(&errout, "%s\n", startp);
- error((char *)NULL);
+ error(NULL);
}
error("%.*s: parameter %snot set", (int)(p - str - 1),
str, (varflags & VSNUL) ? "null or "
restartjob(jp);
jp->foreground = 1;
INTOFF;
- status = waitforjob(jp, (int *)NULL);
+ status = waitforjob(jp, NULL);
INTON;
return status;
}
struct job *jp;
TRACE(("showjobs(%d) called\n", change));
- while (dowait(0, (struct job *)NULL) > 0);
+ while (dowait(0, NULL) > 0);
for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) {
if (! jp->used)
continue;
break;
}
}
- } while (dowait(1, (struct job *)NULL) != -1);
+ } while (dowait(1, NULL) != -1);
in_waitcmd--;
return 0;
#endif
if (block == 0)
flags |= WNOHANG;
- return wait3(status, flags, (struct rusage *)NULL);
+ return wait3(status, flags, NULL);
}
/*
}
}
breakloop:
- return readtoken1(c, BASESYNTAX, (char *)NULL, 0);
+ return readtoken1(c, BASESYNTAX, NULL, 0);
#undef RETURN
}
if (commandname)
outfmt(&errout, "%s: %d: ", commandname, startlinno);
outfmt(&errout, "Syntax error: %s\n", msg);
- error((char *)NULL);
+ error(NULL);
}
STATIC void
goto out;
}
}
- if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) {
+ if (forkshell(NULL, NULL, FORK_NOJOB) == 0) {
close(pip[0]);
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
}
if (!neg && (time_to_sleep.tv_sec > 0 || time_to_sleep.tv_nsec > 0))
- nanosleep(&time_to_sleep, (struct timespec *)NULL);
+ nanosleep(&time_to_sleep, NULL);
exit(0);
}
base = shell;
else
base++;
- execl(shell, base, (char *) NULL);
+ execl(shell, base, NULL);
}
else
- execl(_PATH_BSHELL, "sh", (char *) NULL);
+ execl(_PATH_BSHELL, "sh", NULL);
exit(0); /* oops */
}
placeship(COMPUTER, ss, FALSE);
}
- ss = (ship_t *)NULL;
+ ss = NULL;
do {
char c, docked[SHIPTYPES + 2], *cp = docked;
prompt(1, "Random-placing your %s", ss->name);
randomplace(PLAYER, ss);
placeship(PLAYER, ss, TRUE);
- error((char *)NULL);
+ error(NULL);
ss->placed = TRUE;
}
else if (c == 'R')
placeship(PLAYER, ss, TRUE);
ss->placed = TRUE;
}
- error((char *)NULL);
+ error(NULL);
}
else if (strchr("hjkl8462", c))
{
if (checkplace(PLAYER, ss, TRUE))
{
placeship(PLAYER, ss, TRUE);
- error((char *)NULL);
+ error(NULL);
ss->placed = TRUE;
}
}
getyx(stdscr, oldy, oldx);
sb = (turn) ? plyship : cpuship;
if(!(sym = board[OTHER][x][y]))
- return((ship_t *)NULL);
+ return(NULL);
for(ss = sb; ss < sb + SHIPTYPES; ++ss)
if(ss->symbol == sym)
{
if (++ss->hits < ss->length) { /* still afloat? */
- return((ship_t *)NULL);
+ return(NULL);
} else { /* sunk */
int i, j;
}
}
move(oldy, oldx);
- return((ship_t *)NULL);
+ return(NULL);
}
static int
if ((pager = rindex(path, '/')) != NULL)
++pager;
pager = path;
- execlp(path, pager, _PATH_INSTR, (char *) NULL);
+ execlp(path, pager, _PATH_INSTR, NULL);
fprintf(stderr, "cribbage: %s.\n", strerror(errno));
_exit(1);
default:
if ((enter_status = quit(enter_status)) == Q_QUIT)
break;
}
- leave(0, (char *) NULL);
+ leave(0, NULL);
/* NOTREACHED */
return(0);
}
static void
sigterm(int signo __unused)
{
- leave(0, (char *) NULL);
+ leave(0, NULL);
}
/*
(void) write(Socket, "q", 1);
(void) close(Socket);
}
- leave(0, (char *) NULL);
+ leave(0, NULL);
}
else if (ch == 'n') {
(void) signal(SIGINT, intr);
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * + Redistributions of source code must retain the above copyright
+ *
+ * + Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * + Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * + Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * + Neither the name of the University of California, San Francisco nor
- * the names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior written
+ * + Neither the name of the University of California, San Francisco nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
* permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $OpenBSD: driver.c,v 1.17 2007/04/02 14:55:16 jmc Exp $
read_fds = Fds_mask;
errno = 0;
timerclear(&timeout);
- nready = select(Num_fds, &read_fds, NULL, NULL,
+ nready = select(Num_fds, &read_fds, NULL, NULL,
&timeout);
if (nready < 0 && errno != EINTR) {
logit(LOG_ERR, "select");
/*
* Nothing was ready. We do some work now
* to see if the simulation has any pending work
- * to do, and decide if we need to block
+ * to do, and decide if we need to block
* indefinitely or just timeout.
*/
do {
* just block waiting for external activity
*/
to = NULL;
-
+
read_fds = Fds_mask;
errno = 0;
- nready = select(Num_fds, &read_fds, NULL, NULL,
+ nready = select(Num_fds, &read_fds, NULL, NULL,
to);
if (nready < 0 && errno != EINTR) {
logit(LOG_ERR, "select");
fd = sp->fd;
if (FD_ISSET(fd, &Have_inp) && answer_next(sp)) {
/*
- * Remove from the spawn list. (fd remains in
+ * Remove from the spawn list. (fd remains in
* read set).
*/
*sp->prevnext = sp->next;
if (first && should_announce)
announce_game();
first = FALSE;
- }
+ }
sp = spnext;
}
Server_socket = socket(AF_INET, SOCK_DGRAM, 0);
/* Permit multiple huntd's on the same port. */
- if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true,
+ if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true,
sizeof true) < 0)
logit(LOG_ERR, "setsockopt SO_REUSEADDR");
}
/* Set the death message: */
- (void) snprintf(victim->p_death, sizeof victim->p_death,
+ (void) snprintf(victim->p_death, sizeof victim->p_death,
"| %s by %s |", cp, blame);
/* No further score crediting needed. */
}
/* Set the death message: */
- (void) snprintf(victim->p_death, sizeof victim->p_death,
+ (void) snprintf(victim->p_death, sizeof victim->p_death,
"| %s by %s |", cp, credit->i_name);
if (victim == attacker) {
/* No use killing yourself. */
credit->i_kills--;
credit->i_bkills++;
- }
+ }
else if (victim->p_ident->i_team == ' '
|| victim->p_ident->i_team != credit->i_team) {
/* A cross-team kill: */
attacker->p_damage = 0;
/* Tell the attacker his new strength: */
- outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d",
+ outyx(attacker, STAT_DAM_ROW, STAT_VALUE_COL, "%2d/%2d",
attacker->p_damage, attacker->p_damcap);
/* Tell the attacker his new 'kill count': */
char buf[BUFSIZ];
/* Detonate: */
- (void) add_shot(expl_type, pp->p_y, pp->p_x,
- pp->p_face, expl_charge, (PLAYER *) NULL,
+ (void) add_shot(expl_type, pp->p_y, pp->p_x,
+ pp->p_face, expl_charge, NULL,
TRUE, SPACE);
/* Explain what the explosion is about. */
- snprintf(buf, sizeof buf, "%s detonated.",
+ snprintf(buf, sizeof buf, "%s detonated.",
pp->p_ident->i_name);
message(ALL_PLAYERS, buf);
volcano += pp->p_ammo - expl_charge;
/* Volcano eruption: */
- if (conf_volcano && rand_num(100) < volcano /
+ if (conf_volcano && rand_num(100) < volcano /
conf_volcano_max) {
/* Erupt near the middle of the map */
do {
/* Convert volcano charge into lava: */
(void) add_shot(LAVA, y, x, LEFTS, volcano,
- (PLAYER *) NULL, TRUE, SPACE);
+ NULL, TRUE, SPACE);
volcano = 0;
/* Tell eveyone what's happening */
add_shot(DSHOT, y, x, rand_dir(),
shot_req[conf_mindshot +
rand_num(MAXBOMB - conf_mindshot)],
- (PLAYER *) NULL, FALSE, SPACE);
+ NULL, FALSE, SPACE);
}
/* Tell the zapped player's client to shut down. */
if (pp != End_player) {
/* Move the last player into the gap: */
memcpy(pp, End_player, sizeof *pp);
- outyx(ALL_PLAYERS,
- STAT_PLAY_ROW + 1 + (pp - Player),
+ outyx(ALL_PLAYERS,
+ STAT_PLAY_ROW + 1 + (pp - Player),
STAT_NAME_COL,
"%5.2f%c%-10.10s %c",
pp->p_ident->i_score, stat_char(pp),
End_monitor--;
if (pp != End_monitor) {
memcpy(pp, End_monitor, sizeof *pp);
- outyx(ALL_PLAYERS,
+ outyx(ALL_PLAYERS,
STAT_MON_ROW + 1 + (pp - Player), STAT_NAME_COL,
"%5.5s %-10.10s %c", " ",
pp->p_ident->i_name, pp->p_ident->i_team);
/* Does it explode? */
if (rand_num(100) < prob)
/* Ooooh, unlucky: (Boom) */
- add_shot(obj, y, x, LEFTS, req, (PLAYER *) NULL,
- TRUE, pp->p_face);
+ add_shot(obj, y, x, LEFTS, req, NULL, TRUE, pp->p_face);
else {
/* Safely picked it up. Add to player's ammo: */
pp->p_ammo += req;
/* Land: */
if (pp->p_face != BOOT && pp->p_face != BOOT_PAIR) {
/* Land a player - they stustain a fall: */
- checkdam(pp, (PLAYER *) NULL, (IDENT *) NULL,
+ checkdam(pp, NULL, NULL,
rand_num(pp->p_damage / conf_fall_frac), FALL);
pp->p_face = rand_dir();
showstat(pp);
y, x, LEFTS,
(Maze[y][x] == GMINE) ?
GRENREQ : BULREQ,
- (PLAYER *) NULL, TRUE, SPACE);
+ NULL, TRUE, SPACE);
Maze[y][x] = SPACE;
break;
}
{
/* revoke */
setgid(getgid());
- execl("/bin/csh", "csh", (char *) NULL); exit(1);
+ execl("/bin/csh", "csh", NULL); exit(1);
}
wait(0);
if (ic<0) /* error */
if (strcmp(av[0], "a.out") == 0) {
outf = fopen("q", "w");
- setbuf(outf, (char *)NULL);
+ setbuf(outf, NULL);
Debug = TRUE;
}
restore = FALSE;
leaveok(Board, TRUE);
if ((outf = fopen(buf, "w")) == NULL)
perror(buf);
- setbuf(outf, (char *)NULL);
+ setbuf(outf, NULL);
}
Debug = !Debug;
break;
goto over;
}
if (strcmp(buf, _PATH_DEVNULL) != 0)
- setbuf(outf, (char *)NULL);
+ setbuf(outf, NULL);
}
#endif
}
if (ch == 'Y')
{
cleanup(FALSE);
- execl(_PATH_GAMEPROG, "phantasia", "-s",
- (Wizard ? "-S": (char *) NULL), (char *) NULL);
+ execl(_PATH_GAMEPROG, "phantasia", "-s", (Wizard ? "-S": NULL), NULL);
exit(0);
/*NOTREACHED*/
}
while ((ch = getopt(argc, argv, "d:h")) != -1)
switch (ch) {
case 'd':
- if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1
+ if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1
|| delay > 1000)
errx(1, "invalid delay (1-1000)");
delay *= 1000; /* ms -> us */
if ((s = getlogin()))
return s;
if (!(p = getpwuid(getuid())))
- return((char *)NULL);
+ return(NULL);
return(p->pw_name);
}
if (!fork()) {
/* revoke */
setgid(getgid());
- execl(shell, shell, (char *) NULL);
+ execl(shell, shell, NULL);
}
wait((int *)w);
}
while ((ch = getopt(argc, argv, "d:fl:n:t")) != -1)
switch(ch) {
case 'd':
- if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1 || delay > 1000)
+ if ((delay = (unsigned int)strtoul(optarg, NULL, 10)) < 1 || delay > 1000)
errx(1, "invalid delay (1-1000)");
delay *= 1000; /* ms -> us */
break;
err(1, "open %s", _PATH_WUMPINFO);
if (dup2(fd, 0) == -1)
err(1, "dup2");
- (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL);
+ (void)execl("/bin/sh", "sh", "-c", pager, NULL);
err(1, "exec sh -c %s", pager);
case -1:
err(1, "fork");
if ( (p = getcwd(buf, MAXPATHLEN)) )
return(p);
strcpy(buf, strerror(errno));
- return((char *)NULL);
+ return(NULL);
}
unlink(namestr);
_fcntl(hashp->fp, F_SETFD, 1);
}
- _sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
+ _sigprocmask(SIG_SETMASK, &oset, NULL);
return (hashp->fp != -1 ? 0 : -1);
}
getfsent(void)
{
if ((!_fs_fp && !setfsent()) || !fstabscan())
- return((struct fstab *)NULL);
+ return(NULL);
return(&_fs_fstab);
}
while (fstabscan())
if (!strcmp(_fs_fstab.fs_spec, name))
return(&_fs_fstab);
- return((struct fstab *)NULL);
+ return(NULL);
}
struct fstab *
while (fstabscan())
if (!strcmp(_fs_fstab.fs_file, name))
return(&_fs_fstab);
- return((struct fstab *)NULL);
+ return(NULL);
}
int
_close(devnull);
}
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
- "-c", cmd, (char *)NULL);
+ "-c", cmd, NULL);
_exit(1);
}
return (-1);
}
- if (hed->yp_domain == (char *)NULL)
+ if (hed->yp_domain == NULL)
if (yp_get_default_domain (&hed->yp_domain)) {
RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
return (-1);
return (-1);
}
- if (ned->yp_domain == (char *)NULL)
+ if (ned->yp_domain == NULL)
if (yp_get_default_domain (&ned->yp_domain))
return (-1);
else
rshprog = pw->pw_shell;
p = strrchr(rshprog, '/');
- execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd,
- (char *)NULL);
+ execlp(rshprog, p ? p + 1 : rshprog, "-c", cmd, NULL);
} else {
p = strrchr(rshprog, '/');
execlp(rshprog, p ? p + 1 : rshprog, *ahost, "-l",
- remuser, cmd, (char *)NULL);
+ remuser, cmd, NULL);
}
fprintf(stderr, "rcmdsh: execlp %s failed: %s\n",
rshprog, strerror(errno));
* Figure out the "time", accounting for any time difference
* with the server if necessary.
*/
- gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL);
+ gettimeofday(&ad->ad_timestamp, NULL);
ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec;
ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec;
while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) {
FD_ZERO(&readfds);
FD_SET(s, &readfds);
res = _select(_rpc_dtablesize(), &readfds,
- (fd_set *)NULL, (fd_set *)NULL, &timeout);
+ NULL, NULL, &timeout);
} while (res < 0 && errno == EINTR);
if (res <= 0)
goto error;
sigfillset(&newmask);
thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
mutex_lock(&clnt_fd_lock);
- if (dg_fd_locks == (int *) NULL) {
+ if (dg_fd_locks == NULL) {
int cv_allocsz;
size_t fd_allocsz;
int dtbsize = __rpc_dtbsize();
fd_allocsz = dtbsize * sizeof (int);
dg_fd_locks = (int *) mem_alloc(fd_allocsz);
- if (dg_fd_locks == (int *) NULL) {
+ if (dg_fd_locks == NULL) {
mutex_unlock(&clnt_fd_lock);
thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
goto err1;
cv_allocsz = dtbsize * sizeof (cond_t);
dg_cv = (cond_t *) mem_alloc(cv_allocsz);
- if (dg_cv == (cond_t *) NULL) {
+ if (dg_cv == NULL) {
mem_free(dg_fd_locks, fd_allocsz);
- dg_fd_locks = (int *) NULL;
+ dg_fd_locks = NULL;
mutex_unlock(&clnt_fd_lock);
thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
goto err1;
to.tv_sec = 10;
to.tv_usec = 0;
rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void,
- (char *)NULL, (xdrproc_t)xdr_void, (char *)NULL, to);
+ NULL, (xdrproc_t)xdr_void, NULL, to);
if (rpc_stat == RPC_SUCCESS) {
*vers_out = vers_high;
return (clnt);
}
CLNT_CONTROL(clnt, CLSET_VERS, (char *)&vers_high);
rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void,
- (char *)NULL, (xdrproc_t)xdr_void,
- (char *)NULL, to);
+ NULL, (xdrproc_t)xdr_void,
+ NULL, to);
if (rpc_stat == RPC_SUCCESS) {
*vers_out = vers_high;
return (clnt);
mutex_lock(&clnt_fd_lock); \
vc_fd_locks[fd] = 0; \
mutex_unlock(&clnt_fd_lock); \
- thr_sigsetmask(SIG_SETMASK, &(mask), (sigset_t *) NULL); \
+ thr_sigsetmask(SIG_SETMASK, &(mask), NULL); \
cond_signal(&vc_cv[fd]); \
}
cl = (CLIENT *)mem_alloc(sizeof (*cl));
ct = (struct ct_data *)mem_alloc(sizeof (*ct));
- if ((cl == (CLIENT *)NULL) || (ct == (struct ct_data *)NULL)) {
+ if ((cl == NULL) || (ct == NULL)) {
syslog(LOG_ERR, clnt_vc_errstr, clnt_vc_str, __no_mem_str);
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
sigfillset(&newmask);
thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
mutex_lock(&clnt_fd_lock);
- if (vc_fd_locks == (int *) NULL) {
+ if (vc_fd_locks == NULL) {
int cv_allocsz, fd_allocsz;
int dtbsize = __rpc_dtbsize();
fd_allocsz = dtbsize * sizeof (int);
vc_fd_locks = (int *) mem_alloc(fd_allocsz);
- if (vc_fd_locks == (int *) NULL) {
+ if (vc_fd_locks == NULL) {
mutex_unlock(&clnt_fd_lock);
thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
goto err;
} else
memset(vc_fd_locks, '\0', fd_allocsz);
- assert(vc_cv == (cond_t *) NULL);
+ assert(vc_cv == NULL);
cv_allocsz = dtbsize * sizeof (cond_t);
vc_cv = (cond_t *) mem_alloc(cv_allocsz);
- if (vc_cv == (cond_t *) NULL) {
+ if (vc_cv == NULL) {
mem_free(vc_fd_locks, fd_allocsz);
- vc_fd_locks = (int *) NULL;
+ vc_fd_locks = NULL;
mutex_unlock(&clnt_fd_lock);
thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
goto err;
cond_init(&vc_cv[i], 0, NULL);
}
} else
- assert(vc_cv != (cond_t *) NULL);
+ assert(vc_cv != NULL);
/*
* XXX - fvdl connecting while holding a mutex?
if (cl)
mem_free(cl, sizeof (CLIENT));
}
- return ((CLIENT *)NULL);
+ return (NULL);
}
static enum clnt_stat
return(DESERR_HWERROR);
}
clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf);
- if (clnt == (CLIENT *) NULL) {
+ if (clnt == NULL) {
endnetconfig(localhandle);
return(DESERR_HWERROR);
}
bcopy(dparms->des_key, des_crypt_1_arg.des_key, 8);
result_1 = des_crypt_1(&des_crypt_1_arg, clnt);
- if (result_1 == (desresp *) NULL) {
+ if (result_1 == NULL) {
clnt_destroy(clnt);
return(DESERR_HWERROR);
}
}
kcp = (struct key_call_private *)thr_getspecific(key_call_key);
}
- if (kcp == (struct key_call_private *)NULL) {
+ if (kcp == NULL) {
kcp = (struct key_call_private *)malloc(sizeof (*kcp));
- if (kcp == (struct key_call_private *)NULL) {
- return ((CLIENT *) NULL);
+ if (kcp == NULL) {
+ return (NULL);
}
if (main_thread)
key_call_private_main = kcp;
if (kcp->client->cl_auth == NULL) {
clnt_destroy(kcp->client);
kcp->client = NULL;
- return ((CLIENT *) NULL);
+ return (NULL);
}
}
/* Change the version number to the new one */
return (kcp->client);
}
if (!(localhandle = setnetconfig())) {
- return ((CLIENT *) NULL);
+ return (NULL);
}
tpconf = NULL;
if (uname(&u) == -1)
{
endnetconfig(localhandle);
- return ((CLIENT *) NULL);
+ return (NULL);
}
while ((nconf = getnetconfig(localhandle)) != NULL) {
if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) {
}
}
}
- if ((kcp->client == (CLIENT *) NULL) && (tpconf))
+ if ((kcp->client == NULL) && (tpconf))
/* Now, try the CLTS or COTS loopback transport */
kcp->client = clnt_tp_create(u.nodename,
KEY_PROG, vers, tpconf);
endnetconfig(localhandle);
- if (kcp->client == (CLIENT *) NULL) {
- return ((CLIENT *) NULL);
+ if (kcp->client == NULL) {
+ return (NULL);
}
kcp->uid = geteuid();
kcp->pid = getpid();
if (kcp->client->cl_auth == NULL) {
clnt_destroy(kcp->client);
kcp->client = NULL;
- return ((CLIENT *) NULL);
+ return (NULL);
}
wait_time.tv_sec = TOTAL_TIMEOUT/TOTAL_TRIES;
uid = geteuid();
if (uid == 0) {
- return (host2netname(name, (char *) NULL, (char *) NULL));
+ return (host2netname(name, NULL, NULL));
} else {
- return (user2netname(name, uid, (char *) NULL));
+ return (user2netname(name, uid, NULL));
}
}
__rpc_getconfip(const char *nettype)
{
char *netid;
- char *netid_tcp = (char *) NULL;
- char *netid_udp = (char *) NULL;
+ char *netid_tcp = NULL;
+ char *netid_udp = NULL;
static char *netid_tcp_main;
static char *netid_udp_main;
struct netconfig *dummy;
SVCXPRT *xprt;
int addrlen;
- xprt = (SVCXPRT *)NULL;
+ xprt = NULL;
localhandle = setnetconfig();
while ((nconf = getnetconfig(localhandle)) != NULL) {
if (nconf->nc_protofmly != NULL &&
return (cptr);
}
}
- return ((struct address_cache *) NULL);
+ return (NULL);
}
static void
if ((na = __rpcb_findaddr_timed(program, version,
(struct netconfig *) nconf, (char *) host,
- (CLIENT **) NULL, (struct timeval *) NULL)) == NULL)
+ NULL, NULL)) == NULL)
return (FALSE);
if (na->len > address->maxlen) {
break;
}
__rpc_endconf(handle);
- if (client == (CLIENT *) NULL) {
+ if (client == NULL) {
return (FALSE);
}
FD_ZERO(&readfds);
FD_SET(s, &readfds);
res = _select(_rpc_dtablesize(), &readfds,
- (fd_set *)NULL, (fd_set *)NULL, timeout);
+ NULL, NULL, timeout);
} while (res < 0 && errno == EINTR);
if (res <= 0) {
if (res == 0) {
debug("timestamp before last seen");
return (AUTH_REJECTEDVERF); /* replay */
}
- gettimeofday(¤t, (struct timezone *)NULL);
+ gettimeofday(¤t, NULL);
current.tv_sec -= window; /* allow for expiration */
if (!BEFORE(¤t, ×tamp)) {
debug("timestamp expired");
char *
mkdtemp(char *path)
{
- return (_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL);
+ return (_gettemp(path, NULL, 1, 0) ? path : NULL);
}
char *
_mktemp(char *path)
{
- return (_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
+ return (_gettemp(path, NULL, 0, 0) ? path : NULL);
}
__warn_references(mktemp,
function
is exactly equivalent to the call:
.Pp
-.Dl "setvbuf(stream, (char *)NULL, _IOLBF, 0);"
+.Dl "setvbuf(stream, NULL, _IOLBF, 0);"
.Sh RETURN VALUES
The
.Fn setvbuf
setlinebuf(FILE *fp)
{
- return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0));
+ return (setvbuf(fp, NULL, _IOLBF, (size_t)0));
}
*p = 0;
if ((flags & UNSIGNED) == 0)
- res = strtoimax(buf, (char **)NULL, base);
+ res = strtoimax(buf, NULL, base);
else
- res = strtoumax(buf, (char **)NULL, base);
+ res = strtoumax(buf, NULL, base);
if (flags & POINTER)
*va_arg(ap, void **) =
(void *)(uintptr_t)res;
.Pp
It is equivalent to:
.Bd -literal -offset indent
-strtod(nptr, (char **)NULL);
+strtod(nptr, NULL);
.Ed
.Pp
The decimal point
.Pp
It is equivalent to:
.Bd -literal -offset indent
-(int)strtol(nptr, (char **)NULL, 10);
+(int)strtol(nptr, NULL, 10);
.Ed
.Pp
The
int
atoi(const char *str)
{
- return((int)strtol(str, (char **)NULL, 10));
+ return((int)strtol(str, NULL, 10));
}
.Pp
It is equivalent to:
.Pp
-.Dl "strtol(nptr, (char **)NULL, 10);"
+.Dl "strtol(nptr, NULL, 10);"
.Pp
The
.Fn atoll
.Pp
It is equivalent to:
.Pp
-.Dl "strtoll(nptr, (char **)NULL, 10);"
+.Dl "strtoll(nptr, NULL, 10);"
.Sh ERRORS
The functions
.Fn atol
long
atol(const char *str)
{
- return(strtol(str, (char **)NULL, 10));
+ return(strtol(str, NULL, 10));
}
_sigaction(SIGINT, &intact, NULL);
_sigaction(SIGQUIT, &quitact, NULL);
_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
- execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL);
+ execl(_PATH_BSHELL, "sh", "-c", command, NULL);
_exit(127);
default: /* parent */
savedpid = pid;
_RWLOCK_WRLOCK(&lcl_rwlock);
lcl_is_set = -1;
- if (tzload((char *) NULL, lclptr, TRUE) != 0)
+ if (tzload(NULL, lclptr, TRUE) != 0)
gmtload(lclptr);
settzname();
_RWLOCK_UNLOCK(&lcl_rwlock);
PANIC("Can't open console");
if (setlogin("root") == -1)
PANIC("Can't set login to root");
- if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1)
+ if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1)
PANIC("Can't set controlling terminal");
if (__sys_dup2(fd, 0) == -1 ||
__sys_dup2(fd, 1) == -1 ||
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);
}
static HIST_ENTRY rl_he;
if (history(h, &ev, op) != 0)
- return (HIST_ENTRY *) NULL;
+ return NULL;
rl_he.line = ev.str;
rl_he.data = NULL;
.Sh RETURN VALUES
Upon successful completion, the function shall return a pointer to the
long text form of an ACL. Otherwise, a value of
-.Va (char*)NULL
+.Va NULL
shall be returned and
.Va errno
shall be set to indicate the error.
rusers(char *host, utmpidlearr *up)
{
return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES,
- (xdrproc_t)xdr_void, (char *) NULL,
+ (xdrproc_t)xdr_void, NULL,
(xdrproc_t)xdr_utmpidlearr, (char *) up));
}
int nusers;
if (callrpc(host, RUSERSPROG, RUSERSVERS_ORIG, RUSERSPROC_NUM,
- (xdrproc_t)xdr_void, (char *) NULL,
+ (xdrproc_t)xdr_void, NULL,
(xdrproc_t)xdr_u_long, (char *) &nusers) != 0)
return (-1);
else
{
return (callrpc(host, WALLPROG, WALLVERS, WALLPROC_WALL,
(xdrproc_t)xdr_wrapstring, (char *) &msg,
- (xdrproc_t)xdr_void, (char *) NULL));
+ (xdrproc_t)xdr_void, NULL));
}
PANIC("Can't open console");
if (setlogin("root") == -1)
PANIC("Can't set login to root");
- if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1)
+ if (__sys_ioctl(fd, TIOCSCTTY, NULL) == -1)
PANIC("Can't set controlling terminal");
}
login_tty(int fd)
{
(void) setsid();
- if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
+ if (ioctl(fd, TIOCSCTTY, NULL) == -1)
return (-1);
(void) dup2(fd, 0);
(void) dup2(fd, 1);
/* child */
if (user == NULL)
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
- "-d", passwd_dir, tempname, (char *)NULL);
+ "-d", passwd_dir, tempname, NULL);
else
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
"-d", passwd_dir, "-u", user, tempname,
- (char *)NULL);
+ NULL);
_exit(1);
/* NOTREACHED */
default:
setuid(getuid());
}
errno = 0;
- execlp(editor, basename(editor), tempname, (char *)NULL);
+ execlp(editor, basename(editor), tempname, NULL);
_exit(errno);
default:
/* parent */
bytes_read = read (fd, buf, sizeof (buf) - 1);
if (bytes_read > 0) {
buf[bytes_read] = '\0';
- pid = strtol (buf, (char **) NULL, 10);
+ pid = strtol (buf, NULL, 10);
} else {
pid = -1;
*err = bytes_read ? errno : EINVAL;
if (chdir(pentry->pw_dir))
chdir("/");
- if(execle("/bin/sh","sh",(char *) NULL, nenvp) != 0)
+ if(execle("/bin/sh","sh",NULL, nenvp) != 0)
perr("exec failed for /bin/sh");
PRIV_END
*/
close(fd_in);
close(fd_out);
- waitpid(pid, (int *) NULL, 0);
+ waitpid(pid, NULL, 0);
/* Send mail. Unlink the output file first, so it is deleted after
* the run.
execl(_PATH_SENDMAIL, "sendmail", "-F", "Atrun Service",
"-odi", "-oem",
- mailname, (char *) NULL);
+ mailname, NULL);
perr("exec failed for mail command");
PRIV_END
if (!opentty(ttyn, O_RDWR|O_NONBLOCK))
exit(1);
- setdefttymode(tname);
- rfds = 1 << 0; /* FD_SET */
- timeout.tv_sec = RT;
- timeout.tv_usec = 0;
- i = select(32, (fd_set*)&rfds, (fd_set*)NULL,
- (fd_set*)NULL, RT ? &timeout : NULL);
- if (i < 0) {
+ setdefttymode(tname);
+ rfds = 1 << 0; /* FD_SET */
+ timeout.tv_sec = RT;
+ timeout.tv_usec = 0;
+ i = select(32, (fd_set*)&rfds, NULL,
+ NULL, RT ? &timeout : NULL);
+ if (i < 0) {
syslog(LOG_ERR, "select %s: %m", ttyn);
} else if (i == 0) {
syslog(LOG_NOTICE, "recycle tty %s", ttyn);
rfds = 1 << 0;
timeout.tv_sec = 5;
timeout.tv_usec = 0;
- if (select(32, (fd_set *)&rfds, (fd_set *)NULL,
- (fd_set *)NULL, &timeout) <= 0)
+ if (select(32, (fd_set *)&rfds, NULL, NULL, &timeout) <= 0)
return (type);
if (read(STDIN_FILENO, &c, sizeof(char)) != sizeof(char))
return (type);
timeout.tv_sec = 0;
timeout.tv_usec = 20;
- (void) select(32, (fd_set *)NULL, (fd_set *)NULL,
- (fd_set *)NULL, &timeout);
+ (void) select(32, NULL, NULL, NULL, &timeout);
(void)tcflush(0, TCIOFLUSH);
switch (c & 0377) {
setsid();
syslog(LOG_INFO, "Executing: %s", exec);
- execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, (char *)NULL);
+ execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, NULL);
syslog(LOG_ERR, "execlp failed: %m");
_exit(EX_OSFILE);
}
if (authenticated) {
execl(_PATH_LOGIN, "login", "-p",
- "-h", hostname, "-f", lusername, (char *)NULL);
+ "-h", hostname, "-f", lusername, NULL);
} else
execl(_PATH_LOGIN, "login", "-p",
- "-h", hostname, lusername, (char *)NULL);
+ "-h", hostname, lusername, NULL);
fatal(STDERR_FILENO, _PATH_LOGIN, 1);
/*NOTREACHED*/
}
FD_ZERO(&ebits);
FD_ZERO(&ibits);
FD_ZERO(&obits);
- omask = (fd_set *)NULL;
+ omask = NULL;
if (fcc) {
FD_SET(p, &obits);
omask = &obits;
{
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:
syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: cmd='%.80s'",
remuser, fromhost, locuser, cmdbuf);
}
- execl(pwd->pw_shell, cp, "-c", cmdbuf, (char *)NULL);
+ execl(pwd->pw_shell, cp, "-c", cmdbuf, NULL);
perror(pwd->pw_shell);
exit(1);
}
* restoring disrtcset, since we don't clean up
* anything.
*/
- if (gettimeofday(&tv, (struct timezone *)NULL)) {
+ if (gettimeofday(&tv, NULL)) {
syslog(LOG_ERR, "gettimeofday: %m");
return 1;
}
* Allocate memory to hold the SNMP header
*/
if ( ( h = (Snmp_Header *)UM_ALLOC(sizeof(Snmp_Header)) ) == NULL )
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
/*
* Ensure that we wipe the slate clean
* PDU has to start as SEQUENCE OF
*/
if ( *bp++ != ASN_SEQUENCE ) /* Class == Universial, f == 1, tag == SEQUENCE */
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
/*
* Get the length of remaining PDU data
* We expect to find an integer encoding Version-1
*/
if ( *bp++ != ASN_INTEGER ) {
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
h->version = asn_get_int ( &bp, NULL );
* After the version, we need the community name
*/
if ( *bp++ != ASN_OCTET ) {
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
asn_get_octet ( &bp, h->community, NULL );
/* Request ID */
if ( *bp++ != ASN_INTEGER ) {
UM_FREE ( h );
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
h->reqid = asn_get_int ( &bp, NULL );
/* Error Status */
if ( *bp++ != ASN_INTEGER ) {
UM_FREE ( h );
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
h->error = asn_get_int ( &bp, NULL );
/* Error Index */
if ( *bp++ != ASN_INTEGER ) {
UM_FREE ( h );
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
h->erridx = asn_get_int ( &bp, NULL );
/* Sequence of... */
if ( *bp++ != ASN_SEQUENCE ) {
UM_FREE ( h );
- return ( (Snmp_Header *)NULL );
+ return ( NULL );
}
h->varlen = ( asn_get_pdu_len ( &bp, &len ) - 1 );
h->varlen += ( len - 1 );
Increment_DL ( __unused int sig )
{
Debug_Level++;
- if ( Debug_Level && Log == (FILE *)NULL ) {
+ if ( Debug_Level && Log == NULL ) {
if ( foregnd ) {
Log = stderr;
} else {
break;
default:
- warn((char *)NULL);
+ warn(NULL);
break;
}
}
break;
default:
- warn((char *)NULL);
+ warn(NULL);
break;
}
}
}
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)
{
login_cap_t *lc;
if ((lc = login_getclassbyname(cname, NULL)) != NULL) {
- setusercontext(lc, (struct passwd*)NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES);
+ setusercontext(lc, NULL, 0, LOGIN_SETPRIORITY|LOGIN_SETRESOURCES);
login_close(lc);
}
}
};
argc -= optind;
argv += optind;
- grphead = (struct grouplist *)NULL;
- exphead = (struct exportlist *)NULL;
- mlhead = (struct mountlist *)NULL;
+ grphead = NULL;
+ exphead = NULL;
+ mlhead = NULL;
if (argc == 1) {
strncpy(exname, *argv, MAXPATHLEN-1);
exname[MAXPATHLEN-1] = '\0';
if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, &putdef))
goto errout;
if (ep->ex_defdir && putdef == 0 &&
- put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL,
+ put_exlist(ep->ex_defdir, xdrsp, NULL,
&putdef))
goto errout;
ep = ep->ex_next;
return (1);
}
hp = hp->ht_next;
- if (gotalldir && hp == (struct hostlist *)NULL) {
+ if (gotalldir && hp == NULL) {
hp = adp->dp_hosts;
gotalldir = 0;
}
ep = ep->ex_next;
free_exp(ep2);
}
- exphead = (struct exportlist *)NULL;
+ exphead = NULL;
grp = grphead;
while (grp) {
grp = grp->gr_next;
free_grp(tgrp);
}
- grphead = (struct grouplist *)NULL;
+ grphead = NULL;
/*
* And delete exports that are in the kernel for all local
syslog(LOG_ERR, "can't open %s", exname);
exit(2);
}
- dirhead = (struct dirlist *)NULL;
+ dirhead = NULL;
while (get_line()) {
if (debug)
warnx("got line %s", line);
exflags = MNT_EXPORTED;
got_nondir = 0;
opt_flags = 0;
- ep = (struct exportlist *)NULL;
+ ep = NULL;
/*
* Create new exports list entry
goto nextline;
}
if (*cp == '-') {
- if (ep == (struct exportlist *)NULL) {
+ if (ep == NULL) {
getexp_err(ep, tgrp);
goto nextline;
}
* in the list.
*/
ep = ex_search(&fsb.f_fsid);
- if (ep == (struct exportlist *)NULL) {
+ if (ep == NULL) {
ep = get_exp();
ep->ex_fs = fsb.f_fsid;
ep->ex_fsdir = (char *)
savedc = *endcp;
*endcp = '\0';
got_nondir = 1;
- if (ep == (struct exportlist *)NULL) {
+ if (ep == NULL) {
getexp_err(ep, tgrp);
goto nextline;
}
grp->gr_next = grphead;
grphead = tgrp;
} else {
- hang_dirp(dirhead, (struct grouplist *)NULL, ep,
+ hang_dirp(dirhead, NULL, ep,
opt_flags);
free_grp(grp);
}
- dirhead = (struct dirlist *)NULL;
+ dirhead = NULL;
if ((ep->ex_flag & EX_LINKED) == 0) {
ep2 = exphead;
epp = &exphead;
nextline:
if (dirhead) {
free_dir(dirhead);
- dirhead = (struct dirlist *)NULL;
+ dirhead = NULL;
}
}
fclose(exp_file);
struct exportlist *ep;
ep = (struct exportlist *)malloc(sizeof (struct exportlist));
- if (ep == (struct exportlist *)NULL)
+ if (ep == NULL)
out_of_mem();
memset(ep, 0, sizeof(struct exportlist));
return (ep);
struct grouplist *gp;
gp = (struct grouplist *)malloc(sizeof (struct grouplist));
- if (gp == (struct grouplist *)NULL)
+ if (gp == NULL)
out_of_mem();
memset(gp, 0, sizeof(struct grouplist));
return (gp);
struct dirlist *dp;
dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len);
- if (dp == (struct dirlist *)NULL)
+ if (dp == NULL)
out_of_mem();
dp->dp_left = *dpp;
- dp->dp_right = (struct dirlist *)NULL;
+ dp->dp_right = NULL;
dp->dp_flag = 0;
- dp->dp_hosts = (struct hostlist *)NULL;
+ dp->dp_hosts = NULL;
strcpy(dp->dp_dirp, cp);
*dpp = dp;
return (dp->dp_dirp);
free((caddr_t)dp);
else
ep->ex_defdir = dp;
- if (grp == (struct grouplist *)NULL) {
+ if (grp == NULL) {
ep->ex_defdir->dp_flag |= DP_DEFSET;
if (flags & OP_KERB)
ep->ex_defdir->dp_flag |= DP_KERB;
free((caddr_t)newdp);
} else {
dp = newdp;
- dp->dp_left = (struct dirlist *)NULL;
+ dp->dp_left = NULL;
*dpp = dp;
}
if (grp) {
struct hostlist *hp;
hp = (struct hostlist *)malloc(sizeof (struct hostlist));
- if (hp == (struct hostlist *)NULL)
+ if (hp == NULL)
out_of_mem();
- hp->ht_next = (struct hostlist *)NULL;
+ hp->ht_next = NULL;
hp->ht_flag = 0;
return (hp);
}
if (host == NULL || dirp == NULL)
continue;
mlp = (struct mountlist *)malloc(sizeof (*mlp));
- if (mlp == (struct mountlist *)NULL)
+ if (mlp == NULL)
out_of_mem();
strncpy(mlp->ml_host, host, RPCMNT_NAMELEN);
mlp->ml_host[RPCMNT_NAMELEN] = '\0';
strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
- mlp->ml_next = (struct mountlist *)NULL;
+ mlp->ml_next = NULL;
*mlpp = mlp;
mlpp = &mlp->ml_next;
}
mlp = mlp->ml_next;
}
mlp = (struct mountlist *)malloc(sizeof (*mlp));
- if (mlp == (struct mountlist *)NULL)
+ if (mlp == NULL)
out_of_mem();
strncpy(mlp->ml_host, hostp, RPCMNT_NAMELEN);
mlp->ml_host[RPCMNT_NAMELEN] = '\0';
strncpy(mlp->ml_dirp, dirp, RPCMNT_PATHLEN);
mlp->ml_dirp[RPCMNT_PATHLEN] = '\0';
- mlp->ml_next = (struct mountlist *)NULL;
+ mlp->ml_next = NULL;
*mlpp = mlp;
if ((mlfile = fopen(_PATH_RMOUNTLIST, "a")) == NULL) {
syslog(LOG_ERR, "can't update %s", _PATH_RMOUNTLIST);
check_options(struct dirlist *dp)
{
- if (dp == (struct dirlist *)NULL)
+ if (dp == NULL)
return (1);
if ((opt_flags & (OP_MAPROOT | OP_MAPALL)) == (OP_MAPROOT | OP_MAPALL) ||
(opt_flags & (OP_MAPROOT | OP_KERB)) == (OP_MAPROOT | OP_KERB) ||
err(EX_NOPERM, "-f flag");
}
options |= F_FLOOD;
- setbuf(stdout, (char *)NULL);
+ setbuf(stdout, NULL);
break;
case 'G': /* Maximum packet size for ping sweep */
ultmp = strtoul(optarg, &ep, 0);
errx(1, "Must be superuser to flood ping");
}
options |= F_FLOOD;
- setbuf(stdout, (char *)NULL);
+ setbuf(stdout, NULL);
break;
case 'g':
gateway = optarg;
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;
done(1);
}
map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY));
- if (map == (char *)NULL)
+ if (map == NULL)
panic("no memory for file dump list\n");
dumpmap = map;
curfile.action = USING;
int ch;
if (argc < 2)
- usage((char *)NULL);
+ usage(NULL);
while ((ch = getopt(argc, argv, "c:wnqdtv")) != -1)
switch(ch) {
break;
case '?':
default:
- usage((char *)NULL);
+ usage(NULL);
}
argc -= optind;
argv += optind;
break;
case K_IFA:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
getaddr(RTA_IFA, *++argv, 0);
break;
case K_IFP:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
getaddr(RTA_IFP, *++argv, 0);
break;
case K_GENMASK:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
getaddr(RTA_GENMASK, *++argv, 0);
break;
case K_GATEWAY:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
getaddr(RTA_GATEWAY, *++argv, 0);
break;
case K_DST:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
ishost = getaddr(RTA_DST, *++argv, &hp);
dest = *argv;
break;
case K_NETMASK:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
getaddr(RTA_NETMASK, *++argv, 0);
/* FALLTHROUGH */
case K_NET:
break;
case K_PREFIXLEN:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
if (prefixlen(*++argv) == -1) {
forcenet = 0;
ishost = 1;
af = AF_MPLS;
aflen = sizeof(struct sockaddr_mpls);
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
switch(pushcount + swapcount){
case 1:
getaddr(RTA_MPLS1, *++argv, 0);
case K_RTT:
case K_RTTVAR:
if (--argc == 0)
- usage((char *)NULL);
+ usage(NULL);
set_metric(*++argv, key);
break;
default:
break;
case '?':
default:
- usage((char *)NULL);
+ usage(NULL);
}
argc -= optind;
argv += optind;
if (argc < 1)
- usage((char *)NULL);
+ usage(NULL);
if (killflg + doreboot + dohalt + dopower > 1)
usage("incompatible switches -h, -k, -p and -r");
} else {
if (doreboot) {
execle(_PATH_REBOOT, "reboot", "-l", nosync,
- (char *)NULL, empty_environ);
+ NULL, empty_environ);
syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
_PATH_REBOOT);
warn(_PATH_REBOOT);
}
else if (dohalt) {
execle(_PATH_HALT, "halt", "-l", nosync,
- (char *)NULL, empty_environ);
+ NULL, empty_environ);
syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
_PATH_HALT);
warn(_PATH_HALT);
}
else if (dopower) {
execle(_PATH_HALT, "halt", "-l", "-p", nosync,
- (char *)NULL, empty_environ);
+ NULL, empty_environ);
syslog(LOG_ERR, "shutdown: can't exec %s: %m.",
_PATH_HALT);
warn(_PATH_HALT);
i = forkpty(&ptyfd, buf, 0, 0);
if (i == 0) {
execl("/usr/libexec/getty", "getty", "std.300", "-",
- (char *)NULL);
+ NULL);
syslog(LOG_ERR, "exec getty %d", errno);
exit(2);
} else if (i < 0) {
errx(1, "Unreasonable sector size: %s", optarg);
break;
case 's':
- user_size = strtoll(optarg, (char **)NULL, /*base*/10);
+ user_size = strtoll(optarg, NULL, /*base*/10);
if (user_size < 0)
errx(1, "Unreasonable volume size: %s", optarg);
break;
machinename = argv[1];
args.ss.ss_len = argc - 2; /* substract off progname, machinename */
args.ss.ss_val = &argv[2];
- res.ss.ss_val = (char **)NULL;
+ res.ss.ss_val = NULL;
if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT,
xdr_sortstrings, &args, xdr_sortstrings, &res)))
{
static struct sortstrings ss_res;
- if (ss_res.ss.ss_val != (str *)NULL)
+ if (ss_res.ss.ss_val != NULL)
free(ss_res.ss.ss_val);
qsort(ssp->ss.ss_val, ssp->ss.ss_len, sizeof (char *), comparestrings);
do not roll your own.
.Bd -literal
if ((four = malloc(sizeof(struct foo))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
if ((six = (int *)overflow()) == NULL)
errx(1, "number overflowed");
return(eight);
struct scsi_tape_locate *scmd;
cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action,
- (u_int8_t *)NULL, 0, sense_len, sizeof(*scmd), timeout);
+ NULL, 0, sense_len, sizeof(*scmd), timeout);
scmd = (struct scsi_tape_locate *)&csio->cdb_io.cdb_bytes;
bzero(scmd, sizeof(*scmd));
scmd->opcode = LOCATE;
*/
evp = (Eni_vcc *) atm_dev_vcc_find ( (Cmn_unit *)eup,
0, vcc, VCC_IN );
- if ( evp == (Eni_vcc *)NULL )
+ if ( evp == NULL )
goto next_vcc; /* VCI no longer active */
rdptr = evp->ev_rxpos;
/*
/*
* Do we have a valid buffer?
*/
- if ( m != (KBuffer *)NULL )
+ if ( m != NULL )
{
int len;
u_long *up;
sc->mode.packetsize = vendortype[i].packetsize;
/* set mouse parameters */
- if (mode != (mousemode_t *)NULL) {
+ if (mode != NULL) {
if (mode->rate > 0)
mode->rate = set_mouse_sampling_rate(kbdc, mode->rate);
if (mode->resolution >= 0)
}
kprintf("ie%d: reset\n", unit);
ie_softc[unit].arpcom.ac_if.if_flags &= ~IFF_UP;
- ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL);
+ ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL);
/*
* Stop i82586 dead in its tracks.
#endif
ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP;
- ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, (struct ucred *)NULL);
+ ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL);
}
/*
if (ie->mcast_count >= MAXMCAST) {
ie->arpcom.ac_if.if_flags |= IFF_ALLMULTI;
ieioctl(&ie->arpcom.ac_if, SIOCSIFFLAGS, NULL,
- (struct ucred *)NULL);
+ NULL);
goto setflag;
}
bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr),
union asr_ccb * ccb;
OUT int status;
- if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+ if ((ccb = asr_alloc_ccb (sc)) == NULL) {
return (CAM_REQUEUE_REQ);
}
* xpt_async (AC_BUS_RESET, sc->ha_path[bus], NULL);
* }
*/
- while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != (struct ccb_hdr *)NULL) {
+ while ((ccb = LIST_FIRST(&(sc->ha_ccb))) != NULL) {
ASR_ccbRemove (sc, (union asr_ccb *)ccb);
ccb->status &= ~CAM_STATUS_MASK;
ASR_getBlinkLedCode (
IN Asr_softc_t * sc)
{
- if ((sc != (Asr_softc_t *)NULL)
- && (sc->ha_blinkLED != (u_int8_t *)NULL)
+ if ((sc != NULL)
+ && (sc->ha_blinkLED != NULL)
&& (sc->ha_blinkLED[1] == 0xBC)) {
return (sc->ha_blinkLED[0]);
}
* sc must be valid before it gets here, so that check could be
* dropped if speed a critical issue.
*/
- if ((sc == (Asr_softc_t *)NULL)
+ if ((sc == NULL)
|| (bus > MAX_CHANNEL)
|| (target > sc->ha_MaxId)
|| (lun > sc->ha_MaxLun)) {
debug_asr_printf("(%lx,%d,%d,%d) target out of range\n",
(u_long)sc, bus, target, lun);
- return ((tid_t *)NULL);
+ return (NULL);
}
/*
* See if there is an associated bus list.
*/
# define BUS_CHUNK 8
new_size = ((target + BUS_CHUNK - 1) & ~(BUS_CHUNK - 1));
- if ((bus_ptr = sc->ha_targets[bus]) == (target2lun_t *)NULL) {
+ if ((bus_ptr = sc->ha_targets[bus]) == NULL) {
/*
* Allocate a new structure?
* Since one element in structure, the +1
|| ((sc->ha_targets[bus] = bus_ptr = (target2lun_t *)kmalloc (
sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
M_TEMP, M_WAITOK))
- == (target2lun_t *)NULL)) {
+ == NULL)) {
debug_asr_printf("failed to allocate bus list\n");
- return ((tid_t *)NULL);
+ return (NULL);
}
bzero (bus_ptr, sizeof(*bus_ptr)
+ (sizeof(bus_ptr->LUN) * new_size));
|| ((new_bus_ptr = (target2lun_t *)kmalloc (
sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
M_TEMP, M_WAITOK))
- == (target2lun_t *)NULL)) {
+ == NULL)) {
debug_asr_printf("failed to reallocate bus list\n");
- return ((tid_t *)NULL);
+ return (NULL);
}
/*
* Zero and copy the whole thing, safer, simpler coding
if ((new_size = lun) != 0) {
new_size = ((lun + TARGET_CHUNK - 1) & ~(TARGET_CHUNK - 1));
}
- if ((target_ptr = bus_ptr->LUN[target]) == (lun2tid_t *)NULL) {
+ if ((target_ptr = bus_ptr->LUN[target]) == NULL) {
/*
* Allocate a new structure?
* Since one element in structure, the +1
|| ((bus_ptr->LUN[target] = target_ptr = (lun2tid_t *)kmalloc (
sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
M_TEMP, M_WAITOK))
- == (lun2tid_t *)NULL)) {
+ == NULL)) {
debug_asr_printf("failed to allocate target list\n");
- return ((tid_t *)NULL);
+ return (NULL);
}
bzero (target_ptr, sizeof(*target_ptr)
+ (sizeof(target_ptr->TID) * new_size));
|| ((new_target_ptr = (lun2tid_t *)kmalloc (
sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
M_TEMP, M_WAITOK))
- == (lun2tid_t *)NULL)) {
+ == NULL)) {
debug_asr_printf("failed to reallocate target list\n");
- return ((tid_t *)NULL);
+ return (NULL);
}
/*
* Zero and copy the whole thing, safer, simpler coding
crit_enter();
if (((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, FALSE))
- == (tid_t *)NULL)
+ == NULL)
/* (tid_t)0 or (tid_t)-1 indicate no TID */
|| (*tid_ptr == (tid_t)0)) {
crit_exit();
}
crit_enter();
if ((tid_ptr = ASR_getTidAddress (sc, bus, target, lun, TRUE))
- == (tid_t *)NULL) {
+ == NULL) {
crit_exit();
return ((tid_t)-1);
}
* as the OS normally would flush all outstanding commands before
* issuing a shutdown or an adapter reset).
*/
- if ((sc != (Asr_softc_t *)NULL)
- && (LIST_FIRST(&(sc->ha_ccb)) != (struct ccb_hdr *)NULL)
+ if ((sc != NULL)
+ && (LIST_FIRST(&(sc->ha_ccb)) != NULL)
&& ((TID = ASR_getTid (sc, bus, target, lun)) != (tid_t)-1)
&& (TID != (tid_t)0)) {
defAlignLong(PRIVATE_SCSI_SCB_EXECUTE_MESSAGE,Message);
p &= ~15;
sc->ha_mem_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid,
p, p + l, l, RF_ACTIVE);
- if (sc->ha_mem_res == (struct resource *)NULL) {
+ if (sc->ha_mem_res == NULL) {
return (0);
}
sc->ha_Base = (void *)rman_get_start(sc->ha_mem_res);
p &= ~15;
sc->ha_mes_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid,
p, p + l, l, RF_ACTIVE);
- if (sc->ha_mes_res == (struct resource *)NULL) {
+ if (sc->ha_mes_res == NULL) {
return (0);
}
if ((void *)rman_get_start(sc->ha_mes_res) == NULL) {
sc->ha_irq_res = bus_alloc_resource(tag, SYS_RES_IRQ, &rid,
0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
- if (sc->ha_irq_res == (struct resource *)NULL) {
+ if (sc->ha_irq_res == NULL) {
return (0);
}
error = bus_setup_intr(tag, sc->ha_irq_res, 0,
ATTACH_SET();
sc = kmalloc(sizeof(*sc), M_DEVBUF, M_INTWAIT | M_ZERO);
- if (Asr_softc == (Asr_softc_t *)NULL) {
+ if (Asr_softc == NULL) {
/*
* Fixup the OS revision as saved in the dptsig for the
* engine (dptioctl.h) to pick up.
int bus;
union asr_ccb * ccb;
- if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+ if ((ccb = asr_alloc_ccb (sc)) == NULL) {
kprintf ("asr%d: CAM could not be notified of asynchronous callback parameters\n", unit);
ATTACH_RETURN(ENOMEM);
}
* and a generic handler for immunity against odd error
* returns from the adapter.
*/
- if (ccb == (union asr_ccb *)NULL) {
+ if (ccb == NULL) {
/*
* Return Reply so that it can be used for the
* next command
cdev_t dev = ap->a_head.a_dev;
OUT int error;
- if (ASR_get_sc (dev) == (Asr_softc_t *)NULL) {
+ if (ASR_get_sc (dev) == NULL) {
return (ENODEV);
}
crit_enter();
}
if (error) {
while ((elm = SLIST_FIRST(&sgList))
- != (struct ioctlSgList_S *)NULL) {
+ != NULL) {
SLIST_REMOVE_HEAD(&sgList, link);
kfree (elm, M_TEMP);
}
debug_usr_cmd_dump_message(Message_Ptr);
/* Send the command */
- if ((ccb = asr_alloc_ccb (sc)) == (union asr_ccb *)NULL) {
+ if ((ccb = asr_alloc_ccb (sc)) == NULL) {
/* Free up in-kernel buffers */
while ((elm = SLIST_FIRST(&sgList))
- != (struct ioctlSgList_S *)NULL) {
+ != NULL) {
SLIST_REMOVE_HEAD(&sgList, link);
kfree (elm, M_TEMP);
}
crit_exit();
/* Free up in-kernel buffers */
while ((elm = SLIST_FIRST(&sgList))
- != (struct ioctlSgList_S *)NULL) {
+ != NULL) {
SLIST_REMOVE_HEAD(&sgList, link);
kfree (elm, M_TEMP);
}
}
/* Free up in-kernel buffers */
- while ((elm = SLIST_FIRST(&sgList)) != (struct ioctlSgList_S *)NULL) {
+ while ((elm = SLIST_FIRST(&sgList)) != NULL) {
/* Copy out as necessary */
if ((error == 0)
/* DIR bit considered `valid', error due to ignorance works */
OUT int error = 0;
Asr_softc_t * sc = ASR_get_sc (dev);
- if (sc != (Asr_softc_t *)NULL)
+ if (sc != NULL)
switch(ap->a_cmd) {
case DPT_SIGNATURE:
{0x00FD, "Handler lockup"},
{0x00FE, "Retrying PCI transfer"},
{0x00FF, "AEN queue is full"},
- {0xFFFFFFFF, (char *)NULL}
+ {0xFFFFFFFF, NULL}
};
/* AEN severity table. */
"WARNING",
"INFO",
"DEBUG",
- (char *)NULL
+ NULL
};
/* Error messages. */
{0x025B, "Invalid LBA offset specified in CreateUnit descriptor"},
{0x025C, "Invalid stripelet size specified in CreateUnit descriptor"},
{0x0260, "SMART attribute exceeded threshold"},
- {0xFFFFFFFF, (char *)NULL}
+ {0xFFFFFFFF, NULL}
};
#ifdef TWA_DEBUG
* referencing boards when printing trace and stuff.
*/
static char *stl_brdnames[] = {
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
"EasyIO",
"EC8/32-AT",
"EC8/32-MC",
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
+ NULL,
+ NULL,
+ NULL,
"EC8/32-PCI",
"EC8/64-PCI",
"EasyIO-PCI",
int i;
for (i = 0; (i < STL_MAXBRDS); i++)
- if (stl_brds[i] == (stlbrd_t *) NULL)
+ if (stl_brds[i] == NULL)
break;
return((i >= STL_MAXBRDS) ? -1 : i);
}
}
if (brdtype == 0)
- return((char *) NULL);
+ return(NULL);
class = pci_conf_read(tag, PCI_CLASS_REG);
if ((class & PCI_CLASS_MASK) == PCI_CLASS_MASS_STORAGE)
- return((char *) NULL);
+ return(NULL);
return(stl_brdnames[brdtype]);
}
return(0);
portp = stl_dev2port(dev);
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(ENXIO);
if (minor(dev) & STL_CTRLDEV)
return(0);
return(0);
portp = stl_dev2port(dev);
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(ENXIO);
tp = &portp->tty;
return(stl_memioctl(dev, cmd, data, ap->a_fflag));
portp = stl_dev2port(dev);
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
tp = &portp->tty;
error = 0;
stlbrd_t *brdp;
brdp = stl_brds[MKDEV2BRD(dev)];
- if (brdp == (stlbrd_t *) NULL)
- return((stlport_t *) NULL);
+ if (brdp == NULL)
+ return(NULL);
return(brdp->ports[MKDEV2PORT(dev)]);
}
kprintf("stl_flush(portp=%x,flag=%x)\n", (int) portp, flag);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return;
crit_enter();
#endif
for (i = 0; (i < stl_nrbrds); i++) {
- if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL)
+ if ((brdp = stl_brds[i]) == NULL)
continue;
if (brdp->state == 0)
continue;
crit_enter();
for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) {
- if ((brdp = stl_brds[brdnr]) == (stlbrd_t *) NULL)
+ if ((brdp = stl_brds[brdnr]) == NULL)
continue;
for (portnr = 0; (portnr < brdp->nrports); portnr++) {
- if ((portp = brdp->ports[portnr]) == (stlport_t *) NULL)
+ if ((portp = brdp->ports[portnr]) == NULL)
continue;
if ((portp->state & ASY_ACTIVE) == 0)
continue;
stlport_t *portp;
portp = (stlport_t *) tp;
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
return(stl_setport(portp, tiosp));
for (i = 0, k = 0; (i < STL_MAXPANELS); i++) {
panelp = brdp->panels[i];
- if (panelp != (stlpanel_t *) NULL) {
+ if (panelp != NULL) {
stl_initports(brdp, panelp);
for (j = 0; (j < panelp->nrports); j++)
brdp->ports[k++] = panelp->ports[j];
if (stl_brdstats.brd >= STL_MAXBRDS)
return(-ENODEV);
brdp = stl_brds[stl_brdstats.brd];
- if (brdp == (stlbrd_t *) NULL)
+ if (brdp == NULL)
return(-ENODEV);
bzero(&stl_brdstats, sizeof(combrd_t));
stlpanel_t *panelp;
if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
- return((stlport_t *) NULL);
+ return(NULL);
brdp = stl_brds[brdnr];
- if (brdp == (stlbrd_t *) NULL)
- return((stlport_t *) NULL);
+ if (brdp == NULL)
+ return(NULL);
if ((panelnr < 0) || (panelnr >= brdp->nrpanels))
- return((stlport_t *) NULL);
+ return(NULL);
panelp = brdp->panels[panelnr];
- if (panelp == (stlpanel_t *) NULL)
- return((stlport_t *) NULL);
+ if (panelp == NULL)
+ return(NULL);
if ((portnr < 0) || (portnr >= panelp->nrports))
- return((stlport_t *) NULL);
+ return(NULL);
return(panelp->ports[portnr]);
}
{
unsigned char *head, *tail;
- if (portp == (stlport_t *) NULL) {
+ if (portp == NULL) {
stl_comstats = *((comstats_t *) data);
portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
stl_comstats.port);
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(-ENODEV);
}
static int stl_clrportstats(stlport_t *portp, caddr_t data)
{
- if (portp == (stlport_t *) NULL) {
+ if (portp == NULL) {
stl_comstats = *((comstats_t *) data);
portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
stl_comstats.port);
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
}
switch (cmd) {
case COM_GETPORTSTATS:
- rc = stl_getportstats((stlport_t *) NULL, data);
+ rc = stl_getportstats(NULL, data);
break;
case COM_CLRPORTSTATS:
- rc = stl_clrportstats((stlport_t *) NULL, data);
+ rc = stl_clrportstats(NULL, data);
break;
case COM_GETBRDSTATS:
rc = stl_getbrdstats(data);
kprintf("stl_cd1400flush(portp=%x,flag=%x)\n", (int) portp, flag);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return;
crit_enter();
kprintf("stl_cd1400datastate(portp=%x)\n", (int) portp);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(0);
return((portp->state & ASY_TXBUSY) ? 1 : 0);
(int) brdp, (int) panelp, (int) portp);
#endif
- if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
- (portp == (stlport_t *) NULL))
+ if ((brdp == NULL) || (panelp == NULL) ||
+ (portp == NULL))
return;
portp->ioaddr = panelp->iobase + (((brdp->brdtype == BRD_ECHPCI) ||
(int) brdp, (int) panelp, (int) portp);
#endif
- if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
- (portp == (stlport_t *) NULL))
+ if ((brdp == NULL) || (panelp == NULL) ||
+ (portp == NULL))
return;
portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4);
(int) portp, hw, sw);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return;
crit_enter();
kprintf("stl_sc26198datastate(portp=%x)\n", (int) portp);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return(0);
if (portp->state & ASY_TXBUSY)
return(1);
kprintf("stl_sc26198flush(portp=%x,flag=%x)\n", (int) portp, flag);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return;
crit_enter();
kprintf("stl_sc26198wait(portp=%x)\n", (int) portp);
#endif
- if (portp == (stlport_t *) NULL)
+ if (portp == NULL)
return;
for (i = 0; (i < 20); i++)
"Brumby",
"Brumby",
"ONboard-EI",
- (char *) NULL,
+ NULL,
"ONboard",
"ONboard-MC",
"ONboard-MC",
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
- (char *) NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
"EasyIO",
"EC8/32-AT",
"EC8/32-MC",
int i;
for (i = 0; (i < STL_MAXBRDS); i++)
- if (stli_brds[i] == (stlibrd_t *) NULL)
+ if (stli_brds[i] == NULL)
break;
return((i >= STL_MAXBRDS) ? -1 : i);
}
* Go ahead and try probing for the shared memory region now.
* This way we will really know if the board is here...
*/
- if ((brdp = stli_brdalloc()) == (stlibrd_t *) NULL)
+ if ((brdp = stli_brdalloc()) == NULL)
return(0);
brdp->brdnr = stli_findfreeunit();
stli_stliprobed[idp->id_unit] = brdp->brdnr;
stli_brdinit(brdp);
if ((brdp->state & BST_FOUND) == 0) {
- stli_brds[brdp->brdnr] = (stlibrd_t *) NULL;
+ stli_brds[brdp->brdnr] = NULL;
return(0);
}
stli_nrbrds++;
brdnr = stli_stliprobed[idp->id_unit];
brdp = stli_brds[brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(0);
if (brdp->state & BST_FOUND)
stli_brdattach(brdp);
return(0);
portp = stli_dev2port(dev);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENXIO);
if (minor(dev) & STL_CTRLDEV)
return(0);
return(0);
portp = stli_dev2port(dev);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENXIO);
tp = &portp->tty;
return(ENODEV);
portp = stli_dev2port(dev);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
return ttyread(ap);
}
if (minor(dev) & STL_CTRLDEV)
return(ENODEV);
portp = stli_dev2port(dev);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
return ttywrite(ap);
}
return(stli_memioctl(dev, cmd, data, ap->a_fflag));
portp = stli_dev2port(dev);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
- if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+ if ((brdp = stli_brds[portp->brdnr]) == NULL)
return(ENODEV);
tp = &portp->tty;
error = 0;
stlibrd_t *brdp;
brdp = stli_brds[MKDEV2BRD(dev)];
- if (brdp == (stlibrd_t *) NULL)
- return((stliport_t *) NULL);
+ if (brdp == NULL)
+ return(NULL);
if ((brdp->state & BST_STARTED) == 0)
- return((stliport_t *) NULL);
+ return(NULL);
return(brdp->ports[MKDEV2PORT(dev)]);
}
kprintf("stli_initopen(portp=%x)\n", (int) portp);
#endif
- if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+ if ((brdp = stli_brds[portp->brdnr]) == NULL)
return(ENXIO);
if (portp->state & ST_INITIALIZED)
return(0);
(void *) portp, portp->brdnr, portp->panelnr, portp->portnr);
#endif
- if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+ if ((brdp = stli_brds[portp->brdnr]) == NULL)
return(ENXIO);
tp = &portp->tty;
*/
if (tp->t_outq.c_cc != 0) {
brdp = stli_brds[portp->brdnr];
- if (brdp == (stlibrd_t *) NULL) {
+ if (brdp == NULL) {
crit_exit();
return;
}
int rc;
portp = (stliport_t *) tp;
- if ((brdp = stli_brds[portp->brdnr]) == (stlibrd_t *) NULL)
+ if ((brdp = stli_brds[portp->brdnr]) == NULL)
return(ENXIO);
crit_enter();
kprintf("stli_flush(portp=%x,flag=%x)\n", (int) portp, flag);
#endif
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return;
if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds))
return;
brdp = stli_brds[portp->brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return;
crit_enter();
tail -= size;
}
rp->tail = tail;
- stli_rxtmpport = (stliport_t *) NULL;
+ stli_rxtmpport = NULL;
stli_rxtmplen = 0;
}
*/
for (brdnr = 0; (brdnr < stli_nrbrds); brdnr++) {
brdp = stli_brds[brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
continue;
if ((brdp->state & BST_STARTED) == 0)
continue;
if (memp->dtype != TYP_ASYNC)
break;
portp = brdp->ports[portnr];
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
break;
portp->devnr = i;
portp->addr = memp->offset;
*/
for (i = 1, portnr = 0; (i < nrdevs); i++, portnr++) {
portp = brdp->ports[portnr];
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
break;
if (portp->addr == 0)
break;
ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr);
- if (ap != (volatile cdkasy_t *) NULL) {
+ if (ap != NULL) {
portp->rxsize = ap->rxq.size;
portp->txsize = ap->txq.size;
portp->rxoffset = ap->rxq.offset;
if (stli_brdstats.brd >= STL_MAXBRDS)
return(ENODEV);
brdp = stli_brds[stli_brdstats.brd];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(ENODEV);
bzero(&stli_brdstats, sizeof(combrd_t));
int i;
if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
- return((stliport_t *) NULL);
+ return(NULL);
brdp = stli_brds[brdnr];
- if (brdp == (stlibrd_t *) NULL)
- return((stliport_t *) NULL);
+ if (brdp == NULL)
+ return(NULL);
for (i = 0; (i < panelnr); i++)
portnr += brdp->panels[i];
if ((portnr < 0) || (portnr >= brdp->nrports))
- return((stliport_t *) NULL);
+ return(NULL);
return(brdp->ports[portnr]);
}
stlibrd_t *brdp;
int rc;
- if (portp == (stliport_t *) NULL) {
+ if (portp == NULL) {
stli_comstats = *((comstats_t *) data);
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
}
brdp = stli_brds[portp->brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(ENODEV);
if (brdp->state & BST_STARTED) {
stlibrd_t *brdp;
int rc;
- if (portp == (stliport_t *) NULL) {
+ if (portp == NULL) {
stli_comstats = *((comstats_t *) data);
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
- if (portp == (stliport_t *) NULL)
+ if (portp == NULL)
return(ENODEV);
}
brdp = stli_brds[portp->brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(ENODEV);
if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0)
brdnr = minor(dev) & 0x7;
brdp = stli_brds[brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(ENODEV);
if (brdp->state == 0)
return(ENODEV);
*/
switch (cmd) {
case COM_GETPORTSTATS:
- return(stli_getportstats((stliport_t *) NULL, data));
+ return(stli_getportstats(NULL, data));
break;
case COM_CLRPORTSTATS:
- return(stli_clrportstats((stliport_t *) NULL, data));
+ return(stli_clrportstats(NULL, data));
break;
case COM_GETBRDSTATS:
return(stli_getbrdstats(data));
*/
brdnr = minor(dev) & 0x7;
brdp = stli_brds[brdnr];
- if (brdp == (stlibrd_t *) NULL)
+ if (brdp == NULL)
return(ENODEV);
if (brdp->state == 0)
return(ENODEV);
}
break;
case COM_GETPORTSTATS:
- rc = stli_getportstats((stliport_t *) NULL, data);
+ rc = stli_getportstats(NULL, data);
break;
case COM_CLRPORTSTATS:
- rc = stli_clrportstats((stliport_t *) NULL, data);
+ rc = stli_clrportstats(NULL, data);
break;
case COM_GETBRDSTATS:
rc = stli_getbrdstats(data);
static int
atoi(const char *str)
{
- return (int)strtol(str, (char **)NULL, 10);
+ return (int)strtol(str, NULL, 10);
}
static long
atol(const char *str)
{
- return strtol(str, (char **)NULL, 10);
+ return strtol(str, NULL, 10);
}
static int
p++; /* assume all entries <= BMAX */
} while (--i);
if (c[0] == n) { /* null input--all zero length codes */
- *t = (struct huft *) NULL;
+ *t = NULL;
*m = 0;
return 0;
}
p = v; /* grab values in bit order */
h = -1; /* no tables yet--level -1 */
w = l[-1] = 0; /* no bits decoded yet */
- u[0] = (struct huft *) NULL; /* just to keep compilers happy */
- q = (struct huft *) NULL; /* ditto */
+ u[0] = NULL; /* just to keep compilers happy */
+ q = NULL; /* ditto */
z = 0; /* ditto */
/* go through the bit lengths (k already is bits in shortest code) */
glbl->gz_hufts += z + 1; /* track memory usage */
*t = q + 1; /* link to list for
* huft_free() */
- *(t = &(q->v.t)) = (struct huft *) NULL;
+ *(t = &(q->v.t)) = NULL;
u[h] = ++q; /* table starts after link */
/* connect to last table, if there is one */
/* Go through linked list, freeing from the malloced (t[-1]) address. */
p = t;
- while (p != (struct huft *) NULL) {
+ while (p != NULL) {
q = (--p)->v.t;
kfree(p, M_GZIP);
p = q;
inflate_fixed(struct inflate *glbl)
{
/* if first time, set up tables for fixed blocks */
- if (glbl->gz_fixed_tl == (struct huft *) NULL) {
+ if (glbl->gz_fixed_tl == NULL) {
int i; /* temporary variable */
static unsigned l[288]; /* length list for huft_build */
glbl->gz_fixed_bl = 7;
if ((i = huft_build(glbl, l, 288, 257, cplens, cplext,
&glbl->gz_fixed_tl, &glbl->gz_fixed_bl)) != 0) {
- glbl->gz_fixed_tl = (struct huft *) NULL;
+ glbl->gz_fixed_tl = NULL;
return i;
}
/* distance table */
if ((i = huft_build(glbl, l, 30, 0, cpdist, cpdext,
&glbl->gz_fixed_td, &glbl->gz_fixed_bd)) > 1) {
huft_free(glbl, glbl->gz_fixed_tl);
- glbl->gz_fixed_tl = (struct huft *) NULL;
+ glbl->gz_fixed_tl = NULL;
return i;
}
}
int r; /* result code */
unsigned h; /* maximum struct huft's malloc'ed */
- glbl->gz_fixed_tl = (struct huft *) NULL;
+ glbl->gz_fixed_tl = NULL;
/* initialize window, bit buffer */
glbl->gz_wp = 0;
#endif
i = xinflate(glbl);
- if (glbl->gz_fixed_td != (struct huft *) NULL) {
+ if (glbl->gz_fixed_td != NULL) {
huft_free(glbl, glbl->gz_fixed_td);
- glbl->gz_fixed_td = (struct huft *) NULL;
+ glbl->gz_fixed_td = NULL;
}
- if (glbl->gz_fixed_tl != (struct huft *) NULL) {
+ if (glbl->gz_fixed_tl != NULL) {
huft_free(glbl, glbl->gz_fixed_tl);
- glbl->gz_fixed_tl = (struct huft *) NULL;
+ glbl->gz_fixed_tl = NULL;
}
#ifdef _KERNEL
if (p == glbl->gz_slide) {
u_quad_t res;
*p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
+ res = (*ccfn)(buf, NULL, base);
if (flags & POINTER)
*__va_arg(ap, void **) =
(void *)(uintptr_t)res;
return (pr);
if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
- pr->pr_protocol == 0 && maybe == (struct protosw *)NULL)
+ pr->pr_protocol == 0 && maybe == NULL)
maybe = pr;
}
return (maybe);
err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
rt_mask(rt), rt->rt_flags,
- (struct rtentry **) NULL);
+ NULL);
if (err) {
log(LOG_WARNING, "if_rtdel: error %d\n", err);
}
ifr.ifr_flagshigh = ifp->if_flags >> 16;
lwkt_serialize_enter(ifp->if_serializer);
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
- (struct ucred *)NULL);
+ NULL);
lwkt_serialize_exit(ifp->if_serializer);
if (error == 0)
rt_ifmsg(ifp);
ifr.ifr_flagshigh = ifp->if_flags >> 16;
lwkt_serialize_enter(ifp->if_serializer);
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
- (struct ucred *)NULL);
+ NULL);
lwkt_serialize_exit(ifp->if_serializer);
}
} else {
ifr.ifr_flagshigh = ifp->if_flags >> 16;
lwkt_serialize_enter(ifp->if_serializer);
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
- (struct ucred *)NULL);
+ NULL);
lwkt_serialize_exit(ifp->if_serializer);
}
}
*/
crit_enter();
lwkt_serialize_enter(ifp->if_serializer);
- ifp->if_ioctl(ifp, SIOCADDMULTI, 0, (struct ucred *)NULL);
+ ifp->if_ioctl(ifp, SIOCADDMULTI, 0, NULL);
lwkt_serialize_exit(ifp->if_serializer);
crit_exit();
*/
if (ifma->ifma_addr->sa_family == AF_LINK && sa == 0) {
lwkt_serialize_enter(ifp->if_serializer);
- ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL);
+ ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL);
lwkt_serialize_exit(ifp->if_serializer);
}
crit_exit();
crit_enter();
lwkt_serialize_enter(ifp->if_serializer);
LIST_REMOVE(ifma, ifma_link);
- ifp->if_ioctl(ifp, SIOCDELMULTI, 0, (struct ucred *)NULL);
+ ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL);
lwkt_serialize_exit(ifp->if_serializer);
crit_exit();
kfree(ifma->ifma_addr, M_IFMADDR);
ifr.ifr_flags = ifp->if_flags;
ifr.ifr_flagshigh = ifp->if_flags >> 16;
ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
- (struct ucred *)NULL);
+ NULL);
ifp->if_flags |= IFF_UP;
ifr.ifr_flags = ifp->if_flags;
ifr.ifr_flagshigh = ifp->if_flags >> 16;
ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr,
- (struct ucred *)NULL);
+ NULL);
#ifdef INET
/*
* Also send gratuitous ARPs to notify other nodes about
}
/* No match. */
- return ((struct if_clone *)NULL);
+ return (NULL);
found_name:
if (*cp == '\0') {
flags = MSG_DONTWAIT;
m = NULL;
- error = soreceive(s->l2so, NULL, &uio, &m,
- (struct mbuf **) NULL, &flags);
+ error = soreceive(s->l2so, NULL, &uio, &m, NULL, &flags);
if (error != 0) {
if (error == EWOULDBLOCK)
return (0); /* XXX can happen? */
rt->rt_flags &= ~RTF_LLINFO;
}
#endif
- rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *) NULL,
- rt_mask(rt), 0, (struct rtentry **) NULL);
+ rtrequest(RTM_DELETE, rt_key(rt), NULL,
+ rt_mask(rt), 0, NULL);
break;
case RTM_DELETE:
api.rxhand = NULL;
lwkt_serialize_enter(rt->rt_ifp->if_serializer);
rt->rt_ifp->if_ioctl(rt->rt_ifp, SIOCATMDIS, (caddr_t)&api,
- (struct ucred *)NULL);
+ NULL);
lwkt_serialize_exit(rt->rt_ifp->if_serializer);
break;
}
if (inp->inp_laddr.s_addr == INADDR_ANY) {
struct route *ro;
- ia = (struct in_ifaddr *)NULL;
+ ia = NULL;
/*
* If route is known or can be allocated now,
* our src addr is taken from the i/f, else punt.
sin->sin_addr.s_addr ||
inp->inp_socket->so_options & SO_DONTROUTE)) {
RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)NULL;
+ ro->ro_rt = NULL;
}
if (!(inp->inp_socket->so_options & SO_DONTROUTE) && /*XXX*/
- (ro->ro_rt == (struct rtentry *)NULL ||
- ro->ro_rt->rt_ifp == (struct ifnet *)NULL)) {
+ (ro->ro_rt == NULL ||
+ ro->ro_rt->rt_ifp == NULL)) {
/* No route yet, so try to acquire one */
bzero(&ro->ro_dst, sizeof(struct sockaddr_in));
ro->ro_dst.sa_family = AF_INET;
}
if (inp->inp_laddr.s_addr == INADDR_ANY) {
if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+ error = in_pcbbind(inp, NULL, td);
if (error)
return (error);
}
}
if (sa) {
if (ssb_appendaddr(&sa->so_rcv, (struct sockaddr *)&divsrc, m,
- (struct mbuf *)NULL) == 0)
+ NULL) == 0)
m_freem(m);
else
sorwakeup(sa);
dst->sin_family != AF_INET ||
dst->sin_addr.s_addr != pkt_dst.s_addr)) {
rtfree(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)NULL;
+ ro->ro_rt = NULL;
}
if (ro->ro_rt == NULL) {
bzero(dst, sizeof *dst);
goto done;
}
m->m_pkthdr.len = mhlen + len;
- m->m_pkthdr.rcvif = (struct ifnet *)NULL;
+ m->m_pkthdr.rcvif = NULL;
m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags;
mhip->ip_off = htons(mhip->ip_off);
mhip->ip_sum = 0;
*phlen = 0;
return (m);
}
- n->m_pkthdr.rcvif = (struct ifnet *)NULL;
+ n->m_pkthdr.rcvif = NULL;
n->m_pkthdr.len = m->m_pkthdr.len + optlen;
m->m_len -= sizeof(struct ip);
m->m_data += sizeof(struct ip);
break;
}
/* If deliver_data says no we must stop */
- if (sctp_deliver_data(stcb, asoc, (struct sctp_tmit_chunk *)NULL, hold_locks) == 0)
+ if (sctp_deliver_data(stcb, asoc, NULL, hold_locks) == 0)
break;
cntDel++;
chk = TAILQ_FIRST(&asoc->delivery_queue);
SCTP_RECEIVED_SACK, (void *)net);
/* now was it the primary? if so restore */
if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) {
- sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net);
+ sctp_set_primary_addr(stcb, NULL, net);
}
}
}
/* now was it the primary? if so restore */
if (r_net->dest_state & SCTP_ADDR_WAS_PRIMARY) {
- sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, r_net);
+ sctp_set_primary_addr(stcb, NULL, r_net);
}
}
/* Now lets do a RTO with this */
}
#endif /* SCTP_DEBUG */
op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC);
- sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen,
+ sctp_abort_association(inp, NULL, m, iphlen,
sh, op_err);
return (NULL);
}
* was in flight. Only recourse is to abort the association.
*/
op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC);
- sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen,
+ sctp_abort_association(inp, NULL, m, iphlen,
sh, op_err);
return (NULL);
}
if (netl) {
if (netl->dest_state & SCTP_ADDR_UNCONFIRMED) {
netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED;
- sctp_set_primary_addr((*stcb), (struct sockaddr *)NULL,
+ sctp_set_primary_addr((*stcb), NULL,
netl);
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
(*stcb), 0, (void *)netl);
alt = sctp_find_alternate_net(stcb, net);
if (alt != net) {
if (sctp_set_primary_addr(stcb,
- (struct sockaddr *)NULL,
+ NULL,
alt) == 0) {
net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
net->src_addr_selected = 0;
ro, o_flgs, inp->ip_inp.inp.inp_moptions
#if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD_version >= 480000) \
|| defined(__DragonFly__)
- , (struct inpcb *)NULL
+ , NULL
#endif
#if defined(__NetBSD__)
,(struct socket *)inp->sctp_socket
alt = sctp_find_alternate_net(stcb, net);
if (alt != net) {
if (sctp_set_primary_addr(stcb,
- (struct sockaddr *)NULL,
+ NULL,
alt) == 0) {
net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
net->src_addr_selected = 0;
#endif
if ((err = sctp_inpcb_bind(inp->sctp_socket,
- (struct sockaddr *)NULL,
+ NULL,
#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__DragonFly__)
- (struct thread *)NULL
+ NULL
#else
- (struct proc *)NULL
+ NULL
#endif
))){
/* bind error, probably perm */
* from any net structures.
*/
if (sctp_set_primary_addr(stcb,
- (struct sockaddr *)NULL,
+ NULL,
alt) == 0) {
net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
net->src_addr_selected = 0;
lnet = stcb->asoc.primary_destination;
lnet->next_tsn_at_change = net->next_tsn_at_change = stcb->asoc.sending_seq;
if (sctp_set_primary_addr(stcb,
- (struct sockaddr *)NULL,
+ NULL,
net) == 0) {
if (net->dest_state & SCTP_ADDR_SWITCH_PRIMARY) {
net->dest_state |= SCTP_ADDR_DOUBLE_SWITCH;
}
/* Ok if we reach here it is a SCTP option we hope */
if (op == PRCO_SETOPT) {
- error = sctp_optsset(so, optname, mp, (struct proc *)NULL);
+ error = sctp_optsset(so, optname, mp, NULL);
if (*mp)
m_free(*mp);
} else if (op == PRCO_GETOPT) {
- error = sctp_optsget(so, optname, mp, (struct proc *)NULL);
+ error = sctp_optsget(so, optname, mp, NULL);
} else {
error = EINVAL;
}
}
m->m_len = tlen;
m->m_pkthdr.len = tlen;
- m->m_pkthdr.rcvif = (struct ifnet *) NULL;
+ m->m_pkthdr.rcvif = NULL;
nth->th_seq = htonl(seq);
nth->th_ack = htonl(ack);
nth->th_x2 = 0;
t_template = tcp_maketemplate(tp);
if (t_template) {
tcp_respond(tp, t_template->tt_ipgen,
- &t_template->tt_t, (struct mbuf *)NULL,
+ &t_template->tt_t, NULL,
tp->rcv_nxt, tp->snd_una - 1, 0);
tcp_freetemplate(t_template);
}
#endif
if (inp->inp_lport == 0) {
- error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+ error = in_pcbbind(inp, NULL, td);
if (error)
return (error);
}
}
if (inp->inp_lport == 0) { /* unbound socket */
- error = in_pcbbind(inp, (struct sockaddr *)NULL, td);
+ error = in_pcbbind(inp, NULL, td);
if (error)
goto release;
in_pcbinswildcardhash(inp);
(!(ro.ro_rt->rt_flags & RTF_UP) ||
!IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6->ip6_dst))) {
rtfree(ro.ro_rt);
- ro.ro_rt = (struct rtentry *)NULL;
+ ro.ro_rt = NULL;
}
if (ro.ro_rt == NULL) {
bzero(dst, sizeof(*dst));
bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr));
bcopy(&src6, &ssrc.sin6_addr, sizeof(struct in6_addr));
rtredirect((struct sockaddr *)&sdst, (struct sockaddr *)&sgw,
- (struct sockaddr *)NULL, RTF_GATEWAY | RTF_HOST,
+ NULL, RTF_GATEWAY | RTF_HOST,
(struct sockaddr *)&ssrc);
}
/* finally update cached route in each socket via kpfctlinput */
sin6 = (struct sockaddr_in6 *)rt->rt_gateway;
router_ll6 = &sin6->sin6_addr;
if (!IN6_IS_ADDR_LINKLOCAL(router_ll6))
- router_ll6 = (struct in6_addr *)NULL;
+ router_ll6 = NULL;
} else
- router_ll6 = (struct in6_addr *)NULL;
+ router_ll6 = NULL;
/* ip6 */
ip6 = mtod(m, struct ip6_hdr *);
ia->ia_addr = *sin6;
if (ifacount <= 1 && ifp->if_ioctl &&
- (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia,
- (struct ucred *)NULL))) {
+ (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (caddr_t)ia, NULL))) {
lwkt_serialize_exit(ifp->if_serializer);
return (error);
}
in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct thread *td)
{
struct socket *so = inp->inp_socket;
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL;
+ struct sockaddr_in6 *sin6 = NULL;
struct sockaddr_in6 jsin6;
struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
struct proc *p = td->td_proc;
((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 ||
!IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) {
RTFREE(ro_pmtu->ro_rt);
- ro_pmtu->ro_rt = (struct rtentry *)NULL;
+ ro_pmtu->ro_rt = NULL;
}
if (ro_pmtu->ro_rt == NULL) {
bzero(sa6_dst, sizeof(*sa6_dst));
char *lladdr = NULL;
int lladdrlen = 0;
#if 0
- struct sockaddr_dl *sdl = (struct sockaddr_dl *)NULL;
- struct llinfo_nd6 *ln = (struct llinfo_nd6 *)NULL;
+ struct sockaddr_dl *sdl = NULL;
+ struct llinfo_nd6 *ln = NULL;
struct rtentry *rt = NULL;
int is_newentry;
#endif
if (d != NULL) {
ip6cp = (struct ip6ctlparam *)d;
} else {
- ip6cp = (struct ip6ctlparam *)NULL;
+ ip6cp = NULL;
}
if (ip6cp) {
atm_free(cvp);
cvp = cvp->cv_next;
}
- cup->cu_vcc = (Cmn_vcc *)NULL;
+ cup->cu_vcc = NULL;
crit_exit();
atm_free ((caddr_t)nip);
nip = nipp;
}
- pip->pif_nif = (struct atm_nif *)NULL;
+ pip->pif_nif = NULL;
crit_exit();
err = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
rt_mask(rt), rt->rt_flags,
- (struct rtentry **) NULL);
+ NULL);
if (err) {
log(LOG_WARNING, "atm_netif_rtdel: error %d\n", err);
}
*/
#define LINK2TAIL(u,t,h,l) \
{ \
- (u)->l = (t *)NULL; \
+ (u)->l = NULL; \
/* Check for empty chain */ \
- if ((h) == (t *)NULL) { \
+ if ((h) == NULL) { \
(h) = (u); \
} else { \
t *tp; \
/* Loop until we find the end of chain */ \
- for (tp = (h); tp->l != (t *)NULL; tp = tp->l) \
+ for (tp = (h); tp->l != NULL; tp = tp->l) \
; \
tp->l = (u); \
} \
} else { \
t *tp; \
/* Loop until we find the control block */ \
- for (tp = (h); tp != (t *)NULL; tp = tp->l) { \
+ for (tp = (h); tp != NULL; tp = tp->l) { \
if (tp->l == (u)) \
break; \
} \
tp->l = (u)->l; \
} \
} \
- (u)->l = (t *)NULL; \
+ (u)->l = NULL; \
}
/*
} else { \
t *tp; \
/* Loop until we find the control block */ \
- for (tp = (h); tp != (t *)NULL; tp = tp->l) { \
+ for (tp = (h); tp != NULL; tp = tp->l) { \
if (tp->l == (u)) \
break; \
} \
/* It wasn't on the chain */ \
(f) = 0; \
} \
- (u)->l = (t *)NULL; \
+ (u)->l = NULL; \
}
#endif /* _NETATM_QUEUE_H */
/*
* Pass event to signalling manager state machine
*/
- err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET,
- (KBuffer *) NULL);
+ err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET, NULL);
/*
* Clean up if there was an error
/*
* Send the RELEASE message
*/
- rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL,
- T_ATM_ABSENT);
+ rc = unisig_vc_clear_call(usp, uvp, NULL, T_ATM_ABSENT);
return(rc);
}
LIST_REMOVE(sah, chain);
if (sah->sa_route.ro_rt) {
RTFREE(sah->sa_route.ro_rt);
- sah->sa_route.ro_rt = (struct rtentry *)NULL;
+ sah->sa_route.ro_rt = NULL;
}
KFREE(sah);
}
if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len
&& bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) {
RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)NULL;
+ ro->ro_rt = NULL;
}
}
struct enc_xform *espx;
struct auth_hash *esph;
int hlen, rlen, plen, padding, blks, alen, i, roff;
- struct mbuf *mo = (struct mbuf *) NULL;
+ struct mbuf *mo = NULL;
struct tdb_crypto *tc;
struct secasvar *sav;
struct secasindex *saidx;
*/
lwkt_serialize_enter(ifp->if_serializer);
if (ifp->if_ioctl != NULL &&
- (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia,
- (struct ucred *)NULL))) {
+ (error = ifp->if_ioctl(ifp, SIOCSIFADDR, (void *)ia, NULL))) {
ia->ia_addr = oldaddr;
lwkt_serialize_exit(ifp->if_serializer);
return (error);
/*
* Output final datagram.
*/
- error = (ip_output(m, (struct mbuf *)NULL, ro, SO_BROADCAST, NULL, NULL));
+ error = (ip_output(m, NULL, ro, SO_BROADCAST, NULL, NULL));
if (error) {
ifn->ifen_ifnet.if_oerrors++;
ifn->ifen_ifnet.if_ierrors = error;
if (ipx_pcblookup(&sipx->sipx_addr, ipxp->ipxp_lport, 0))
return (EADDRINUSE);
if (ipxp->ipxp_lport == 0)
- ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+ ipx_pcbbind(ipxp, NULL, td);
/* XXX just leave it zero if we can't find a route */
m->m_data += sizeof(struct ipx);
}
if (ssb_appendaddr(&ipxp->ipxp_socket->so_rcv, (struct sockaddr *)&ipx_ipx,
- m, (struct mbuf *)NULL) == 0)
+ m, NULL) == 0)
goto bad;
sorwakeup(ipxp->ipxp_socket);
return;
*/
so = ipxp->ipxp_socket;
if (so->so_options & SO_DONTROUTE)
- return (ipx_outputfl(m, (struct route *)NULL,
+ return (ipx_outputfl(m, NULL,
(so->so_options & SO_BROADCAST) | IPX_ROUTETOIF));
/*
* Use cached route for previous datagram if
m_freem(m);
}
if (cb->s_force || (cb->s_flags & (SF_ACKNOW|SF_WIN|SF_RXT)))
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
cb->s_flags &= ~(SF_WIN|SF_RXT);
return;
cb->s_snxt = si->si_ack;
cb->s_cwnd = CUNIT;
cb->s_force = 1 + SPXT_REXMT;
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
cb->s_timer[SPXT_REXMT] = cb->s_rxtcur;
cb->s_rtt = 0;
if (cwnd >= 4 * CUNIT)
spx_trace(SA_OUTPUT, cb->s_state, cb, si, 0);
if (so->so_options & SO_DONTROUTE)
- error = ipx_outputfl(m, (struct route *)NULL, IPX_ROUTETOIF);
+ error = ipx_outputfl(m, NULL, IPX_ROUTETOIF);
else
error = ipx_outputfl(m, &cb->s_ipxpcb->ipxp_route, 0);
}
crit_enter();
if (ipxp->ipxp_lport == 0) {
- error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+ error = ipx_pcbbind(ipxp, NULL, td);
if (error)
goto spx_connect_end;
}
* cb->s_dport.
*/
ipxp->ipxp_fport = 0;
- error = spx_output(cb, (struct mbuf *)NULL);
+ error = spx_output(cb, NULL);
spx_connect_end:
crit_exit();
return (error);
cb = ipxtospxpcb(ipxp);
if (ipxp->ipxp_lport == 0)
- error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td);
+ error = ipx_pcbbind(ipxp, NULL, td);
if (error == 0)
cb->s_state = TCPS_LISTEN;
return (error);
crit_enter();
cb->s_flags |= SF_RVD;
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
cb->s_flags &= ~SF_RVD;
crit_exit();
return (0);
socantsendmore(so);
cb = spx_usrclosed(cb);
if (cb != NULL)
- error = spx_output(cb, (struct mbuf *)NULL);
+ error = spx_output(cb, NULL);
crit_exit();
return (error);
}
soisdisconnected(so);
ipx_pcbdetach(ipxp);
spxstat.spxs_closed++;
- return ((struct spxpcb *)NULL);
+ return (NULL);
}
/*
cb->s_flags &= ~SF_DELACK;
cb->s_flags |= SF_ACKNOW;
spxstat.spxs_delack++;
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
}
}
}
win = 2;
cb->s_cwnd = CUNIT;
cb->s_ssthresh = win * CUNIT;
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
break;
/*
case SPXT_PERSIST:
spxstat.spxs_persisttimeo++;
spx_setpersist(cb);
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
break;
/*
if (cb->s_idle >= SPXTV_MAXIDLE)
goto dropit;
spxstat.spxs_keepprobe++;
- spx_output(cb, (struct mbuf *)NULL);
+ spx_output(cb, NULL);
} else
cb->s_idle = 0;
cb->s_timer[SPXT_KEEP] = SPXTV_KEEP;
if (sah->sa_route.ro_rt) {
RTFREE(sah->sa_route.ro_rt);
- sah->sa_route.ro_rt = (struct rtentry *)NULL;
+ sah->sa_route.ro_rt = NULL;
}
/* remove from tree of SA index */
if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len
&& bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) {
RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)NULL;
+ ro->ro_rt = NULL;
}
}
api.rxhand = npcb;
if (ifp->if_ioctl != NULL) {
lwkt_serialize_enter(ifp->if_serializer);
- ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL);
+ ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL);
lwkt_serialize_exit(ifp->if_serializer);
}
lwkt_serialize_enter(ifp->if_serializer);
if (ifp->if_ioctl == NULL ||
ifp->if_ioctl(ifp, SIOCATMENA, (caddr_t) &api,
- (struct ucred *)NULL) != 0) {
+ NULL) != 0) {
lwkt_serialize_exit(ifp->if_serializer);
npcb_free(npcb, NPCB_REMOVE);
error = EIO;
api.rxhand = npcb;
lwkt_serialize_enter(ifp->if_serializer);
if (ifp->if_ioctl != NULL)
- ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, (struct ucred *)NULL);
+ ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api, NULL);
lwkt_serialize_exit(ifp->if_serializer);
npcb_free(npcb, NPCB_REMOVE);
ario.rawvalue = *((int *)nam);
lwkt_serialize_enter(npcb->npcb_ifp->if_serializer);
error = npcb->npcb_ifp->if_ioctl(npcb->npcb_ifp, SIOCXRAWATM,
- (caddr_t) &ario, (struct ucred *)NULL);
+ (caddr_t) &ario, NULL);
lwkt_serialize_exit(npcb->npcb_ifp->if_serializer);
if (!error) {
if (ario.rawvalue)
LIST_INIT(&natm_pcbs);
netisr_register(NETISR_NATM, cpu0_portfn, pktinfo_portfn_cpu0,
- natmintr, NETISR_FLAG_NOTMPSAFE);
+ natmintr, NETISR_FLAG_NOTMPSAFE);
}
/*
#ifdef NCPBURST
if (conn->bc_so) {
so = conn->bc_so;
- conn->bc_so = (struct socket *)NULL;
+ conn->bc_so = NULL;
soshutdown(so, SHUT_RDWR);
soclose(so, FNONBLOCK);
}
lwkt_serialize_enter(ifp->if_serializer);
error = ifp->if_ioctl(ifp, SIOCSIFDSTADDR,
(caddr_t)ia,
- (struct ucred *)NULL);
+ NULL);
lwkt_serialize_exit(ifp->if_serializer);
if (error)
return (error);
if (ifp->if_ioctl == 0)
return (EOPNOTSUPP);
lwkt_serialize_enter(ifp->if_serializer);
- error = ifp->if_ioctl(ifp, cmd, data, (struct ucred *)NULL);
+ error = ifp->if_ioctl(ifp, cmd, data, NULL);
lwkt_serialize_exit(ifp->if_serializer);
return (error);
}
if (ifp->if_ioctl &&
(error = ifp->if_ioctl(ifp, SIOCSIFADDR,
(caddr_t)ia,
- (struct ucred *)NULL))) {
+ NULL))) {
ia->ia_addr = oldaddr;
lwkt_serialize_exit(ifp->if_serializer);
crit_exit();
if (ifp->if_ioctl &&
(error = ifp->if_ioctl(ifp, SIOCSIFADDR,
(caddr_t)ia,
- (struct ucred *)NULL))) {
+ NULL))) {
ia->ia_addr = oldaddr;
lwkt_serialize_exit(ifp->if_serializer);
crit_exit();
return ENOTCONN;
if ((so = nbp->nbp_tso) != NULL) {
nbp->nbp_flags &= ~NBF_CONNECTED;
- nbp->nbp_tso = (struct socket *)NULL;
+ nbp->nbp_tso = NULL;
soshutdown(so, SHUT_RDWR);
soclose(so, FNONBLOCK);
}
(((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \
_ALIGN(sizeof(struct cmsghdr)) > \
(caddr_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
+ NULL : \
(struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len)))
/*
#define CMSG_FIRSTHDR(mhdr) \
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
(struct cmsghdr *)(mhdr)->msg_control : \
- (struct cmsghdr *)NULL)
+ NULL)
/* RFC 2292 additions */
void
ntfs_toupper_init(void)
{
- ntfs_toupper_tab = (wchar *) NULL;
+ ntfs_toupper_tab = NULL;
lockinit(&ntfs_toupper_lock, "ntfs_toupper", 0, 0);
ntfs_toupper_usecount = 0;
}
err(1, "vfork");
case 0: /* child */
(void)sigsetmask(omask);
- execl(use_shell, use_name, "-c", command, (char *)NULL);
+ execl(use_shell, use_name, "-c", command, NULL);
warn("%s", use_shell);
_exit(1);
}
mailname = pass_entry->pw_name;
}
- if (atinput != (char *) NULL)
+ if (atinput != NULL)
{
fpin = freopen(atinput, "r", stdin);
if (fpin == NULL)
dup(p[0]);
close(p[0]);
close(p[1]);
- execl(_PATH_DC, "dc", "-x", (char *)NULL);
+ execl(_PATH_DC, "dc", "-x", NULL);
err(1, "cannot find dc");
}
}
}
execl(_PATH_CPP, "cpp", "-P",
"-traditional", "-nostdinc", /* GCC specific opts */
- "-I.", "-I", _PATH_INCLUDE, (char *)NULL);
+ "-I.", "-I", _PATH_INCLUDE, NULL);
warn(_PATH_CPP);
_exit(EXIT_FAILURE);
}
_exit(EXIT_FAILURE);
}
execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F",
- "\"Reminder Service\"", (char *)NULL);
+ "\"Reminder Service\"", NULL);
warn(_PATH_SENDMAIL);
_exit(EXIT_FAILURE);
}
void terminate(int status)
{
echo_stderr(-1);
- if (report_file != NULL && report_fp != (FILE *) NULL) {
+ if (report_file != NULL && report_fp != NULL) {
/*
* Allow the last of the report string to be gathered before we terminate.
*/
if (verbose)
fprintf (report_fp, "Closing \"%s\".\n", report_file);
fclose (report_fp);
- report_fp = (FILE *) NULL;
+ report_fp = NULL;
}
#if defined(get_term_param)
if (!report_gathering) {
for (n = 0; n < n_reports; ++n) {
- if ((report_string[n] != (char*) NULL) &&
+ if ((report_string[n] != NULL) &&
s - temp >= (report_len = strlen(report_string[n])) &&
strncmp(s - report_len, report_string[n], report_len) == 0) {
- time_t time_now = time ((time_t*) NULL);
+ time_t time_now = time (NULL);
struct tm* tm_now = localtime (&time_now);
strftime (report_buffer, 20, "%b %d %H:%M:%S ", tm_now);
strcat (report_buffer, report_string[n]);
- report_string[n] = (char *) NULL;
+ report_string[n] = NULL;
report_gathering = 1;
break;
}
/* protect p_shell -- it thinks NULL is /bin/sh */
if (!arg[0])
usage();
- if (p_shell(arg, pw, (ENTRY *)NULL) == -1)
+ if (p_shell(arg, pw, NULL) == -1)
exit(1);
}
if (op == NEWEXP) {
if (uid) /* only root can change expire */
baduser();
- if (p_expire(arg, pw, (ENTRY *)NULL) == -1)
+ if (p_expire(arg, pw, NULL) == -1)
exit(1);
}
}
}
}
- if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t))
+ if (!(t = strtok(NULL, " \t,")) || !isdigit(*t))
goto bad;
day = atoi(t);
- if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t))
+ if (!(t = strtok(NULL, " \t,")) || !isdigit(*t))
goto bad;
year = atoi(t);
if (day < 1 || day > 31 || month < 1 || month > 12)
need = l->l_lsize ? l->l_lsize * 2 : 90;
if ((l->l_line = realloc(l->l_line,
(unsigned)need * sizeof(CHAR))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
l->l_lsize = need;
}
c = &l->l_line[l->l_line_len++];
sorted_size = l->l_lsize;
if ((sorted = realloc(sorted,
(unsigned)sizeof(CHAR) * sorted_size)) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
}
if (l->l_max_col >= count_size) {
count_size = l->l_max_col + 1;
if ((count = realloc(count,
(unsigned)sizeof(int) * count_size)) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
}
memset(count, 0, sizeof(int) * l->l_max_col + 1);
for (i = nchars, c = l->l_line; --i >= 0; c++)
if (!line_freelist) {
if ((l = realloc(NULL, sizeof(LINE) * NALLOC)) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
line_freelist = l;
for (i = 1; i < NALLOC; i++, l++)
l->l_next = l + 1;
char **cols;
if ((t = tbl = calloc(entries, sizeof(TBL))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
if ((cols = calloc((maxcols = DEFCOLS), sizeof(char *))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
if ((lens = calloc(maxcols, sizeof(int))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator));
p = NULL)
maxcols += DEFCOLS;
}
if ((t->list = calloc(coloff, sizeof(char *))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
if ((t->len = calloc(coloff, sizeof(int))) == NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
for (t->cols = coloff; --coloff >= 0;) {
t->list[coloff] = cols[coloff];
t->len[coloff] = strlen(cols[coloff]);
if (!list)
if ((list = calloc((maxentry = DEFNUM), sizeof(char *))) ==
NULL)
- err(1, (char *)NULL);
+ err(1, NULL);
while (fgets(buf, MAXLINELEN, fp)) {
for (p = buf; *p && isspace(*p); ++p);
if (!*p)
(void)printf("Enter date, or blank line to exit.\n\t> ");
(void)fflush(stdout);
while (gets(buff) && buff[0]) {
- d = get_date(buff, (struct timeb *)NULL);
+ d = get_date(buff, NULL);
if (d == -1)
(void)printf("Bad format - couldn't convert.\n");
else
* size is calculated.
*/
hdrsize = 0;
- elf_puthdr(map, NULL, &hdrsize,
- (const prstatus_t *)NULL, (const prfpregset_t *)NULL,
- (const prpsinfo_t *)NULL, seginfo.count);
+ elf_puthdr(map, NULL, &hdrsize, NULL, NULL, NULL, seginfo.count);
/*
* Allocate memory for building the header, fill it up,
if (valid > 0 && alt_path != NULL) {
if (argv[optind + 1] == NULL)
execl(alt_path, "getconf", argv[optind],
- (char *)NULL);
+ NULL);