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

@ -148,7 +148,7 @@ finish_sects(int etu)
if (sp->sct_type == SCT_WATER || sp->sct_own == 0) {
#ifdef SAVE_FINISH_PATHS
if (infptr->path)
free((s_char *)infptr->path);
free(infptr->path);
#endif /* SAVE_FINISH_PATHS */
continue;
}
@ -156,7 +156,7 @@ finish_sects(int etu)
if (np->nat_money < 0) {
#ifdef SAVE_FINISH_PATHS
if (infptr->path)
free((s_char *)infptr->path);
free(infptr->path);
#endif /* SAVE_FINISH_PATHS */
continue;
}
@ -164,7 +164,7 @@ finish_sects(int etu)
infptr->path, infptr->imcost, infptr->excost);
#ifdef SAVE_FINISH_PATHS
if (infptr->path)
free((s_char *)infptr->path);
free(infptr->path);
#endif /* SAVE_FINISH_PATHS */
}
logerror("done importing\n");
@ -205,7 +205,7 @@ assemble_dist_paths(struct distinfo *distptrs)
int len;
/* Here we malloc a buffer and save it */
len = strlen(path);
infptr->path = (s_char *)malloc(len);
infptr->path = malloc(len);
if (infptr->path == (s_char *)0) {
logerror("malloc failed in assemble_dist_path!\n");
return;

View file

@ -95,7 +95,7 @@ update_main(void *unused)
memset(air_money, 0, sizeof(air_money));
memset(sea_money, 0, sizeof(sea_money));
memset(lnd_money, 0, sizeof(lnd_money));
bp = (int *)calloc(WORLD_X * WORLD_Y * 7, sizeof(int));
bp = calloc(WORLD_X * WORLD_Y * 7, sizeof(int));
for (n = 0; n < MAXNOC; n++) {
money[n] = 0;
if ((np = getnatp(n)) == (struct natstr *)0)

View file

@ -258,7 +258,7 @@ nav_ship(struct shpstr *sp)
/* Make a list of one ships so we can use the navi.c code */
emp_initque(&ship_list);
mlp = (struct mlist *)malloc(sizeof(struct mlist));
mlp = malloc(sizeof(struct mlist));
mlp->mcp = mchr + sp->shp_type;
mlp->ship = *sp;
mlp->mobil = (double)sp->shp_mobil;

View file

@ -167,7 +167,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
fltp = fltp->next) ;
if (!fltp) {
fltp = (struct fltheadstr *)malloc(sizeof(*fltp));
fltp = malloc(sizeof(*fltp));
memset(fltp, 0, sizeof(*fltp));
/* Fix the links. */
@ -192,7 +192,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
return (0);
}
this = (struct fltelemstr *)malloc(sizeof(*this));
this = malloc(sizeof(*this));
memset(this, 0, sizeof(*this));
this->num = sp->shp_uid;
this->own = sp->shp_own;
@ -338,7 +338,7 @@ fltp_to_list(struct fltheadstr *fltp, struct emp_qelem *list)
emp_initque(list);
for (fe = fltp->head; fe; fe = fe->next) {
mlp = (struct mlist *)malloc(sizeof(struct mlist));
mlp = malloc(sizeof(struct mlist));
sp = getshipp(fe->num);
mlp->mcp = mchr + sp->shp_type;
mlp->ship = *sp;