Remove a bunch of redundant casts.

This commit is contained in:
Markus Armbruster 2005-06-12 06:31:48 +00:00
parent ee6d72f3b8
commit 4f59fc9967
125 changed files with 417 additions and 432 deletions

View file

@ -70,20 +70,19 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
static s_char **wmap = (s_char **)0;
if (!wmapbuf)
wmapbuf =
(s_char *)malloc((WORLD_Y * MAPWIDTH(1)) * sizeof(s_char));
wmapbuf = malloc((WORLD_Y * MAPWIDTH(1)) * sizeof(s_char));
if (!wmap) {
wmap = (s_char **)malloc(WORLD_Y * sizeof(s_char *));
wmap = malloc(WORLD_Y * sizeof(s_char *));
if (wmap && wmapbuf) {
for (i = 0; i < WORLD_Y; i++)
wmap[i] = &wmapbuf[MAPWIDTH(1) * i];
} else if (wmap) {
free((s_char *)wmap);
free(wmap);
wmap = (s_char **)0;
}
}
if (!bitmap)
bitmap = (u_char *)malloc((WORLD_X * WORLD_Y) / 8);
bitmap = malloc((WORLD_X * WORLD_Y) / 8);
if (!wmapbuf || !wmap || !bitmap) {
pr("Memory error, tell the deity.\n");
logerror("malloc failed in draw_map\n");