]> git.pond.sub.org Git - empserver/commitdiff
(ontradingblock, trdswitchown): Second parameter is a generic pointer,
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Mar 2006 15:11:17 +0000 (15:11 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Mar 2006 15:11:17 +0000 (15:11 +0000)
change it from int * to void *.  Callers changed not to cast to int *.

13 files changed:
include/prototypes.h
src/lib/commands/arm.c
src/lib/commands/laun.c
src/lib/commands/load.c
src/lib/commands/scra.c
src/lib/commands/scut.c
src/lib/commands/trad.c
src/lib/subs/attsub.c
src/lib/subs/lndsub.c
src/lib/subs/mission.c
src/lib/subs/plnsub.c
src/lib/subs/shpsub.c
src/lib/subs/takeover.c

index 47bae77631bd955c99b4cc53103733bae08cab1f..2385440d05b0f05fa35a97cbe47b6e549a5b5a58 100644 (file)
@@ -77,8 +77,8 @@ extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);
 extern void plane_sona(struct emp_qelem *, int, int, struct shiplist **);
 extern s_char *prsub(struct shpstr *);
 extern int check_trade(void);
-extern int ontradingblock(int, int *);
-extern void trdswitchown(int, int *, int);
+extern int ontradingblock(int, void *);
+extern void trdswitchown(int, void *, int);
 /* Commands */
 int acce(void);
 int add(void);
