From 42290db8c85e93e5abadca04c456ffa25d12fe13 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 3 Mar 2004 09:39:50 +0000 Subject: [PATCH] (nameofitem, produce, check, fire_dchrg, send_reacting_units_home, do_map_set, upd_land, nav_check_atdest, produce, upd_ship): Remove unused parameters. Callers changed. --- include/prototypes.h | 4 ++-- src/lib/commands/miss.c | 6 +++--- src/lib/commands/repo.c | 38 +++++++++++++++++++------------------- src/lib/commands/torp.c | 9 ++++----- src/lib/subs/attsub.c | 7 +++---- src/lib/subs/bigmap.c | 11 ++++------- src/lib/subs/mission.c | 5 ++--- src/lib/update/land.c | 6 +++--- src/lib/update/nav_ship.c | 4 ++-- src/lib/update/produce.c | 2 +- src/lib/update/sect.c | 5 ++--- src/lib/update/ship.c | 6 +++--- 12 files changed, 48 insertions(+), 55 deletions(-) diff --git a/include/prototypes.h b/include/prototypes.h index 5b71daf9..28421e56 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -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); diff --git a/src/lib/commands/miss.c b/src/lib/commands/miss.c index b0511eaf..c9df5618 100644 --- a/src/lib/commands/miss.c +++ b/src/lib/commands/miss.c @@ -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)); } diff --git a/src/lib/commands/repo.c b/src/lib/commands/repo.c index b6b2c8ce..c15f421f 100644 --- a/src/lib/commands/repo.c +++ b/src/lib/commands/repo.c @@ -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; diff --git a/src/lib/commands/torp.c b/src/lib/commands/torp.c index c6ca72e1..f7632644 100644 --- a/src/lib/commands/torp.c +++ b/src/lib/commands/torp.c @@ -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; diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 5ce68843..73bd39af 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -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; diff --git a/src/lib/subs/bigmap.c b/src/lib/subs/bigmap.c index 20ec874f..bd82a6fc 100644 --- a/src/lib/subs/bigmap.c +++ b/src/lib/subs/bigmap.c @@ -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; diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 063457c5..9aeb0d83 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -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 || diff --git a/src/lib/update/land.c b/src/lib/update/land.c index 16a34228..a1854b38 100644 --- a/src/lib/update/land.c +++ b/src/lib/update/land.c @@ -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 */ { diff --git a/src/lib/update/nav_ship.c b/src/lib/update/nav_ship.c index c5bf9d55..5b140c64 100644 --- a/src/lib/update/nav_ship.c +++ b/src/lib/update/nav_ship.c @@ -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 */ diff --git a/src/lib/update/produce.c b/src/lib/update/produce.c index 4f989476..2b36f852 100644 --- a/src/lib/update/produce.c +++ b/src/lib/update/produce.c @@ -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; diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index ebdac481..31e0966c 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -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); diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index 3456c7cc..3204d3df 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -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 */ {