]> git.pond.sub.org Git - empserver/commitdiff
(nxtitemp): Use void * for generic pointer function value.
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 6 Jan 2006 16:55:17 +0000 (16:55 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 6 Jan 2006 16:55:17 +0000 (16:55 +0000)
include/prototypes.h
src/lib/update/nxtitemp.c
src/lib/update/revolt.c
src/lib/update/ship.c

index ec9f8807a9a4811bb8c844d72a8076fb50cfcc48..b3807331237161f718284e6be966ea54ffd62ee5 100644 (file)
@@ -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);
index be764284b44fbf52315f3d0a0ce7dff5d097c22b..67d7c1d9255fe11c4863959e63ca0825c71cae07 100644 (file)
@@ -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;
 }
index 8fc1e59c55fe094a2dcfd1c063457b6e0b7d59a2..50a725eff88dd7af81a86fba9cb8f050bb5a943d 100644 (file)
@@ -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;
 
index d921f744fb8588472331ef1815aa4bed9ffb7ad2..8f4ce632ea567212532101abb9bafe119b4f2aef 100644 (file)
@@ -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];