diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index e02f61b8..432f71d8 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -810,7 +810,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown, range = mapdist(ship.shp_x, ship.shp_y, ax, ay); if (range > erange) continue; - if (!line_of_sight((s_char **)0, ship.shp_x, ship.shp_y, ax, ay)) + if (!line_of_sight(NULL, ship.shp_x, ship.shp_y, ax, ay)) continue; (*nfiring)++; diff --git a/src/lib/commands/sona.c b/src/lib/commands/sona.c index 50730ddf..d08c59d7 100644 --- a/src/lib/commands/sona.c +++ b/src/lib/commands/sona.c @@ -51,7 +51,7 @@ #include "commands.h" #include "optlist.h" -static int blankrow(s_char *); +static int blankrow(char *); int sona(void) @@ -74,37 +74,37 @@ sona(void) int changed = 0; int row; /* Where these are used are non-re-entrant, so we keep 'em around */ - static s_char **rad = (s_char **)0; - static s_char *radbuf = (s_char *)0; - static s_char **vis = (s_char **)0; - static s_char *visbuf = (s_char *)0; + static char **rad = NULL; + static char *radbuf = NULL; + static char **vis = NULL; + static char *visbuf = NULL; if (!snxtitem(&ni, EF_SHIP, player->argp[1])) return RET_SYN; if (!radbuf) - radbuf = malloc((WORLD_Y * (WORLD_X + 1)) * sizeof(s_char)); + radbuf = malloc((WORLD_Y * (WORLD_X + 1))); if (!visbuf) - visbuf = malloc((WORLD_Y * (WORLD_X + 1)) * sizeof(s_char)); + visbuf = malloc((WORLD_Y * (WORLD_X + 1))); if (!rad) { - rad = malloc(WORLD_Y * sizeof(s_char *)); + rad = malloc(WORLD_Y); if (rad && radbuf) { for (x = 0; x < WORLD_Y; x++) { rad[x] = &radbuf[(WORLD_X + 1) * x]; } } else if (rad) { free(rad); - rad = (s_char **)0; + rad = NULL; } } if (!vis) { - vis = malloc(WORLD_Y * sizeof(s_char *)); + vis = malloc(WORLD_Y); if (vis && visbuf) { for (x = 0; x < WORLD_Y; x++) { vis[x] = &visbuf[(WORLD_X + 1) * x]; } } else if (vis) { free(vis); - vis = (s_char **)0; + vis = NULL; } } if (!radbuf || !visbuf || !rad || !vis) { @@ -128,7 +128,7 @@ sona(void) xyas(ship.shp_x, ship.shp_y, player->cnum), ship.shp_effic, srange); snxtsct_dist(&ns, ship.shp_x, ship.shp_y, srange); - blankfill((s_char *)radbuf, &ns.range, 1); + blankfill(radbuf, &ns.range, 1); while (nxtsct(&ns, §)) { if (player->owner || sect.sct_type == SCT_WATER) rad[ns.dy][ns.dx] = dchr[sect.sct_type].d_mnem; @@ -385,7 +385,7 @@ line_of_sight(char **rad, int ax, int ay, int bx, int by) } static int -blankrow(s_char *s) +blankrow(char *s) { while (*s) { if (*s != ' ') diff --git a/src/lib/commands/torp.c b/src/lib/commands/torp.c index 9ae9b2dd..1c4154d4 100644 --- a/src/lib/commands/torp.c +++ b/src/lib/commands/torp.c @@ -187,7 +187,7 @@ torp(void) pr("Hitchance = %d%%\n", (int)(hitchance * 100)); } /* Now, can the torpedo even get there? */ - if (!line_of_sight((s_char **)0, sub.shp_x, sub.shp_y, + if (!line_of_sight(NULL, sub.shp_x, sub.shp_y, vship.shp_x, vship.shp_y)) { pr("BOOM!... Torpedo slams into land before reaching target.\n"); /* We only tell the victim if we were within range. */ @@ -272,8 +272,7 @@ anti_torp(int f, int ntorping, int vshipown) if (range > erange) continue; - if (!line_of_sight((s_char **)0, sub.shp_x, sub.shp_y, - dd.shp_x, dd.shp_y)) + if (!line_of_sight(NULL, sub.shp_x, sub.shp_y, dd.shp_x, dd.shp_y)) continue; if (cantorp(&dd, &sub)) { diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 960d31ea..de745048 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -571,7 +571,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list, if (md > range) continue; - if (!line_of_sight((s_char **)0, x, y, gp->x, gp->y)) + if (!line_of_sight(NULL, x, y, gp->x, gp->y)) continue; sp->shp_item[I_SHELL] = shell - SHP_TORP_SHELLS; mobcost = sp->shp_effic * 0.01 * sp->shp_speed;