(at_minimum, blocksig, emp_bitinit, filelogerror, iceil, ifloor,

mapdsq, mask, signame, strscan, sys_siglist, typed_wire, unblocksig):
Unused, remove.

(add_airport, add_to_fired_queue, air_damage, anti_torp, best_path,
bitinit2, blankrow, bmnxtsct, bp_init, build_mission_list,
build_mission_list_type, buildeff, candchrg, canshoot, cantorp,
cede_sect, cede_ship, checksect, client_cmd, coun_cmd,
deity_build_land, divide, do_conv, do_defdam, do_demo, do_desi,
do_mob_land, do_mob_plane, do_mob_sect, do_mob_ship, do_prod,
docountry, doland, doplane, doship, dosupport, dotsprintf, dounit,
empth_start, enlist, errcheck, filereport, find_airport, find_escorts,
findcondition, fire_dchrg, fire_torp, fltp_to_list, get_minimum,
getin, goodsect, grab_sect, grab_ship, grow_people, growfood, in_addr,
infect_people, init_mchr, init_pchr, init_plchr, is_engineer,
itemname, kill_cmd, landrepair, limit_level, list_cmd, lupgr,
materials_charge, materials_cost, meltitems, mission_pln_arm,
mission_pln_sel, move_map, nat_cap, num_units, outid, pass_cmd,
perform_mission, pinflak_planedamage, play_cmd, pln_equip, prexpense,
print_res, prplanes, prunits, pupgr, quiet_bigdef, quit_cmd, radmap2,
retreat_land1, retreat_ship1, s_commod, sanc_cmd, sarg_getrange,
scuttle_it, scuttle_land, set_target, share_incr, shiprepair,
shp_check_mines, shp_check_nav, shp_check_one_mines, shp_hit_mine,
shp_interdict, shp_mess, sort_lookup_list, starvation, supgr, swap,
take_casualties, trunc_people, upd_buildeff, upd_land, upd_ship,
use_ammo, user_cmd): Change linkage to static.
This commit is contained in:
Markus Armbruster 2003-12-17 23:13:50 +00:00
parent f883ed1620
commit 2fe312adac
58 changed files with 273 additions and 693 deletions

View file