index a5ad3f8d2a447a7b4a8ede38533fdbaf00623510..ef76ef9c1500b2cab651990d97aeea847695d173 100644 (file)
@@ -75,7 +75,7 @@ arm(void)
        return RET_FAIL;
     }
     if (opt_MARKET) {
-       if (ontradingblock(EF_PLANE, (int *)&pl)) {
+       if (ontradingblock(EF_PLANE, &pl)) {
            pr("You cannot arm/disarm an item on the trading block!\n");
            return RET_FAIL;
        }
index 81d1a61df215a699aa0566992e0dc485cb115b5c..469589727edb90268c773483b28b0a145bf7dc87 100644 (file)
@@ -94,7 +94,7 @@ laun(void)
            continue;
        }
        if (opt_MARKET) {
-           if (ontradingblock(EF_PLANE, (int *)&plane)) {
+           if (ontradingblock(EF_PLANE, &plane)) {
                pr("plane #%d inelligible - it's for sale.\n",
                   plane.pln_uid);
                continue;
index 015b0836357c0fdf7a4701f5c3cd51a4be6eba83..a4b6bd699ec529bdc2525929caf6baedf1283406 100644 (file)
@@ -121,7 +121,7 @@ load(void)
            continue;
        }
        if (opt_MARKET) {
-           if (ontradingblock(EF_SHIP, (int *)&ship)) {
+           if (ontradingblock(EF_SHIP, &ship)) {
                pr("You cannot load/unload an item on the trading block!\n");
                continue;
            }
@@ -266,7 +266,7 @@ lload(void)
        if (sect.sct_own != player->cnum && land.lnd_own != player->cnum)
            continue;
        if (opt_MARKET) {
-           if (ontradingblock(EF_LAND, (int *)&land)) {
+           if (ontradingblock(EF_LAND, &land)) {
                pr("You cannot load/unload an item on the trading block!\n");
                continue;
            }
index f17622a6eb07acb939a1e338dd5182b3f120f55f..1d97d36f81e257ea91dc0ffb8d50d0d15f693295 100644 (file)
@@ -142,7 +142,7 @@ scra(void)
            continue;
 
        if (opt_MARKET) {
-           if (ontradingblock(type, (int *)&item.ship)) {
+           if (ontradingblock(type, &item.ship)) {
                pr("You cannot scrap an item on the trading block!\n");
                continue;
            }
index 460180d190061896378be172cf9ed5a4cb4c2e8b..7a4858d3eea81d43d9157dfd10b77d6e32584934 100644 (file)
@@ -209,7 +209,7 @@ scut(void)
        if (!player->owner)
            continue;
        if (opt_MARKET) {
-           if (ontradingblock(type, (int *)&item.ship)) {
+           if (ontradingblock(type, &item.ship)) {
                pr("You cannot scuttle an item on the trading block!\n");
                continue;
            }
index abd8fc6f58ad1a686003011cd6428f9f07be010f..249f1bd4703d2df161f45089a45b77e9b2c0c87a 100644 (file)
@@ -495,8 +495,7 @@ check_trade(void)
 }
 
 int
-ontradingblock(int type, int *ptr)
-         /* Generic pointer */
+ontradingblock(int type, void *ptr)
 {
     struct trdstr trade;
     union trdgenstr tg;
@@ -516,8 +515,7 @@ ontradingblock(int type, int *ptr)
 }
 
 void
-trdswitchown(int type, int *ptr, int newown)
-         /* Generic pointer */
+trdswitchown(int type, void *ptr, int newown)
 {
     struct trdstr trade;
     union trdgenstr tg;
index 516e9fee3e2b4c0ecd668bf44c69f2303b9da506..1ef23c10c42b85eff95346eca061a0b657fa57ea 100644 (file)
@@ -219,7 +219,7 @@ att_get_combat(struct combat *com, int isdef)
        }
        if (opt_MARKET) {
            if (isdef && player->owner &&
-               ontradingblock(EF_SHIP, (int *)&ship)) {
+               ontradingblock(EF_SHIP, &ship)) {
                pr("%s is on the trading block.\n", prcom(0, com));
                return att_combat_init(com, EF_BAD);
            }
@@ -983,7 +983,7 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
        }
 
        if (opt_MARKET) {
-           if (ontradingblock(EF_LAND, (int *)&land)) {
+           if (ontradingblock(EF_LAND, &land)) {
                pr("%s is on the trading block, and cannot %s\n",
                   prland(&land), att_mode[combat_mode]);
                continue;
index 0fad77ed4bcde4f84dbbb6e43f3d5e2592b03be0..a1432fdbafd56d81304ddde98b30ada58f72baa9 100644 (file)
@@ -514,7 +514,7 @@ lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
        if (!player->owner)
            continue;
        if (opt_MARKET) {
-           if (ontradingblock(EF_LAND, (int *)&land)) {
+           if (ontradingblock(EF_LAND, &land)) {
                pr("unit #%d inelligible - it's for sale.\n",
                   land.lnd_uid);
                continue;
index 22e0ddbd7a55359bb9ba2de3b8381e0e583c8c9a..ce9e9ee340cbb959188f9ee790520c9e4ab93886 100644 (file)
@@ -1009,7 +1009,7 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
        }
 
        if (opt_MARKET) {
-           if (ontradingblock(EF_PLANE, (int *)pp)) {
+           if (ontradingblock(EF_PLANE, pp)) {
                emp_remque(qp);
                free(qp);
                continue;
index ff1a9775c777368b088b99193e87d50fef242ef7..eeaf0ab5c402de34f5e5f6c34c521535cf8adc7f 100644 (file)
@@ -393,7 +393,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
        if (plane.pln_mobil <= 0)
            continue;
        if (opt_MARKET) {
-           if (ontradingblock(EF_PLANE, (int *)&plane)) {
+           if (ontradingblock(EF_PLANE, &plane)) {
                pr("plane #%d inelligible - it's for sale.\n",
                   plane.pln_uid);
                continue;
index 36f35495ac3aa009c3a80bdb8735d61db065744d..c1de877888ef0a2e34e95da69c8b86b8fba7d883 100644 (file)
@@ -82,7 +82,7 @@ shp_sel(struct nstr_item *ni, struct emp_qelem *list)
           continue;
         */
        if (opt_MARKET) {
-           if (ontradingblock(EF_SHIP, (int *)&ship)) {
+           if (ontradingblock(EF_SHIP, &ship)) {
                pr("ship #%d inelligible - it's for sale.\n",
                   ship.shp_uid);
                continue;
index f4ad92a55e239f88c4d71baba7c082b0a9b63fec..88fde63812f94876c87925c9a3e430c4d4cde433 100644 (file)
@@ -199,7 +199,7 @@ takeover_plane(struct plnstr *pp, natid newown)
           cname(newown), xyas(pp->pln_x, pp->pln_y, pp->pln_own));
     }
     if (opt_MARKET)
-       trdswitchown(EF_PLANE, (int *)pp, newown);
+       trdswitchown(EF_PLANE, pp, newown);
     if (pp->pln_mobil > 0)
        pp->pln_mobil = 0;
     makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
@@ -219,7 +219,7 @@ takeover_ship(struct shpstr *sp, natid newown, int hostile)
     struct lndstr llp;
 
     if (opt_MARKET)
-       trdswitchown(EF_SHIP, (int *)sp, newown);
+       trdswitchown(EF_SHIP, sp, newown);
     makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x, sp->shp_y);
     sp->shp_own = newown;
     makenotlost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x, sp->shp_y);
@@ -246,7 +246,7 @@ takeover_ship(struct shpstr *sp, natid newown, int hostile)
        /* Keep track of when this was taken over */
        time(&pp->pln_access);
        if (opt_MARKET)
-           trdswitchown(EF_PLANE, (int *)pp, newown);
+           trdswitchown(EF_PLANE, pp, newown);
        pp->pln_mission = 0;
        makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
        pp->pln_own = newown;
@@ -285,7 +285,7 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
     /* Keep track of when this was taken over */
     time(&landp->lnd_access);
     if (opt_MARKET)
-       trdswitchown(EF_LAND, (int *)landp, newown);
+       trdswitchown(EF_LAND, landp, newown);
     landp->lnd_mission = 0;
     makelost(EF_LAND, landp->lnd_own, landp->lnd_uid, landp->lnd_x,
             landp->lnd_y);
@@ -309,7 +309,7 @@ takeover_land(struct lndstr *landp, natid newown, int hostile)
        /* Keep track of when this was taken over */
        time(&pp->pln_access);
        if (opt_MARKET)
-           trdswitchown(EF_PLANE, (int *)pp, newown);
+           trdswitchown(EF_PLANE, pp, newown);
        pp->pln_mission = 0;
        makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
        pp->pln_own = newown;