]> git.pond.sub.org Git - empserver/commitdiff
Clean up casts from struct FOO * to struct emp_qelem *
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jan 2014 10:17:09 +0000 (11:17 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Feb 2014 12:19:26 +0000 (13:19 +0100)
Take the address of the queue member instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/attsub.c
src/lib/subs/lndsub.c
src/lib/subs/mission.c
src/lib/subs/shpsub.c

index 5fdf81dc085200fee2bca591538515c75c48e69c..93438edf3c3ebee5be82550d9f5400d3eec2c0bc 100644 (file)
@@ -1428,7 +1428,7 @@ put_oland(struct emp_qelem *list)
        llp->mobil = 0.0;
        putland(llp->unit.land.lnd_uid, &llp->unit.land);
        if (llp->unit.land.lnd_own != player->cnum) {
-           emp_remque((struct emp_qelem *)llp);
+           emp_remque(&llp->queue);
            free(llp);
        } else
            get_oland(A_ATTACK, llp);
index 077ea84322ca70204afe40d7c536d54587fc122a..e789009e0734ac20130cf7250eca5d42d1527ef7 100644 (file)
@@ -149,7 +149,7 @@ void
 lnd_delete(struct ulist *llp)
 {
     putland(llp->unit.land.lnd_uid, &llp->unit.land);
-    emp_remque((struct emp_qelem *)llp);
+    emp_remque(&llp->queue);
     free(llp);
 }
 
@@ -476,7 +476,7 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
        if (lp->lnd_own != actor) {
            mpr(actor, "%s was disbanded at %s\n",
                prland(lp), xyas(lp->lnd_x, lp->lnd_y, actor));
-           emp_remque((struct emp_qelem *)llp);
+           emp_remque(&llp->queue);
            free(llp);
            continue;
        }
index 6db7db0484dc63d0a6034b9e2aba856b779f837e..eab6332191dcd779a3cdca7b13daa0d637a3e0ce 100644 (file)
@@ -107,7 +107,7 @@ ground_interdict(coord x, coord y, natid victim, char *s)
     act[0] = 0;
     for (cn = 1; cn < MAXNOC; cn++) {
        act[cn] = relations_with(cn, victim) <= HOSTILE;
-       emp_initque((struct emp_qelem *)&mi[cn]);
+       emp_initque(&mi[cn].queue);
     }
 
     build_mission_list(mi, act, act, x, y, MI_INTERDICT);
@@ -192,7 +192,7 @@ unit_interdict(coord x, coord y, natid victim, char *s, int hardtarget,
        other_act[cn] = rel <= HOSTILE;
        plane_act[cn] = mission == MI_SINTERDICT
            ? rel <= NEUTRAL : other_act[cn];
-       emp_initque((struct emp_qelem *)&mi[cn]);
+       emp_initque(&mi[cn].queue);
     }
 
     build_mission_list(mi, other_act, plane_act, x, y, mission);
@@ -250,7 +250,7 @@ dosupport(coord x, coord y, natid victim, natid actee, int mission)
     act[0] = 0;
     for (cn = 1; cn < MAXNOC; cn++) {
        act[cn] = feels_like_helping(cn, actee, victim);
-       emp_initque((struct emp_qelem *)&mi[cn]);
+       emp_initque(&mi[cn].queue);
     }
 
     build_mission_list(mi, act, act, x, y, MI_SUPPORT);
@@ -992,7 +992,7 @@ add_airport(struct emp_qelem *airp, coord x, coord y)
     getsect(x, y, &sect);
     a->own = sect.sct_own;
 
-    emp_insque((struct emp_qelem *)a, airp);
+    emp_insque(&a->queue, airp);
 }
 
 /*
index c88593f1ee011d67f49961db72119a3e99a52de3..cb73c6360f7a70807631403307a47e3202d0180c 100644 (file)
@@ -118,7 +118,7 @@ shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
        if (sp->shp_own != actor) {
            mpr(actor, "%s was sunk at %s\n",
                prship(sp), xyas(sp->shp_x, sp->shp_y, actor));
-           emp_remque((struct emp_qelem *)mlp);
+           emp_remque(&mlp->queue);
            free(mlp);
            continue;
        }
@@ -290,7 +290,7 @@ shp_stays(natid actor, char *str, struct ulist *mlp)
        xyas(mlp->unit.ship.shp_x, mlp->unit.ship.shp_y, actor));
     mlp->unit.ship.shp_mobil = (int)mlp->mobil;
     putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
-    emp_remque((struct emp_qelem *)mlp);
+    emp_remque(&mlp->queue);
     free(mlp);
 }
 
@@ -377,7 +377,7 @@ shp_damage_one(struct ulist *mlp, int dam)
     shipdamage(&mlp->unit.ship, dam);
     putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
     if (!mlp->unit.ship.shp_own) {
-       emp_remque((struct emp_qelem *)mlp);
+       emp_remque(&mlp->queue);
        free(mlp);
     }
 }