@ -58,12 +58,11 @@ static void pin_bomb(struct emp_qelem *list, struct sctstr *target);
static void strat_bomb(struct emp_qelem *list, struct sctstr *target);
static void comm_bomb(struct emp_qelem *list, struct sctstr *target);
static void eff_bomb(struct emp_qelem *list, struct sctstr *target);
static int pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp,
natid from, int flak);
static void plane_bomb(struct emp_qelem *list, struct sctstr *target);
static void land_bomb(struct emp_qelem *list, struct sctstr *target);
static void ship_bomb(struct emp_qelem *list, struct sctstr *target);
int pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp,
natid from, int flak);
static int bombcomm[] = {
I_CIVIL,
@ -925,7 +924,8 @@ strat_bomb(struct emp_qelem *list, struct sctstr *target)
float lflaktable[16] = { 0.20, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50,
0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85,
};
int
static int
pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp, natid from,
int flak)
{

View file

@ -67,14 +67,14 @@ extern double obrate, uwbrate;
extern int etu_per_update;
extern double money_res;
s_char *dotsprintf(s_char *buf, s_char *format, int data);
int goodsect(char c);
void prexpense(long int cash, int *expensesp, s_char priority, int amount);
static void calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs,
int *Nuws, int *bars, int *Nbars, int *mil,
int *ships, int *sbuild, int *nsbuild, int *smaint,
int *units, int *lbuild, int *nlbuild, int *lmaint,
int *planes, int *pbuild, int *npbuild, int *pmaint);
static s_char *dotsprintf(s_char *buf, s_char *format, int data);
static int goodsect(char c);
static void prexpense(long int cash, int *expensesp, s_char priority, int amount);
int
budg(void)
@ -463,7 +463,7 @@ calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs, int *Nuws,
free(bp);
}
int
static int
goodsect(char c)
{
register int x;
@ -475,14 +475,14 @@ goodsect(char c)
return 0;
}
s_char *
static s_char *
dotsprintf(s_char *buf, s_char *format, int data)
{
sprintf(buf, format, data);
return (s_char *)memset(buf, '.', strspn(buf, " "));
}
void
static void
prexpense(long int cash, int *expensesp, s_char priority, int amount)
{
if (cash > *expensesp) {

View file

@ -50,6 +50,10 @@
#include "commands.h"
static void cede_hdr(void);
static int cede_sect(struct nstr_sect *, natid);
static int cede_ship(struct nstr_item *, natid);
static void grab_sect(register struct sctstr *, natid);
static void grab_ship(register struct shpstr *, natid);
int
cede(void)
@ -116,7 +120,7 @@ cede(void)
return cede_ship(&ni, to);
}
int
static int
cede_sect(struct nstr_sect *ns, natid to)
{
struct sctstr sect, osect;
@ -191,7 +195,7 @@ cede_hdr(void)
void
static void
grab_sect(register struct sctstr *sp, natid to)
{
struct plnstr *pp;
@ -294,7 +298,7 @@ grab_sect(register struct sctstr *sp, natid to)
sp->sct_mobil = 0;
}
int
static int
cede_ship(struct nstr_item *ni, natid to)
{
struct shpstr ship;
@ -333,7 +337,7 @@ cede_ship(struct nstr_item *ni, natid to)
return RET_OK;
}
void
static void
grab_ship(register struct shpstr *sp, natid to)
{
register struct plnstr *pp;

View file

@ -46,7 +46,7 @@
#include "land.h"
#include "commands.h"
long do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real);
static long do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real);
int
conv(void)
@ -70,7 +70,7 @@ conv(void)
return (int)do_conv(nstr, uwtoconvert, 1);
}
long
static long
do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real)
{
struct sctstr sect;

View file

@ -47,8 +47,8 @@
*
*/
long do_demo(struct natstr *natp, struct nstr_sect nstr, int number,
s_char *p, int for_real);
static long do_demo(struct natstr *natp, struct nstr_sect nstr, int number,
s_char *p, int for_real);
int
demo(void)
@ -82,7 +82,7 @@ demo(void)
return (int)do_demo(natp, nstr, number, p, 1);
}
long
static long
do_demo(struct natstr *natp, struct nstr_sect nstr, int number, s_char *p,
int for_real)
{

View file

@ -45,8 +45,8 @@
#include "optlist.h"
#include "commands.h"
long do_desi(struct natstr *natp, s_char *sects, s_char *deschar,
long int cash, int for_real);
static long do_desi(struct natstr *natp, s_char *sects, s_char *deschar,
long int cash, int for_real);
int
desi(void)
@ -67,7 +67,7 @@ desi(void)
return (int)do_desi(natp, player->argp[1], player->argp[2], cash, 1);
}
long
static long
do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash,
int for_real)
{

View file

@ -56,20 +56,22 @@
#include "commands.h"
#define END -1
static void prnat(natid n);
static void pr_plane(struct plnstr *plane);
static void pr_land(struct lndstr *land);
static void pr_ship(struct shpstr *ship);
static void prsect(struct sctstr *sect);
static void benefit(natid who, int good);
static int docountry(s_char op, int arg, s_char *p, float farg, natid nat,
struct natstr *np);
static int doland(s_char op, int arg, s_char *p, struct sctstr *sect);
static int doplane(s_char op, int arg, s_char *p, struct plnstr *plane);
static int doship(s_char op, int arg, s_char *p, struct shpstr *ship);
static int dounit(s_char op, int arg, s_char *p, struct lndstr *land);
static int getin(s_char **, s_char **, int *, s_char *);
static void noise(struct sctstr *sptr, int public_amt, s_char *name,
int old, int new);
static void benefit(natid who, int good);
int doland(s_char op, int arg, s_char *p, struct sctstr *sect);
int docountry(s_char op, int arg, s_char *p, float farg, natid nat,
struct natstr *np);
int doship(s_char op, int arg, s_char *p, struct shpstr *ship);
int dounit(s_char op, int arg, s_char *p, struct lndstr *land);
int doplane(s_char op, int arg, s_char *p, struct plnstr *plane);
static void pr_land(struct lndstr *land);
static void pr_plane(struct plnstr *plane);
static void pr_ship(struct shpstr *ship);
static void prnat(natid n);
static void prsect(struct sctstr *sect);
int
@ -449,7 +451,7 @@ pr_ship(struct shpstr *ship)
pr("\n");
}
int
static int
errcheck(int num, int min, int max)
{
if (num < min)
@ -459,7 +461,7 @@ errcheck(int num, int min, int max)
return (num);
}
int
static int
getin(s_char **what, s_char **p, int *arg, s_char *buf)
{
if (!(*what = getstarg(*p, "%c xxxxx -- thing value : ", buf))) {
@ -482,7 +484,7 @@ getin(s_char **what, s_char **p, int *arg, s_char *buf)
}
int
static int
doland(s_char op, int arg, s_char *p, struct sctstr *sect)
{
natid newown, oldown;
@ -684,8 +686,7 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
}
int
static int
docountry(s_char op, int arg, s_char *p, float farg, natid nat,
struct natstr *np)
{
@ -785,7 +786,7 @@ docountry(s_char op, int arg, s_char *p, float farg, natid nat,
}
int
static int
doship(s_char op, int arg, s_char *p, struct shpstr *ship)
{
coord newx, newy;
@ -957,7 +958,7 @@ doship(s_char op, int arg, s_char *p, struct shpstr *ship)
return RET_OK;
}
int
static int
dounit(s_char op, int arg, s_char *p, struct lndstr *land)
{
coord newx, newy;

View file

@ -44,6 +44,8 @@
#include "file.h"
#include "commands.h"
static int is_engineer(int, int);
int
fort(void)
{
@ -141,7 +143,7 @@ fort(void)
return RET_OK;
}
int
static int
is_engineer(int x, int y)
{
struct nstr_item ni;

View file

@ -71,6 +71,7 @@ union item_u {
struct lndstr land;
};
static void add_to_fired_queue(struct emp_qelem *, struct emp_qelem *);
static int defend(struct emp_qelem *al,
struct emp_qelem *dl,
enum targ_type target,
@ -79,6 +80,10 @@ static int defend(struct emp_qelem *al,
struct sctstr *fsect,
struct shpstr *vship,
struct shpstr *fship, int fx, int fy, int *nd);
static void do_defdam(struct emp_qelem *, double);
static int quiet_bigdef(int, struct emp_qelem *, natid, natid, coord,
coord, int *);
static void use_ammo(struct emp_qelem *);
int
multifire(void)
@ -709,7 +714,7 @@ defend(struct emp_qelem *al, struct emp_qelem *dl, enum targ_type target,
return (dam);
}
void
static void
do_defdam(struct emp_qelem *list, double odds)
{
@ -760,7 +765,7 @@ do_defdam(struct emp_qelem *list, double odds)
}
}
int
static int
quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
coord ax, coord ay, int *nfiring)
{
@ -984,7 +989,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
return ((*nfiring) == 0 ? 0 : (dam / (*nfiring)));
}
void
static void
use_ammo(struct emp_qelem *list)
{
struct emp_qelem *qp, *next;
@ -1047,7 +1052,7 @@ use_ammo(struct emp_qelem *list)
}
void
static void
add_to_fired_queue(struct emp_qelem *elem, struct emp_qelem *list)
{
struct emp_qelem *qp;

View file

@ -53,8 +53,9 @@ extern float start_education, start_happiness;
extern float start_technology, start_research;
extern int morale_base;
static void ok(s_char *map, int x, int y);
static int deity_build_land(int, coord, coord, natid, int);
static int isok(int x, int y);
static void ok(s_char *map, int x, int y);
static struct range defrealm = { -8, -5, 10, 5, 0, 0 };
@ -312,7 +313,7 @@ ok(s_char *map, int x, int y)
ok(map, diroff[dir][0] + x, diroff[dir][1] + y);
}
int
static int
deity_build_land(int type, coord x, coord y, natid own, int tlev)
{
extern int land_mob_max;

View file

@ -62,10 +62,11 @@ struct powsort {
natid cnum;
};
static int powcmp(struct powsort *p1, struct powsort *p2);
static void out5(double value, int round_val, int round_flag);
static void gen_power(void);
static void addtopow(register int *vec, register struct powstr *pow);
static void gen_power(void);
static void out5(double value, int round_val, int round_flag);
static int powcmp(struct powsort *p1, struct powsort *p2);
static int set_target(s_char *, int *);
int
powe(void)
@ -410,7 +411,7 @@ addtopow(register int *vec, register struct powstr *pow)
pow->p_power += vec[I_HCM] / 5.0;
}
int
static int
set_target(s_char *p, int *targets)
{
int target;

View file

@ -47,6 +47,8 @@
#include "commands.h"
#include "optlist.h"
static void scuttle_land(struct lndstr *);
union item_u {
struct shpstr ship;
struct plnstr plane;
@ -310,7 +312,7 @@ scuttle_ship(struct shpstr *sp)
putship(sp->shp_uid, sp);
}
void
static void
scuttle_land(struct lndstr *lp)
{
struct nstr_item ni;

View file

@ -50,6 +50,8 @@
#include "commands.h"
#include "optlist.h"
static int blankrow(s_char *);
int
sona(void)
{
@ -387,7 +389,7 @@ line_of_sight(s_char **rad, int ax, int ay, int bx, int by)
return 1;
}
int
static int
blankrow(s_char *s)
{
while (*s) {

View file

@ -53,9 +53,13 @@
* format: spy <SECTS>
*
*/
static void spyline(struct sctstr *sp);
static void insert(coord *table, int *len, coord x, coord y);
static int check(coord *table, int *len, coord x, coord y);
static void insert(coord *table, int *len, coord x, coord y);
static int num_units(int, int);
static void prplanes(int, int);
static void prunits(int, int);
static void spyline(struct sctstr *sp);
int
spy(void)
@ -256,7 +260,7 @@ check(coord *table, int *len, coord x, coord y)
return 0;
}
int
static int
num_units(int x, int y)
{
struct lndstr land;
@ -275,7 +279,7 @@ num_units(int x, int y)
return n;
}
void
static void
prunits(int x, int y)
{
struct lndstr land;
@ -311,7 +315,7 @@ prunits(int x, int y)
}
}
void
static void
prplanes(int x, int y)
{
struct plnstr plane;

View file

@ -45,6 +45,7 @@
#include "file.h"
#include "commands.h"
static void print_res(struct sctstr *);
/*
* Syntax: swap <SECT> <SECT>
@ -89,7 +90,7 @@ swaps(void)
return RET_OK;
}
void
static void
print_res(struct sctstr *sp)
{
pr("own sect eff min gold fert oil uran\n");

View file

@ -48,9 +48,13 @@
#include "damage.h"
#include "commands.h"
void anti_torp(int f, int ntorping, int vshipown);
void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range,
int ntargets);
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 int fire_torp(struct shpstr *, struct shpstr *, int, int);
s_char *prsub(struct shpstr *sp);
@ -235,7 +239,7 @@ torp(void)
return RET_OK;
}
void
static void
anti_torp(int f, int ntorping, int vshipown)
{
int range;
@ -288,7 +292,7 @@ anti_torp(int f, int ntorping, int vshipown)
}
/* Can ship A shoot at ship B? */
int
static int
canshoot(struct shpstr *a, struct shpstr *b)
{
/* Anyone can shoot a normal ship */
@ -307,7 +311,7 @@ canshoot(struct shpstr *a, struct shpstr *b)
}
/* Can ship A torp ship B? */
int
static int
cantorp(struct shpstr *a, struct shpstr *b)
{
if ((mchr[(int)a->shp_type].m_flags & M_TORP) == 0)
@ -325,7 +329,7 @@ cantorp(struct shpstr *a, struct shpstr *b)
}
/* Can ship A depth-charge (or fire guns at) ship B? */
int
static int
candchrg(struct shpstr *a, struct shpstr *b)
{
if ((mchr[(int)b->shp_type].m_flags & M_SUB) == 0) {
@ -341,7 +345,7 @@ candchrg(struct shpstr *a, struct shpstr *b)
return 1;
}
void
static void
fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
{
int dam;
@ -398,7 +402,7 @@ fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
}
}
int
static int
fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
{
extern int torpedo_damage;

View file

@ -45,6 +45,10 @@
#include "file.h"
#include "commands.h"
static int lupgr(void);
static int pupgr(void);
static int supgr(void);
int
upgr(void)
{
@ -70,7 +74,7 @@ upgr(void)
return RET_OK;
}
int
static int
lupgr(void)
{
struct sctstr sect;
@ -178,7 +182,7 @@ lupgr(void)
return RET_OK;
}
int
static int
supgr(void)
{
struct sctstr sect;
@ -272,7 +276,7 @@ supgr(void)
return RET_OK;
}
int
static int
pupgr(void)
{
struct sctstr sect;

View file

@ -44,6 +44,8 @@
#include "optlist.h"
#include "commands.h"
static int buildeff(struct sctstr *, int, double *);
int
work(void)
{
@ -122,7 +124,7 @@ work(void)
return RET_OK;
}
int
static int
buildeff(struct sctstr *sp, int work, double *money)
{
int vec[I_MAX + 1];