Remove more silly casts.

This commit is contained in:
dholland 2011-08-06 20:29:37 +00:00
parent 5aa2a843dc
commit 8e73b3ad76
13 changed files with 48 additions and 48 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.do.c,v 1.10 2011/07/20 07:04:30 dholland Exp $ */
/* $NetBSD: hack.do.c,v 1.11 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.do.c,v 1.10 2011/07/20 07:04:30 dholland Exp $");
__RCSID("$NetBSD: hack.do.c,v 1.11 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
/* Contains code for 'd', 'D' (drop), '>', '<' (up, down) and 't' (throw) */
@ -101,7 +101,7 @@ drop(struct obj *obj)
if (Invisible)
newsym(u.ux, u.uy);
}
free((char *) obj);
free(obj);
return (1);
}
if (obj->owornmask & (W_ARMOR | W_RING)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/* $NetBSD: hack.do_name.c,v 1.12 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
__RCSID("$NetBSD: hack.do_name.c,v 1.12 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -211,7 +211,7 @@ do_oname(struct obj *obj)
#if 0
obfree(obj, otmp2); /* now unnecessary: no pointers on bill */
#endif
free((char *) obj); /* let us hope nobody else saved a pointer */
free(obj); /* let us hope nobody else saved a pointer */
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.end.c,v 1.15 2011/08/06 20:18:26 dholland Exp $ */
/* $NetBSD: hack.end.c,v 1.16 2011/08/06 20:29:37 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.15 2011/08/06 20:18:26 dholland Exp $");
__RCSID("$NetBSD: hack.end.c,v 1.16 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@ -804,7 +804,7 @@ prscore(int argc, char **argv)
break;
}
}
free((char *) t1);
free(t1);
}
#ifdef nonsense
totchars[totcharct] = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.engrave.c,v 1.11 2011/08/06 20:18:26 dholland Exp $ */
/* $NetBSD: hack.engrave.c,v 1.12 2011/08/06 20:29:37 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.11 2011/08/06 20:18:26 dholland Exp $");
__RCSID("$NetBSD: hack.engrave.c,v 1.12 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -392,5 +392,5 @@ del_engr(struct engr *ep)
return;
fnd: ;
}
free((char *) ep);
free(ep);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.invent.c,v 1.15 2011/05/23 22:53:25 joerg Exp $ */
/* $NetBSD: hack.invent.c,v 1.16 2011/08/06 20:29:37 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.15 2011/05/23 22:53:25 joerg Exp $");
__RCSID("$NetBSD: hack.invent.c,v 1.16 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <assert.h>
@ -237,7 +237,7 @@ freegold(struct gold *gold)
}
gtmp->ngold = gold->ngold;
}
free((char *) gold);
free(gold);
}
void
@ -251,7 +251,7 @@ deltrap(struct trap *trap)
for (ttmp = ftrap; ttmp->ntrap != trap; ttmp = ttmp->ntrap);
ttmp->ntrap = trap->ntrap;
}
free((char *) trap);
free(trap);
}
struct wseg *m_atseg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.lev.c,v 1.12 2011/08/06 20:00:33 dholland Exp $ */
/* $NetBSD: hack.lev.c,v 1.13 2011/08/06 20:29:37 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.12 2011/08/06 20:00:33 dholland Exp $");
__RCSID("$NetBSD: hack.lev.c,v 1.13 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -150,7 +150,7 @@ saveobjchn(int fd, struct obj *otmp)
xl = otmp->onamelth;
bwrite(fd, (char *) &xl, sizeof(int));
bwrite(fd, (char *) otmp, xl + sizeof(struct obj));
free((char *) otmp);
free(otmp);
otmp = otmp2;
}
bwrite(fd, (char *) &minusone, sizeof(int));
@ -173,7 +173,7 @@ savemonchn(int fd, struct monst *mtmp)
bwrite(fd, (char *) mtmp, xl + sizeof(struct monst));
if (mtmp->minvent)
saveobjchn(fd, mtmp->minvent);
free((char *) mtmp);
free(mtmp);
mtmp = mtmp2;
}
bwrite(fd, (char *) &minusone, sizeof(int));
@ -186,7 +186,7 @@ savegoldchn(int fd, struct gold *gold)
while (gold) {
gold2 = gold->ngold;
bwrite(fd, (char *) gold, sizeof(struct gold));
free((char *) gold);
free(gold);
gold = gold2;
}
bwrite(fd, nul, sizeof(struct gold));
@ -199,7 +199,7 @@ savetrapchn(int fd, struct trap *trap)
while (trap) {
trap2 = trap->ntrap;
bwrite(fd, (char *) trap, sizeof(struct trap));
free((char *) trap);
free(trap);
trap = trap2;
}
bwrite(fd, nul, sizeof(struct trap));
@ -273,7 +273,7 @@ getlev(int fd, int pid, xchar lev)
gold = newgold();
mread(fd, gold, sizeof(struct gold));
}
free((char *) gold);
free(gold);
trap = newtrap();
mread(fd, trap, sizeof(struct trap));
while (trap->tx) {
@ -282,7 +282,7 @@ getlev(int fd, int pid, xchar lev)
trap = newtrap();
mread(fd, trap, sizeof(struct trap));
}
free((char *) trap);
free(trap);
fobj = restobjchn(fd);
billobjs = restobjchn(fd);
rest_engravings(fd);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.mon.c,v 1.12 2011/08/06 20:24:35 dholland Exp $ */
/* $NetBSD: hack.mon.c,v 1.13 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.mon.c,v 1.12 2011/08/06 20:24:35 dholland Exp $");
__RCSID("$NetBSD: hack.mon.c,v 1.13 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -765,7 +765,7 @@ dmonsfree(void)
struct monst *mtmp;
while ((mtmp = fdmon) != NULL) {
fdmon = mtmp->nmon;
free((char *) mtmp);
free(mtmp);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.pager.c,v 1.17 2011/08/06 20:18:26 dholland Exp $ */
/* $NetBSD: hack.pager.c,v 1.18 2011/08/06 20:29:37 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.17 2011/08/06 20:18:26 dholland Exp $");
__RCSID("$NetBSD: hack.pager.c,v 1.18 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
/* This file contains the command routine dowhatis() and a pager. */
@ -348,7 +348,7 @@ cornline(int mode, const char *text)
cleanup:
while ((tl = texthead) != NULL) {
texthead = tl->next_line;
free((char *) tl);
free(tl);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/* $NetBSD: hack.read.c,v 1.11 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
__RCSID("$NetBSD: hack.read.c,v 1.11 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -203,7 +203,7 @@ doread(void)
Punished = 0;
freeobj(uchain);
unpobj(uchain);
free((char *) uchain);
free(uchain);
uball->spe = 0;
uball->owornmask &= ~W_BALL;
uchain = uball = (struct obj *) 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $ */
/* $NetBSD: hack.shk.c,v 1.12 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $");
__RCSID("$NetBSD: hack.shk.c,v 1.12 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -89,7 +89,7 @@ struct obj *billobjs = 0;
void
obfree(struct obj *obj, struct obj *merge)
{
free((char *) obj);
free(obj);
}
int
inshop(void) {
@ -237,7 +237,7 @@ setpaid(void)
obj->unpaid = 0;
while ((obj = billobjs) != NULL) {
billobjs = obj->nobj;
free((char *) obj);
free(obj);
}
ESHK(shopkeeper)->billct = 0;
}
@ -419,7 +419,7 @@ obfree(struct obj *obj, struct obj *merge)
*bp = bill[ESHK(shopkeeper)->billct];
}
}
free((char *) obj);
free(obj);
}
static void
@ -603,7 +603,7 @@ dopayobj(struct bill_x *bp)
else
pline("Error in shopkeeper administration.");
}
free((char *) obj);
free(obj);
}
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/* $NetBSD: hack.steal.c,v 1.8 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
__RCSID("$NetBSD: hack.steal.c,v 1.8 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -216,7 +216,7 @@ steal(struct monst *mtmp)
if (Punished && otmp == uball) {
Punished = 0;
freeobj(uchain);
free((char *) uchain);
free(uchain);
uchain = (struct obj *) 0;
uball->spe = 0;
uball = (struct obj *) 0; /* superfluous */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.topl.c,v 1.13 2011/08/06 20:18:26 dholland Exp $ */
/* $NetBSD: hack.topl.c,v 1.14 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.topl.c,v 1.13 2011/08/06 20:18:26 dholland Exp $");
__RCSID("$NetBSD: hack.topl.c,v 1.14 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -133,7 +133,7 @@ remember_topl(void)
tl = tl->next_topl;
}
if (tl && tl->next_topl) {
free((char *) tl->next_topl);
free(tl->next_topl);
tl->next_topl = 0;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/* $NetBSD: hack.worm.c,v 1.9 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
__RCSID("$NetBSD: hack.worm.c,v 1.9 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -279,6 +279,6 @@ remseg(struct wseg *wtmp)
{
if (wtmp->wdispl)
newsym(wtmp->wx, wtmp->wy);
free((char *) wtmp);
free(wtmp);
}
#endif /* NOWORM */