Fix up still more casts; use NULL instead of (char *)0.
This commit is contained in:
parent
8041af98f6
commit
2c0ecb1ab6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.apply.c,v 1.11 2011/05/23 22:53:25 joerg Exp $ */
|
||||
/* $NetBSD: hack.apply.c,v 1.12 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.apply.c,v 1.11 2011/05/23 22:53:25 joerg Exp $");
|
||||
__RCSID("$NetBSD: hack.apply.c,v 1.12 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "hack.h"
|
||||
|
@ -255,7 +255,7 @@ use_ice_box(struct obj *obj)
|
|||
else {
|
||||
pline("Do you want to take something out of the ice-box? [yn] ");
|
||||
if (readchar() == 'y')
|
||||
if (askchain(fcobj, (char *) 0, 0, out_ice_box, ck_ice_box, 0))
|
||||
if (askchain(fcobj, NULL, 0, out_ice_box, ck_ice_box, 0))
|
||||
return;
|
||||
pline("That was all. Do you wish to put something in? [yn] ");
|
||||
if (readchar() != 'y')
|
||||
|
@ -490,7 +490,7 @@ use_pick_axe(struct obj *obj)
|
|||
&& !sobj_at(ENORMOUS_ROCK, rx, ry)) {
|
||||
/* ACCESSIBLE or POOL */
|
||||
pline("You swing your %s through thin air.",
|
||||
aobjnam(obj, (char *) 0));
|
||||
aobjnam(obj, NULL));
|
||||
} else {
|
||||
if (dig_pos.x != rx || dig_pos.y != ry
|
||||
|| dig_level != dlevel || dig_down) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.cmd.c,v 1.11 2010/02/03 15:34:38 roy Exp $ */
|
||||
/* $NetBSD: hack.cmd.c,v 1.12 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.cmd.c,v 1.11 2010/02/03 15:34:38 roy Exp $");
|
||||
__RCSID("$NetBSD: hack.cmd.c,v 1.12 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "hack.h"
|
||||
|
@ -139,7 +139,7 @@ static const struct func_tab cmdlist[] = {
|
|||
static const struct ext_func_tab extcmdlist[] = {
|
||||
{ "dip", dodip },
|
||||
{ "pray", dopray },
|
||||
{ (char *) 0, donull }
|
||||
{ NULL, donull }
|
||||
};
|
||||
|
||||
static char lowc(int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.eat.c,v 1.10 2011/05/23 22:53:25 joerg Exp $ */
|
||||
/* $NetBSD: hack.eat.c,v 1.11 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.eat.c,v 1.10 2011/05/23 22:53:25 joerg Exp $");
|
||||
__RCSID("$NetBSD: hack.eat.c,v 1.11 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "hack.h"
|
||||
|
@ -212,7 +212,7 @@ gotit:
|
|||
goto no_opener;
|
||||
}
|
||||
pline("Using your %s you try to open the tin.",
|
||||
aobjnam(uwep, (char *) 0));
|
||||
aobjnam(uwep, NULL));
|
||||
} else {
|
||||
no_opener:
|
||||
pline("It is not so easy to open this tin.");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.end.c,v 1.16 2011/08/06 20:29:37 dholland Exp $ */
|
||||
/* $NetBSD: hack.end.c,v 1.17 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.end.c,v 1.16 2011/08/06 20:29:37 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.end.c,v 1.17 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -206,7 +206,7 @@ done(const char *st1)
|
|||
}
|
||||
if (*st1 == 'c')
|
||||
killer = st1; /* after outrip() */
|
||||
settty((char *) 0); /* does a clear_screen() */
|
||||
settty(NULL); /* does a clear_screen() */
|
||||
if (!done_stopprint)
|
||||
printf("Goodbye %s %s...\n\n", pl_character, plname);
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.engrave.c,v 1.12 2011/08/06 20:29:37 dholland Exp $ */
|
||||
/* $NetBSD: hack.engrave.c,v 1.13 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.engrave.c,v 1.12 2011/08/06 20:29:37 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.engrave.c,v 1.13 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -230,7 +230,7 @@ doengrave(void)
|
|||
if (uwep && uwep->cursed) {
|
||||
/* Andreas Bormann */
|
||||
pline("Since your weapon is welded to your hand,");
|
||||
pline("you use the %s.", aobjnam(uwep, (char *) 0));
|
||||
pline("you use the %s.", aobjnam(uwep, NULL));
|
||||
otmp = uwep;
|
||||
} else {
|
||||
if (!otmp)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.invent.c,v 1.16 2011/08/06 20:29:37 dholland Exp $ */
|
||||
/* $NetBSD: hack.invent.c,v 1.17 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.invent.c,v 1.16 2011/08/06 20:29:37 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.invent.c,v 1.17 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -80,7 +80,7 @@ __RCSID("$NetBSD: hack.invent.c,v 1.16 2011/08/06 20:29:37 dholland Exp $");
|
|||
static int lastinvnr = 51; /* 0 ... 51 */
|
||||
|
||||
static char *xprname(struct obj *, char);
|
||||
static void doinv(char *);
|
||||
static void doinv(const char *);
|
||||
static int merged(struct obj *, struct obj *, int);
|
||||
|
||||
static void
|
||||
|
@ -499,7 +499,7 @@ getobj(const char *let, const char *word)
|
|||
continue;
|
||||
/* he typed a letter (not a space) to more() */
|
||||
} else if (ilet == '*') {
|
||||
doinv((char *) 0);
|
||||
doinv(NULL);
|
||||
if (!(ilet = morc))
|
||||
continue;
|
||||
/* ... */
|
||||
|
@ -716,14 +716,14 @@ xprname(struct obj *obj, char let)
|
|||
int
|
||||
ddoinv(void)
|
||||
{
|
||||
doinv((char *) 0);
|
||||
doinv(NULL);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* called with 0 or "": all objects in inventory */
|
||||
/* otherwise: all objects with (serial) letter in lets */
|
||||
static void
|
||||
doinv(char *lets)
|
||||
doinv(const char *lets)
|
||||
{
|
||||
struct obj *otmp;
|
||||
char ilet;
|
||||
|
@ -736,7 +736,7 @@ doinv(char *lets)
|
|||
pline("Not carrying anything.");
|
||||
return;
|
||||
}
|
||||
cornline(0, (char *) 0);
|
||||
cornline(0, NULL);
|
||||
ilet = 'a';
|
||||
for (otmp = invent; otmp; otmp = otmp->nobj) {
|
||||
if (flags.invlet_constant)
|
||||
|
@ -883,10 +883,10 @@ dolook(void)
|
|||
}
|
||||
if (ct == 1 && !gold) {
|
||||
pline("You %s here %s.", verb, doname(otmp0));
|
||||
cornline(3, (char *) 0);
|
||||
cornline(3, NULL);
|
||||
}
|
||||
if (ct > 1)
|
||||
cornline(2, (char *) 0);
|
||||
cornline(2, NULL);
|
||||
return (!!Blind);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
|
||||
/* $NetBSD: hack.ioctl.c,v 1.10 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.ioctl.c,v 1.10 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -95,7 +95,7 @@ dosuspend(void)
|
|||
{
|
||||
#ifdef SIGTSTP
|
||||
if (signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
|
||||
settty((char *) 0);
|
||||
settty(NULL);
|
||||
(void) signal(SIGTSTP, SIG_DFL);
|
||||
(void) kill(0, SIGTSTP);
|
||||
gettty();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.main.c,v 1.16 2011/05/23 22:53:25 joerg Exp $ */
|
||||
/* $NetBSD: hack.main.c,v 1.17 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.main.c,v 1.16 2011/05/23 22:53:25 joerg Exp $");
|
||||
__RCSID("$NetBSD: hack.main.c,v 1.17 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -471,7 +471,7 @@ not_recovered:
|
|||
#ifdef MAIL
|
||||
ckmailstatus();
|
||||
#endif
|
||||
rhack((char *) 0);
|
||||
rhack(NULL);
|
||||
}
|
||||
if (multi && multi % 7 == 0)
|
||||
(void) fflush(stdout);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
|
||||
/* $NetBSD: hack.mklev.c,v 1.9 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.mklev.c,v 1.9 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
|
@ -188,7 +188,7 @@ makelevel(void)
|
|||
}
|
||||
}
|
||||
|
||||
qsort((char *) rooms, nroom, sizeof(struct mkroom), comp);
|
||||
qsort(rooms, nroom, sizeof(rooms[0]), comp);
|
||||
makecorridors();
|
||||
make_niches();
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.o_init.c,v 1.13 2011/08/06 20:32:25 dholland Exp $ */
|
||||
/* $NetBSD: hack.o_init.c,v 1.14 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.o_init.c,v 1.13 2011/08/06 20:32:25 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.o_init.c,v 1.14 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <string.h>
|
||||
|
@ -228,9 +228,9 @@ dodiscovered(void)
|
|||
}
|
||||
if (ct == 0) {
|
||||
pline("You haven't discovered anything yet...");
|
||||
cornline(3, (char *) 0);
|
||||
cornline(3, NULL);
|
||||
} else
|
||||
cornline(2, (char *) 0);
|
||||
cornline(2, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.pager.c,v 1.18 2011/08/06 20:29:37 dholland Exp $ */
|
||||
/* $NetBSD: hack.pager.c,v 1.19 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.pager.c,v 1.18 2011/08/06 20:29:37 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.pager.c,v 1.19 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/* This file contains the command routine dowhatis() and a pager. */
|
||||
|
@ -392,7 +392,7 @@ page_file(const char *fnam, boolean silent)
|
|||
if (!silent)
|
||||
printf("Cannot open %s as stdin.\n", fnam);
|
||||
} else {
|
||||
execl(catmore, "page", (char *) 0);
|
||||
execl(catmore, "page", (char *)NULL);
|
||||
if (!silent)
|
||||
printf("Cannot exec %s.\n", catmore);
|
||||
}
|
||||
|
@ -428,9 +428,9 @@ dosh(void)
|
|||
char *str;
|
||||
if (child(0)) {
|
||||
if ((str = getenv("SHELL")) != NULL)
|
||||
execl(str, str, (char *) 0);
|
||||
execl(str, str, (char *)NULL);
|
||||
else
|
||||
execl("/bin/sh", "sh", (char *) 0);
|
||||
execl("/bin/sh", "sh", (char *)NULL);
|
||||
pline("sh: cannot execute.");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ child(int wt)
|
|||
|
||||
f = fork();
|
||||
if (f == 0) { /* child */
|
||||
settty((char *) 0); /* also calls end_screen() */
|
||||
settty(NULL); /* also calls end_screen() */
|
||||
(void) setuid(getuid());
|
||||
(void) setgid(getgid());
|
||||
#ifdef CHDIR
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.save.c,v 1.15 2011/08/06 20:00:33 dholland Exp $ */
|
||||
/* $NetBSD: hack.save.c,v 1.16 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.save.c,v 1.15 2011/08/06 20:00:33 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.save.c,v 1.16 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -192,7 +192,7 @@ dorecover(int fd)
|
|||
mread(fd, fut_geno, sizeof fut_geno);
|
||||
restnames(fd);
|
||||
while (1) {
|
||||
if (read(fd, (char *) &tmp, sizeof tmp) != sizeof tmp)
|
||||
if (read(fd, &tmp, sizeof tmp) != sizeof tmp)
|
||||
break;
|
||||
getlev(fd, 0, tmp);
|
||||
glo(tmp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.tty.c,v 1.15 2010/02/03 15:34:39 roy Exp $ */
|
||||
/* $NetBSD: hack.tty.c,v 1.16 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: hack.tty.c,v 1.15 2010/02/03 15:34:39 roy Exp $");
|
||||
__RCSID("$NetBSD: hack.tty.c,v 1.16 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -206,7 +206,7 @@ error(const char *fmt, ...)
|
|||
|
||||
va_start(ap, fmt);
|
||||
if (settty_needed)
|
||||
settty((char *) 0);
|
||||
settty(NULL);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
putchar('\n');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $ */
|
||||
/* $NetBSD: hack.unix.c,v 1.15 2011/08/06 20:42:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $");
|
||||
__RCSID("$NetBSD: hack.unix.c,v 1.15 2011/08/06 20:42:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/* This file collects some Unix dependencies; hack.pager.c contains some more */
|
||||
|
@ -242,7 +242,7 @@ veryold(int fd)
|
|||
int lockedpid; /* should be the same size as
|
||||
* hackpid */
|
||||
|
||||
if (read(fd, (char *) &lockedpid, sizeof(lockedpid)) !=
|
||||
if (read(fd, &lockedpid, sizeof(lockedpid)) !=
|
||||
sizeof(lockedpid))
|
||||
/* strange ... */
|
||||
return (0);
|
||||
|
@ -327,7 +327,7 @@ gotlock:
|
|||
if (fd == -1) {
|
||||
error("cannot creat lock file.");
|
||||
} else {
|
||||
if (write(fd, (char *) &hackpid, sizeof(hackpid))
|
||||
if (write(fd, &hackpid, sizeof(hackpid))
|
||||
!= sizeof(hackpid)) {
|
||||
error("cannot write lock");
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ readmail(void)
|
|||
if (!(mr = getenv("MAILREADER")))
|
||||
mr = DEF_MAILREADER;
|
||||
if (child(1)) {
|
||||
execl(mr, mr, (char *) 0);
|
||||
execl(mr, mr, (char *)NULL);
|
||||
exit(1);
|
||||
}
|
||||
#else /* DEF_MAILREADER */
|
||||
|
|
Loading…
Reference in New Issue