Module Name: src Committed By: dholland Date: Sat Aug 6 20:29:37 UTC 2011
Modified Files: src/games/hack: hack.do.c hack.do_name.c hack.end.c hack.engrave.c hack.invent.c hack.lev.c hack.mon.c hack.pager.c hack.read.c hack.shk.c hack.steal.c hack.topl.c hack.worm.c Log Message: Remove more silly casts. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/games/hack/hack.do.c \ src/games/hack/hack.read.c cvs rdiff -u -r1.11 -r1.12 src/games/hack/hack.do_name.c \ src/games/hack/hack.engrave.c src/games/hack/hack.shk.c cvs rdiff -u -r1.15 -r1.16 src/games/hack/hack.end.c \ src/games/hack/hack.invent.c cvs rdiff -u -r1.12 -r1.13 src/games/hack/hack.lev.c \ src/games/hack/hack.mon.c cvs rdiff -u -r1.17 -r1.18 src/games/hack/hack.pager.c cvs rdiff -u -r1.7 -r1.8 src/games/hack/hack.steal.c cvs rdiff -u -r1.13 -r1.14 src/games/hack/hack.topl.c cvs rdiff -u -r1.8 -r1.9 src/games/hack/hack.worm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/hack/hack.do.c diff -u src/games/hack/hack.do.c:1.10 src/games/hack/hack.do.c:1.11 --- src/games/hack/hack.do.c:1.10 Wed Jul 20 07:04:30 2011 +++ src/games/hack/hack.do.c Sat Aug 6 20:29:37 2011 @@ -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 @@ if (Invisible) newsym(u.ux, u.uy); } - free((char *) obj); + free(obj); return (1); } if (obj->owornmask & (W_ARMOR | W_RING)) { Index: src/games/hack/hack.read.c diff -u src/games/hack/hack.read.c:1.10 src/games/hack/hack.read.c:1.11 --- src/games/hack/hack.read.c:1.10 Wed Aug 12 07:28:41 2009 +++ src/games/hack/hack.read.c Sat Aug 6 20:29:37 2011 @@ -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 @@ Punished = 0; freeobj(uchain); unpobj(uchain); - free((char *) uchain); + free(uchain); uball->spe = 0; uball->owornmask &= ~W_BALL; uchain = uball = (struct obj *) 0; Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.11 src/games/hack/hack.do_name.c:1.12 --- src/games/hack/hack.do_name.c:1.11 Wed Aug 12 07:28:40 2009 +++ src/games/hack/hack.do_name.c Sat Aug 6 20:29:37 2011 @@ -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 @@ #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 Index: src/games/hack/hack.engrave.c diff -u src/games/hack/hack.engrave.c:1.11 src/games/hack/hack.engrave.c:1.12 --- src/games/hack/hack.engrave.c:1.11 Sat Aug 6 20:18:26 2011 +++ src/games/hack/hack.engrave.c Sat Aug 6 20:29:37 2011 @@ -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 @@ return; fnd: ; } - free((char *) ep); + free(ep); } Index: src/games/hack/hack.shk.c diff -u src/games/hack/hack.shk.c:1.11 src/games/hack/hack.shk.c:1.12 --- src/games/hack/hack.shk.c:1.11 Wed Aug 12 07:28:41 2009 +++ src/games/hack/hack.shk.c Sat Aug 6 20:29:37 2011 @@ -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 @@ void obfree(struct obj *obj, struct obj *merge) { - free((char *) obj); + free(obj); } int inshop(void) { @@ -237,7 +237,7 @@ obj->unpaid = 0; while ((obj = billobjs) != NULL) { billobjs = obj->nobj; - free((char *) obj); + free(obj); } ESHK(shopkeeper)->billct = 0; } @@ -419,7 +419,7 @@ *bp = bill[ESHK(shopkeeper)->billct]; } } - free((char *) obj); + free(obj); } static void @@ -603,7 +603,7 @@ else pline("Error in shopkeeper administration."); } - free((char *) obj); + free(obj); } return (1); } Index: src/games/hack/hack.end.c diff -u src/games/hack/hack.end.c:1.15 src/games/hack/hack.end.c:1.16 --- src/games/hack/hack.end.c:1.15 Sat Aug 6 20:18:26 2011 +++ src/games/hack/hack.end.c Sat Aug 6 20:29:37 2011 @@ -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 @@ break; } } - free((char *) t1); + free(t1); } #ifdef nonsense totchars[totcharct] = 0; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.15 src/games/hack/hack.invent.c:1.16 --- src/games/hack/hack.invent.c:1.15 Mon May 23 22:53:25 2011 +++ src/games/hack/hack.invent.c Sat Aug 6 20:29:37 2011 @@ -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 @@ } gtmp->ngold = gold->ngold; } - free((char *) gold); + free(gold); } void @@ -251,7 +251,7 @@ for (ttmp = ftrap; ttmp->ntrap != trap; ttmp = ttmp->ntrap); ttmp->ntrap = trap->ntrap; } - free((char *) trap); + free(trap); } struct wseg *m_atseg; Index: src/games/hack/hack.lev.c diff -u src/games/hack/hack.lev.c:1.12 src/games/hack/hack.lev.c:1.13 --- src/games/hack/hack.lev.c:1.12 Sat Aug 6 20:00:33 2011 +++ src/games/hack/hack.lev.c Sat Aug 6 20:29:37 2011 @@ -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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ trap = newtrap(); mread(fd, trap, sizeof(struct trap)); } - free((char *) trap); + free(trap); fobj = restobjchn(fd); billobjs = restobjchn(fd); rest_engravings(fd); Index: src/games/hack/hack.mon.c diff -u src/games/hack/hack.mon.c:1.12 src/games/hack/hack.mon.c:1.13 --- src/games/hack/hack.mon.c:1.12 Sat Aug 6 20:24:35 2011 +++ src/games/hack/hack.mon.c Sat Aug 6 20:29:37 2011 @@ -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 @@ struct monst *mtmp; while ((mtmp = fdmon) != NULL) { fdmon = mtmp->nmon; - free((char *) mtmp); + free(mtmp); } } Index: src/games/hack/hack.pager.c diff -u src/games/hack/hack.pager.c:1.17 src/games/hack/hack.pager.c:1.18 --- src/games/hack/hack.pager.c:1.17 Sat Aug 6 20:18:26 2011 +++ src/games/hack/hack.pager.c Sat Aug 6 20:29:37 2011 @@ -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 @@ cleanup: while ((tl = texthead) != NULL) { texthead = tl->next_line; - free((char *) tl); + free(tl); } } Index: src/games/hack/hack.steal.c diff -u src/games/hack/hack.steal.c:1.7 src/games/hack/hack.steal.c:1.8 --- src/games/hack/hack.steal.c:1.7 Wed Aug 12 07:28:41 2009 +++ src/games/hack/hack.steal.c Sat Aug 6 20:29:37 2011 @@ -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 @@ 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 */ Index: src/games/hack/hack.topl.c diff -u src/games/hack/hack.topl.c:1.13 src/games/hack/hack.topl.c:1.14 --- src/games/hack/hack.topl.c:1.13 Sat Aug 6 20:18:26 2011 +++ src/games/hack/hack.topl.c Sat Aug 6 20:29:37 2011 @@ -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 @@ tl = tl->next_topl; } if (tl && tl->next_topl) { - free((char *) tl->next_topl); + free(tl->next_topl); tl->next_topl = 0; } } Index: src/games/hack/hack.worm.c diff -u src/games/hack/hack.worm.c:1.8 src/games/hack/hack.worm.c:1.9 --- src/games/hack/hack.worm.c:1.8 Wed Aug 12 07:28:41 2009 +++ src/games/hack/hack.worm.c Sat Aug 6 20:29:37 2011 @@ -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 @@ { if (wtmp->wdispl) newsym(wtmp->wx, wtmp->wy); - free((char *) wtmp); + free(wtmp); } #endif /* NOWORM */