Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/hack Fix up still more casts; use NULL instead of (cha...
details: https://anonhg.NetBSD.org/src/rev/e7d7807c7bec
branches: trunk
changeset: 768037:e7d7807c7bec
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Aug 06 20:42:43 2011 +0000
description:
Fix up still more casts; use NULL instead of (char *)0.
diffstat:
games/hack/hack.apply.c | 8 ++++----
games/hack/hack.cmd.c | 6 +++---
games/hack/hack.eat.c | 6 +++---
games/hack/hack.end.c | 6 +++---
games/hack/hack.engrave.c | 6 +++---
games/hack/hack.invent.c | 18 +++++++++---------
games/hack/hack.ioctl.c | 6 +++---
games/hack/hack.main.c | 6 +++---
games/hack/hack.mklev.c | 6 +++---
games/hack/hack.o_init.c | 8 ++++----
games/hack/hack.pager.c | 12 ++++++------
games/hack/hack.save.c | 6 +++---
games/hack/hack.tty.c | 6 +++---
games/hack/hack.unix.c | 10 +++++-----
14 files changed, 55 insertions(+), 55 deletions(-)
diffs (truncated from 477 to 300 lines):
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.apply.c
--- a/games/hack/hack.apply.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.apply.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
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 @@
&& !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) {
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.cmd.c
--- a/games/hack/hack.cmd.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.cmd.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 ext_func_tab extcmdlist[] = {
{ "dip", dodip },
{ "pray", dopray },
- { (char *) 0, donull }
+ { NULL, donull }
};
static char lowc(int);
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.eat.c
--- a/games/hack/hack.eat.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.eat.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
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.");
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.end.c
--- a/games/hack/hack.end.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.end.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
}
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);
{
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.engrave.c
--- a/games/hack/hack.engrave.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.engrave.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
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)
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.invent.c
--- a/games/hack/hack.invent.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.invent.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
}
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);
}
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.ioctl.c
--- a/games/hack/hack.ioctl.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.ioctl.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
{
#ifdef SIGTSTP
if (signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
- settty((char *) 0);
+ settty(NULL);
(void) signal(SIGTSTP, SIG_DFL);
(void) kill(0, SIGTSTP);
gettty();
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.main.c
--- a/games/hack/hack.main.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.main.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
#ifdef MAIL
ckmailstatus();
#endif
- rhack((char *) 0);
+ rhack(NULL);
}
if (multi && multi % 7 == 0)
(void) fflush(stdout);
diff -r 4a43cec823da -r e7d7807c7bec games/hack/hack.mklev.c
--- a/games/hack/hack.mklev.c Sat Aug 06 20:32:25 2011 +0000
+++ b/games/hack/hack.mklev.c Sat Aug 06 20:42:43 2011 +0000
@@ -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 @@
}
}
- qsort((char *) rooms, nroom, sizeof(struct mkroom), comp);
+ qsort(rooms, nroom, sizeof(rooms[0]), comp);
makecorridors();
make_niches();
Home |
Main Index |
Thread Index |
Old Index