]> git.pond.sub.org Git - empserver/commitdiff
(nameofitem, produce, check, fire_dchrg, send_reacting_units_home,
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 3 Mar 2004 09:39:50 +0000 (09:39 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 3 Mar 2004 09:39:50 +0000 (09:39 +0000)
do_map_set, upd_land, nav_check_atdest, produce, upd_ship): Remove
unused parameters.  Callers changed.

12 files changed:
include/prototypes.h
src/lib/commands/miss.c
src/lib/commands/repo.c
src/lib/commands/torp.c
src/lib/subs/attsub.c
src/lib/subs/bigmap.c
src/lib/subs/mission.c
src/lib/update/land.c
src/lib/update/nav_ship.c
src/lib/update/produce.c
src/lib/update/sect.c
src/lib/update/ship.c

index 5b71daf940cbcc8d5024ed6c531079db8d4d23a2..28421e56879a3cf0ba1a82ea791230b09a226472 100644 (file)
@@ -336,7 +336,7 @@ extern int num_shipsatxy(coord, coord, int, int);
 extern int islist(s_char *);
 /* src/lib/subs/mission.c */
 extern s_char *mission_name(short);
-extern s_char *nameofitem(s_char *, struct genitem *, int);
+extern s_char *nameofitem(struct genitem *, int);
 extern int collateral_damage(coord, coord, int, struct emp_qelem *);
 extern int mission_pln_equip(struct plist *, struct ichrstr *, int,
                             s_char);
@@ -604,7 +604,7 @@ extern int upd_slmilcosts(natid, int);
 extern void prepare_sects(int, int *);
 extern int bank_income(struct sctstr *, int);
 /* produce.c */
-extern int produce(struct natstr *, struct sctstr *, int *, int, int, int,
+extern int produce(struct natstr *, struct sctstr *, int *, int, int,
                   int, int *, int *);
 /* removewants.c */
 extern int update_removewants(void);
index b0511eafdb87060094af8ccc807e557e53e6af84..c9df5618292fe8d5097e525452065d7315d365eb 100644 (file)
@@ -320,7 +320,7 @@ mission(void)
            mission == MI_DSUPPORT || mission == MI_INTERDICT ||
            mission == MI_AIR_DEFENSE) {
            pr("%s on %s mission, centered on %s, radius %d\n",
-              nameofitem(buf, gp, type), mission_name(mission),
+              nameofitem(gp, type), mission_name(mission),
               xyas(x, y, player->cnum), gp->radius);
        } else if (mission == MI_RESERVE) {
            int plus = 2;
@@ -336,9 +336,9 @@ mission(void)
            }
 
            pr("%s on %s mission with maximum reaction radius %d\n",
-              nameofitem(buf, gp, type), mission_name(mission), plus);
+              nameofitem(gp, type), mission_name(mission), plus);
        } else if (mission) {
-           pr("%s on %s mission\n", nameofitem(buf, gp, type),
+           pr("%s on %s mission\n", nameofitem(gp, type),
               mission_name(mission));
        }
 
index b6b2c8ce9ff4816e5135fb0c5e6fb2adb4a6fab0..c15f421f7fdd921084b806d37979c218d2e46df1 100644 (file)
@@ -60,7 +60,7 @@ static void repo_header(void);
 static void repo_list(struct stats *stat, natid cn, struct natstr *natp);
 
 static int check(s_char *buf, double theirs, double min, double max,
-                int shift, int what, int tolerance);
+                int shift, int tolerance);
 
 int
 repo(void)
@@ -203,23 +203,23 @@ printdiff(int mystat, double ours, struct natstr *natp, int what)
        }
        if (tolerance > 2 * ours)
            tolerance = (int)(2 * ours);
