diff --git a/include/prototypes.h b/include/prototypes.h index ec9f8807..b3807331 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -771,7 +771,7 @@ extern int load_it(struct shpstr *, struct sctstr *, extern void unload_it(struct shpstr *); extern void auto_fuel_ship(struct shpstr *); /* nxtitemp.c */ -extern s_char *nxtitemp(struct nstr_item *); +extern void *nxtitemp(struct nstr_item *); /* plague.c */ extern void do_plague(struct sctstr *, struct natstr *, int); extern int plague_people(struct natstr *, short *, int *, int *, int); diff --git a/src/lib/update/nxtitemp.c b/src/lib/update/nxtitemp.c index be764284..67d7c1d9 100644 --- a/src/lib/update/nxtitemp.c +++ b/src/lib/update/nxtitemp.c @@ -45,7 +45,7 @@ #include "gen.h" #include "common.h" -s_char * +void * nxtitemp(struct nstr_item *np) { struct genitem *gp; @@ -106,5 +106,5 @@ nxtitemp(struct nstr_item *np) selected = 0; } } while (!selected); - return (s_char *)gp; + return gp; } diff --git a/src/lib/update/revolt.c b/src/lib/update/revolt.c index 8fc1e59c..50a725ef 100644 --- a/src/lib/update/revolt.c +++ b/src/lib/update/revolt.c @@ -170,7 +170,7 @@ guerrilla(struct sctstr *sp) snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { if (lp->lnd_own != sp->sct_own) continue; @@ -459,7 +459,7 @@ take_casualties(struct sctstr *sp, int mc) * Try not to kill any unit. */ snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { nunits++; if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) nunits++; @@ -472,7 +472,7 @@ take_casualties(struct sctstr *sp, int mc) /* kill some security troops */ snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY)) continue; @@ -503,7 +503,7 @@ take_casualties(struct sctstr *sp, int mc) /* kill some normal troops */ snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) continue; @@ -531,7 +531,7 @@ take_casualties(struct sctstr *sp, int mc) /* Hmm.. still some left.. kill off units now */ /* kill some normal troops */ snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) continue; @@ -549,7 +549,7 @@ take_casualties(struct sctstr *sp, int mc) /* Hmm.. still some left.. kill off units now */ /* kill some security troops */ snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); - while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) { + while (NULL != (lp = nxtitemp(&ni))) { if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY)) continue; diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index d921f744..8f4ce632 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -435,8 +435,7 @@ feed_ship(struct shpstr *sp, int etus, int *needed, int doit) /* doit - only steal food from land units during the update */ if (ifood_eaten > sp->shp_item[I_FOOD] && sp->shp_nland > 0 && doit) { snxtitem_all(&ni, EF_LAND); - while ((lp = (struct lndstr *)nxtitemp(&ni)) && - ifood_eaten > sp->shp_item[I_FOOD]) { + while ((lp = nxtitemp(&ni)) && ifood_eaten > sp->shp_item[I_FOOD]) { if (lp->lnd_ship != sp->shp_uid) continue; need = ifood_eaten - sp->shp_item[I_FOOD];