Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/hack Remove *another* set of useless casts. sheesh
details: https://anonhg.NetBSD.org/src/rev/4a43cec823da
branches: trunk
changeset: 768036:4a43cec823da
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Aug 06 20:32:25 2011 +0000
description:
Remove *another* set of useless casts. sheesh
diffstat:
games/hack/hack.lev.c | 46 +++++++++++++++++++++++-----------------------
games/hack/hack.o_init.c | 10 +++++-----
2 files changed, 28 insertions(+), 28 deletions(-)
diffs (160 lines):
diff -r dea3cc5121aa -r 4a43cec823da games/hack/hack.lev.c
--- a/games/hack/hack.lev.c Sat Aug 06 20:29:37 2011 +0000
+++ b/games/hack/hack.lev.c Sat Aug 06 20:32:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.lev.c,v 1.13 2011/08/06 20:29:37 dholland Exp $ */
+/* $NetBSD: hack.lev.c,v 1.14 2011/08/06 20:32:25 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.lev.c,v 1.13 2011/08/06 20:29:37 dholland Exp $");
+__RCSID("$NetBSD: hack.lev.c,v 1.14 2011/08/06 20:32:25 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -94,14 +94,14 @@
if (lev >= 0 && lev <= MAXLEVEL)
level_exists[lev] = TRUE;
- bwrite(fd, (char *) &hackpid, sizeof(hackpid));
- bwrite(fd, (char *) &lev, sizeof(lev));
- bwrite(fd, (char *) levl, sizeof(levl));
- bwrite(fd, (char *) &moves, sizeof(long));
- bwrite(fd, (char *) &xupstair, sizeof(xupstair));
- bwrite(fd, (char *) &yupstair, sizeof(yupstair));
- bwrite(fd, (char *) &xdnstair, sizeof(xdnstair));
- bwrite(fd, (char *) &ydnstair, sizeof(ydnstair));
+ bwrite(fd, &hackpid, sizeof(hackpid));
+ bwrite(fd, &lev, sizeof(lev));
+ bwrite(fd, levl, sizeof(levl));
+ bwrite(fd, &moves, sizeof(long));
+ bwrite(fd, &xupstair, sizeof(xupstair));
+ bwrite(fd, &yupstair, sizeof(yupstair));
+ bwrite(fd, &xdnstair, sizeof(xdnstair));
+ bwrite(fd, &ydnstair, sizeof(ydnstair));
savemonchn(fd, fmon);
savegoldchn(fd, fgold);
savetrapchn(fd, ftrap);
@@ -110,23 +110,23 @@
billobjs = 0;
save_engravings(fd);
#ifndef QUEST
- bwrite(fd, (char *) rooms, sizeof(rooms));
- bwrite(fd, (char *) doors, sizeof(doors));
+ bwrite(fd, rooms, sizeof(rooms));
+ bwrite(fd, doors, sizeof(doors));
#endif /* QUEST */
fgold = 0;
ftrap = 0;
fmon = 0;
fobj = 0;
#ifndef NOWORM
- bwrite(fd, (char *) wsegs, sizeof(wsegs));
+ bwrite(fd, wsegs, sizeof(wsegs));
for (tmp = 1; tmp < 32; tmp++) {
for (wtmp = wsegs[tmp]; wtmp; wtmp = wtmp2) {
wtmp2 = wtmp->nseg;
- bwrite(fd, (char *) wtmp, sizeof(struct wseg));
+ bwrite(fd, wtmp, sizeof(struct wseg));
}
wsegs[tmp] = 0;
}
- bwrite(fd, (char *) wgrowtime, sizeof(wgrowtime));
+ bwrite(fd, wgrowtime, sizeof(wgrowtime));
#endif /* NOWORM */
}
@@ -148,12 +148,12 @@
while (otmp) {
otmp2 = otmp->nobj;
xl = otmp->onamelth;
- bwrite(fd, (char *) &xl, sizeof(int));
- bwrite(fd, (char *) otmp, xl + sizeof(struct obj));
+ bwrite(fd, &xl, sizeof(int));
+ bwrite(fd, otmp, xl + sizeof(struct obj));
free(otmp);
otmp = otmp2;
}
- bwrite(fd, (char *) &minusone, sizeof(int));
+ bwrite(fd, &minusone, sizeof(int));
}
void
@@ -169,14 +169,14 @@
while (mtmp) {
mtmp2 = mtmp->nmon;
xl = mtmp->mxlth + mtmp->mnamelth;
- bwrite(fd, (char *) &xl, sizeof(int));
- bwrite(fd, (char *) mtmp, xl + sizeof(struct monst));
+ bwrite(fd, &xl, sizeof(int));
+ bwrite(fd, mtmp, xl + sizeof(struct monst));
if (mtmp->minvent)
saveobjchn(fd, mtmp->minvent);
free(mtmp);
mtmp = mtmp2;
}
- bwrite(fd, (char *) &minusone, sizeof(int));
+ bwrite(fd, &minusone, sizeof(int));
}
static void
@@ -185,7 +185,7 @@
struct gold *gold2;
while (gold) {
gold2 = gold->ngold;
- bwrite(fd, (char *) gold, sizeof(struct gold));
+ bwrite(fd, gold, sizeof(struct gold));
free(gold);
gold = gold2;
}
@@ -198,7 +198,7 @@
struct trap *trap2;
while (trap) {
trap2 = trap->ntrap;
- bwrite(fd, (char *) trap, sizeof(struct trap));
+ bwrite(fd, trap, sizeof(struct trap));
free(trap);
trap = trap2;
}
diff -r dea3cc5121aa -r 4a43cec823da games/hack/hack.o_init.c
--- a/games/hack/hack.o_init.c Sat Aug 06 20:29:37 2011 +0000
+++ b/games/hack/hack.o_init.c Sat Aug 06 20:32:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.o_init.c,v 1.12 2011/08/06 20:18:26 dholland Exp $ */
+/* $NetBSD: hack.o_init.c,v 1.13 2011/08/06 20:32:25 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.12 2011/08/06 20:18:26 dholland Exp $");
+__RCSID("$NetBSD: hack.o_init.c,v 1.13 2011/08/06 20:32:25 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -181,8 +181,8 @@
{
int i;
size_t len;
- bwrite(fd, (char *) bases, sizeof bases);
- bwrite(fd, (char *) objects, sizeof objects);
+ bwrite(fd, bases, sizeof bases);
+ bwrite(fd, objects, sizeof objects);
/*
* as long as we use only one version of Hack/Quest we need not save
* oc_name and oc_descr, but we must save oc_uname for all objects
@@ -190,7 +190,7 @@
for (i = 0; i < SIZE(objects); i++) {
if (objects[i].oc_uname) {
len = strlen(objects[i].oc_uname) + 1;
- bwrite(fd, (char *) &len, sizeof len);
+ bwrite(fd, &len, sizeof len);
bwrite(fd, objects[i].oc_uname, len);
}
}
Home |
Main Index |
Thread Index |
Old Index