(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.
This commit is contained in:
Markus Armbruster 2004-03-03 09:39:50 +00:00
parent 19acc1cd07
commit 42290db8c8
12 changed files with 48 additions and 55 deletions

View 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);

View 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));
}

View 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;

View 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;

View 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;

View 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;

View 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 ||

View 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 */
{

View 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 */

View 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;

View file

@ -488,8 +488,7 @@ produce_sect(int natnum, int etu, int *bp, long int (*p_sect)[2],
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);

View 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 */
{