-       if (check(buf, theirs, 2 * ours, -1.0, shift, what, tolerance)) ;
-       else if (check(buf, theirs, 1.5 * ours, 2.0 * ours, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, 1.2 * ours, 1.5 * ours, shift, what,
-                 tolerance)) ;
-       else if (check(buf, theirs, 1.1 * ours, 1.2 * ours, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, ours / 1.1, 1.1 * ours, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, ours / 1.2, ours / 1.1, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, ours / 1.5, ours / 1.2, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, ours / 2.0, ours / 1.5, shift, what,
-                      tolerance)) ;
-       else if (check(buf, theirs, -1.0, ours / 2.0, shift, what,
-                      tolerance)) ;
+       if (check(buf, theirs, 2 * ours, -1.0, shift, tolerance))
+         ;
+       else if (check(buf, theirs, 1.5 * ours, 2.0 * ours, shift, tolerance))
+         ;
+       else if (check(buf, theirs, 1.2 * ours, 1.5 * ours, shift, tolerance))
+         ;
+       else if (check(buf, theirs, 1.1 * ours, 1.2 * ours, shift, tolerance))
+         ;
+       else if (check(buf, theirs, ours / 1.1, 1.1 * ours, shift, tolerance))
+         ;
+       else if (check(buf, theirs, ours / 1.2, ours / 1.1, shift, tolerance))
+         ;
+       else if (check(buf, theirs, ours / 1.5, ours / 1.2, shift, tolerance))
+         ;
+       else if (check(buf, theirs, ours / 2.0, ours / 1.5, shift, tolerance))
+         ;
+       else if (check(buf, theirs, -1.0, ours / 2.0, shift, tolerance)) ;
        else
            sprintf(buf, "    n/a");
     } else
@@ -230,7 +230,7 @@ printdiff(int mystat, double ours, struct natstr *natp, int what)
 
 static int
 check(s_char *buf, double theirs, double min, double max, int shift,
-      int what, int tolerance)
+      int tolerance)
 {
     double shove;
 
index c6ca72e1fae603b72a36be1b7437e3e9c0507034..f7632644a248d141faf8342613f342f056271dc4 100644 (file)
@@ -53,8 +53,7 @@ static void anti_torp(int f, int ntorping, int vshipown);
 static int candchrg(struct shpstr *, struct shpstr *);
 static int canshoot(struct shpstr *, struct shpstr *);
 static int cantorp(struct shpstr *, struct shpstr *);
-static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range,
-                      int ntargets);
+static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets);
 static int fire_torp(struct shpstr *, struct shpstr *, int, int);
 
 int
@@ -282,9 +281,9 @@ anti_torp(int f, int ntorping, int vshipown)
            /* Try torping.. if we can, maybe we can fire */
            if (!fire_torp(&dd, &sub, range, ntorping))
                if (candchrg(&dd, &sub))
-                   fire_dchrg(&dd, &sub, range, ntorping);
+                   fire_dchrg(&dd, &sub, ntorping);
        } else
-           fire_dchrg(&dd, &sub, range, ntorping);
+           fire_dchrg(&dd, &sub, ntorping);
     }
 }
 
@@ -343,7 +342,7 @@ candchrg(struct shpstr *a, struct shpstr *b)
 }
 
 static void
-fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
+fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets)
 {
     int dam;
     int shells;
index 5ce68843b495f709b6c644d727c038fb9f3d4e75..73bd39af555b52ff96cad55afeeb345377de7f78 100644 (file)
@@ -78,8 +78,7 @@ static int get_dtotal(struct combat *def, struct emp_qelem *list,
 static int take_casualty(int combat_mode, struct combat *off,
                         struct emp_qelem *olist);
 
-static void send_reacting_units_home(struct combat *def,
-                                    struct emp_qelem *list);
+static void send_reacting_units_home(struct emp_qelem *list);
 static int take_def(int combat_mode, struct emp_qelem *list,
                    struct combat *off, struct combat *def);
 
@@ -2075,7 +2074,7 @@ att_fight(int combat_mode, struct combat *off, struct emp_qelem *olist,
        do_sneak(def, success);
     }
 
-    send_reacting_units_home(def, dlist);
+    send_reacting_units_home(dlist);
 
     /* putland the defending land */
     lnd_put(dlist, 0);
@@ -2214,7 +2213,7 @@ take_casualty(int combat_mode, struct combat *off, struct emp_qelem *olist)
 /* Send reacting defense units back to where they came from (at no mob cost) */
 
 static void
-send_reacting_units_home(struct combat *def, struct emp_qelem *list)
+send_reacting_units_home(struct emp_qelem *list)
 {
     struct emp_qelem *qp, *next;
     struct llist *llp;
index 20ec874f4d2049c88b5b7186bdd3f184436cd718..bd82a6fccab7e9803a0eccdca1f9fd6d15ce7bf6 100644 (file)
@@ -43,8 +43,7 @@
  * 2 = update only bmap with force
  */
 
-static int do_map_set(natid cnum, s_char *map, coord x, coord y,
-                     s_char t, int force, int sync);
+static int do_map_set(s_char *map, coord x, coord y, s_char t, int force);
 
 int
 map_set(natid cnum, coord x, coord y, s_char t, int only_bmap)
@@ -54,17 +53,15 @@ map_set(natid cnum, coord x, coord y, s_char t, int only_bmap)
     if (!t)
        return 0;
     if (!only_bmap)
-       set |= do_map_set(cnum, ef_ptr(EF_MAP, cnum), x, y, t, 0, 0);
-    set |=
-       do_map_set(cnum, ef_ptr(EF_BMAP, cnum), x, y, t, only_bmap > 1, 1);
+       set |= do_map_set(ef_ptr(EF_MAP, cnum), x, y, t, 0);
+    set |= do_map_set(ef_ptr(EF_BMAP, cnum), x, y, t, only_bmap > 1);
 
     return set;
 }
 
 
 static int
-do_map_set(natid cnum, s_char *map, coord x, coord y, s_char t, int force,
-          int sync)
+do_map_set(s_char *map, coord x, coord y, s_char t, int force)
 {
     int id;
     s_char ot;
index 063457c58907c90f920f1505aed361c287c8cb2f..9aeb0d830d8f89e2b25367b7f5ac8f61c6122543 100644 (file)
@@ -844,7 +844,7 @@ cando(int mission, int type)
 }
 
 s_char *
-nameofitem(s_char *buf, struct genitem *gp, int type)
+nameofitem(struct genitem *gp, int type)
 {
     switch (type) {
     case EF_SHIP:
@@ -912,7 +912,6 @@ show_mission(int type, struct nstr_item *np)
     int size, first = 1, radius;
     s_char *block;
     struct genitem *gp;
-    s_char buf[128];
 
     size = max(sizeof(struct lndstr), sizeof(struct plnstr));
     size = max(size, sizeof(struct shpstr));
@@ -927,7 +926,7 @@ show_mission(int type, struct nstr_item *np)
            pr("Thing                         x,y   op-sect rad mission\n");
            first = 0;
        }
-       pr("%-25s", nameofitem(buf, gp, type));
+       pr("%-25s", nameofitem(gp, type));
        pr(" %7s", xyas(gp->x, gp->y, player->cnum));
        if (gp->mission == MI_INTERDICT || gp->mission == MI_SUPPORT ||
            gp->mission == MI_OSUPPORT ||
index 16a34228c67cbf0c68835cc72584485013c7a618..a1854b386f1216c92942899862678f415cc183f2 100644 (file)
@@ -61,7 +61,7 @@ int mil_dbl_pay;
 
 static int landrepair(register struct lndstr *, int *, struct natstr *,
                      int *, int);
-static void upd_land(register struct lndstr *lp, int landno, register int etus,
+static void upd_land(register struct lndstr *lp, register int etus,
                     struct natstr *np, int *bp, int build);
 
 int
@@ -97,7 +97,7 @@ prod_land(int etus, int natnum, int *bp, int build)
        }
        np = getnatp(lp->lnd_own);
        start_money = np->nat_money;
-       upd_land(lp, n, etus, np, bp, build);
+       upd_land(lp, etus, np, bp, build);
        lnd_money[lp->lnd_own] += np->nat_money - start_money;
        if ((build && (np->nat_money != start_money)) || (!build))
            k++;
@@ -111,7 +111,7 @@ prod_land(int etus, int natnum, int *bp, int build)
 }
 
 static void
-upd_land(register struct lndstr *lp, int landno, register int etus,
+upd_land(register struct lndstr *lp, register int etus,
         struct natstr *np, int *bp, int build)
               /* build = 1, maintain = 0 */
 {
index c5bf9d55f56250e795aced5abbc6888ffd99e529..5b140c64831c83de62b6c7fc6d3e7a30ccf77849 100644 (file)
@@ -86,7 +86,7 @@ scuttle_it(register struct shpstr *sp)
 }
 
 static void
-nav_check_atdest(register struct shpstr *sp, struct mchrstr *mcp)
+nav_check_atdest(register struct shpstr *sp)
 {
     if ((sp->shp_x == sp->shp_destx[0]) && (sp->shp_y == sp->shp_desty[0])) {
        if ((sp->shp_destx[0] == sp->shp_destx[1]) &&
@@ -319,7 +319,7 @@ nav_ship(register struct shpstr *sp)
  */
            /* Ship not sunk */
            if (sp->shp_own)
-               nav_check_atdest(sp, mcp);
+               nav_check_atdest(sp);
        }
 
        quit = 0;               /* stop loop */
index 4f989476ab86eaaac946b21561d0d8a0e0b9936e..2b36f852299c016c2c4f7325c567d3448358b302 100644 (file)
@@ -55,7 +55,7 @@ s_char *levelnames[] =
 
 int
 produce(struct natstr *np, struct sctstr *sp, int *vec, int work,
-       int sctwork, int desig, int neweff, int *cost, int *amount)
+       int desig, int neweff, int *cost, int *amount)
 {
     register struct pchrstr *product;
     int vtype;
index ebdac481b5e2e970f2019f9f6376b19ac7fbe545..31e0966c3b8c3cec5d86ce13680f885a6999785a 100644 (file)
@@ -482,14 +482,13 @@ produce_sect(int natnum, int etu, int *bp, long int (*p_sect)[2],
        }
 
        /*
-          * now do the production (if sector effic >= 60%)
+        * now do the production (if sector effic >= 60%)
         */
 
        if (neweff >= 60) {
            if (np->nat_money > 0 && dchr[desig].d_prd)
                work -=
-                   produce(np, sp, vec, work, sctwork, desig, neweff,
-                           &pcost, &amount);
+                   produce(np, sp, vec, work, desig, neweff, &pcost, &amount);
        }
 
        pt_bg_nmbr(bp, sp, I_MAX + 1, work);
index 3456c7cc9026f9647fd5cc63350be84c2f31c8e7..3204d3df6940cb6c16a73707f826e1bff0ff2557 100644 (file)
@@ -59,7 +59,7 @@
 
 static int shiprepair(register struct shpstr *, int *, struct natstr *,
                      int *, int);
-static void upd_ship(register struct shpstr *, int, register int,
+static void upd_ship(register struct shpstr *, register int,
                     struct natstr *, int *, int);
 
 int
@@ -90,7 +90,7 @@ prod_ship(int etus, int natnum, int *bp, int build)
            bp_clear_cachepath();
            bp_enable_cachepath();
        }
-       upd_ship(sp, n, etus, np, bp, build);
+       upd_ship(sp, etus, np, bp, build);
        if (build && !player->simulation)       /* make sure to only autonav once */
            nav_ship(sp);       /* autonav the ship */
        sea_money[sp->shp_own] += np->nat_money - start_money;
@@ -110,7 +110,7 @@ prod_ship(int etus, int natnum, int *bp, int build)
 }
 
 static void
-upd_ship(register struct shpstr *sp, int shipno, register int etus,
+upd_ship(register struct shpstr *sp, register int etus,
         struct natstr *np, int *bp, int build)
               /* build = 1, maintain = 0 */
 {