]> git.pond.sub.org Git - empserver/commitdiff
(at_minimum, blocksig, emp_bitinit, filelogerror, iceil, ifloor,
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 17 Dec 2003 23:13:50 +0000 (23:13 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 17 Dec 2003 23:13:50 +0000 (23:13 +0000)
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.

58 files changed:
include/prototypes.h
src/lib/commands/bomb.c
src/lib/commands/budg.c
src/lib/commands/cede.c
src/lib/commands/conv.c
src/lib/commands/demo.c
src/lib/commands/desi.c
src/lib/commands/edit.c
src/lib/commands/fort.c
src/lib/commands/mfir.c
src/lib/commands/new.c
src/lib/commands/powe.c
src/lib/commands/scut.c
src/lib/commands/sona.c
src/lib/commands/spy.c
src/lib/commands/swap.c
src/lib/commands/torp.c
src/lib/commands/upgr.c
src/lib/commands/work.c
src/lib/common/log.c
src/lib/common/maps.c
src/lib/common/path.c
src/lib/empthread/pthread.c
src/lib/gen/Makefile
src/lib/gen/iceil.c [deleted file]
src/lib/gen/mapdist.c
src/lib/gen/signal.c [deleted file]
src/lib/gen/strscan.c [deleted file]
src/lib/global/init.c
src/lib/player/init_nats.c
src/lib/player/login.c
src/lib/subs/Makefile
src/lib/subs/getbit.c
src/lib/subs/mission.c
src/lib/subs/move.c
src/lib/subs/nreport.c
src/lib/subs/plnsub.c
src/lib/subs/pr.c
src/lib/subs/radmap.c
src/lib/subs/retreat.c
src/lib/subs/sarg.c
src/lib/subs/sect.c
src/lib/subs/show.c
src/lib/subs/shpsub.c
src/lib/subs/supply.c
src/lib/subs/wire.c [deleted file]
src/lib/update/human.c
src/lib/update/land.c
src/lib/update/main.c
src/lib/update/mobility.c
src/lib/update/nat.c
src/lib/update/nav_ship.c
src/lib/update/plague.c
src/lib/update/produce.c
src/lib/update/revolt.c
src/lib/update/sail.c
src/lib/update/sect.c
src/lib/update/ship.c

index 6d30d1c78181d40f861eb603a5fe514275416fd2..9c3a86d58da19ec5fb5e3a704eaf4500e519bc4e 100644 (file)
@@ -78,7 +78,6 @@ extern emp_sig_t empth_alarm(int sig);
 
 /* src/lib/empthread/pthread.c */
 #ifdef _EMPTH_POSIX
-extern void *empth_start(void *ctx);
 extern int empth_init(char **ctx_ptr, int flags);
 extern empth_t *empth_create(int prio, void (*entry) (),
                             int size, int flags,
@@ -109,13 +108,8 @@ extern int atta(void);
 extern int bdes(void);
 extern int best(void);
 extern int boar(void);
-extern int pinflak_planedamage(struct plnstr *, struct plchrstr *, natid,
-                              int);
 extern int bomb(void);
 extern int brea(void);
-extern s_char *dotsprintf(s_char *, s_char *, int);
-extern int goodsect(char);
-extern void prexpense(long, int *, s_char, int);
 extern int budg(void);
 extern int buil(void);
 extern int buy(void);
@@ -123,10 +117,6 @@ extern int check_market(void);
 extern int capi(void);
 extern int carg(void);
 extern int lcarg(void);
-extern int cede_sect(struct nstr_sect *, natid);
-extern void grab_sect(register struct sctstr *, natid);
-extern int cede_ship(struct nstr_item *, natid);
-extern void grab_ship(register struct shpstr *, natid);
 extern int cede(void);
 extern int cens(void);
 extern void set_coastal(struct sctstr *);
@@ -135,15 +125,12 @@ extern int coas(void);
 extern int coll(void);
 extern int comm(void);
 extern int cons(void);
-extern long do_conv(struct nstr_sect, int, int);
 extern int conv(void);
 extern int coun(void);
 extern int cuto(void);
 extern int decl(void);
 extern int deli(void);
-extern long do_demo(struct natstr *, struct nstr_sect, int, s_char *, int);
 extern int demo(void);
-extern long do_desi(struct natstr *, s_char *, s_char *, long, int);
 extern int desi(void);
 extern int disa(void);
 extern int diss(void);
@@ -151,14 +138,7 @@ extern int dist(void);
 extern int drop(void);
 extern int dump(void);
 extern int echo(void);
-extern int doland(s_char, int, s_char *, struct sctstr *);
-extern int docountry(s_char, int, s_char *, float, natid, struct natstr *);
-extern int doship(s_char, int, s_char *, struct shpstr *);
-extern int dounit(s_char, int, s_char *, struct lndstr *);
-extern int doplane(s_char, int, s_char *, struct plnstr *);
 extern int edit(void);
-extern int getin(s_char **, s_char **, int *, s_char *);
-extern int errcheck(int, int, int);
 extern int enab(void);
 extern int enli(void);
 extern int explore(void);
@@ -171,7 +151,6 @@ extern int fly(void);
 extern int foll(void);
 extern int force(void);
 extern int fort(void);
-extern int is_engineer(int, int);
 extern int fuel(void);
 extern int give(void);
 extern int grin(void);
@@ -198,12 +177,7 @@ extern int map(void);
 extern int march(void);
 extern int mark(void);
 extern int display_mark(s_char *);
-extern int quiet_bigdef(int, struct emp_qelem *, natid, natid, coord,
-                       coord, int *);
 extern int multifire(void);
-extern void use_ammo(struct emp_qelem *);
-extern void do_defdam(struct emp_qelem *, double);
-extern void add_to_fired_queue(struct emp_qelem *, struct emp_qelem *);
 extern int mine(void);
 extern int landmine(void);
 extern int mission(void);
@@ -220,7 +194,6 @@ extern int navi(void);
 extern int nav_map(int, int, int);
 extern int ndump(void);
 extern int new(void);
-extern int deity_build_land(int, coord, coord, natid, int);
 extern int newe(void);
 extern int news(void);
 extern int nuke(void);
@@ -236,7 +209,6 @@ extern int pdump(void);
 extern int plan(void);
 extern int play(void);
 extern int powe(void);
-extern int set_target(s_char *, int *);
 extern int count_pop(register int);
 extern int prod(void);
 extern int pstat(void);
@@ -261,7 +233,6 @@ extern int scra(void);
 extern int scuttle_tradeship(struct shpstr *, int);
 extern int scut(void);
 extern void scuttle_ship(struct shpstr *);
-extern void scuttle_land(struct lndstr *);
 extern int sdump(void);
 extern int sct(void);
 extern int sell(void);
@@ -280,12 +251,8 @@ extern int sinfra(void);
 extern int skyw(void);
 extern int line_of_sight(s_char **rad, int ax, int ay, int bx, int by);
 extern int sona(void);
-extern int blankrow(s_char *);
 extern void plane_sona(struct emp_qelem *, int, int, struct shiplook *);
 extern int spy(void);
-extern int num_units(int, int);
-extern void prunits(int, int);
-extern void prplanes(int, int);
 extern int sstat(void);
 extern int start(void);
 extern int stop(void);
@@ -294,21 +261,14 @@ extern int starve(void);
 extern int supp(void);
 extern int surv(void);
 extern int swaps(void);
-extern void print_res(struct sctstr *);
 extern int tele(void);
 extern int tend(void);
 extern int tend_nxtitem(struct nstr_item *, caddr_t);
 extern int terr(void);
 extern int thre(void);
 extern int togg(void);
-extern void anti_torp(int, int, int);
-extern void fire_dchrg(struct shpstr *, struct shpstr *, int, int);
 extern s_char *prsub(struct shpstr *);
 extern int torp(void);
-extern int canshoot(struct shpstr *, struct shpstr *);
-extern int cantorp(struct shpstr *, struct shpstr *);
-extern int fire_torp(struct shpstr *, struct shpstr *, int, int);
-extern int candchrg(struct shpstr *, struct shpstr *);
 extern int trad(void);
 extern int check_trade(void);
 extern int ontradingblock(int, int *);
@@ -318,15 +278,11 @@ extern int trea(void);
 extern int turn(void);
 extern int upda(void);
 extern int upgr(void);
-extern int supgr(void);
-extern int pupgr(void);
-extern int lupgr(void);
 extern int vers(void);
 extern int wai(void);
 extern int wing(void);
 extern int wipe(void);
 extern int work(void);
-extern int buildeff(struct sctstr *, int, double *);
 extern int zdon(void);
 
 /*
@@ -377,11 +333,8 @@ extern int adj_units(coord, coord, natid);
 /* log.c */
 extern void loginit(void);
 extern void logerror(s_char *, ...);
-extern void filelogerror(s_char *, ...);
 /* maps.c */
 extern int draw_map(int, s_char, int, struct nstr_sect *, int);
-extern int bmnxtsct(register struct nstr_sect *);
-extern void bitinit2(struct nstr_sect *, u_char *, int);
 extern int unit_map(int, int, struct nstr_sect *, s_char *);
 extern int bmaps_intersect(natid, natid);
 extern int share_bmap(natid, natid, struct nstr_sect *, s_char, s_char *);
@@ -392,8 +345,6 @@ extern s_char *decodep(long, void *);
 extern int decode(natid, long, void *, int);
 extern int nstr_exec(struct nscstr *, register int, void *, int);
 /* path.c */
-extern s_char *bp_init(void);
-extern int best_path(struct sctstr *, struct sctstr *, s_char *, int);
 extern void bp_enable_cachepath();
 extern void bp_disable_cachepath();
 extern void bp_clear_cachepath();
@@ -469,8 +420,6 @@ extern int getfdtablesize(void);
 extern void setfdtablesize(int, int);
 extern s_char *getstarg(s_char *, s_char *, s_char *);
 extern s_char *getstring(s_char *, s_char *);
-extern int ifloor(double);
-extern int iceil(double);
 #if !defined(_WIN32)
 extern s_char *inet_ntoa(struct in_addr);
 #endif
@@ -481,7 +430,6 @@ extern int diffy(int, int);
 extern int deltax(int, int);
 extern int deltay(int, int);
 extern int mapdist(int, int, int, int);
-extern int mapdsq(int, int, int, int);
 extern double dmin(double, double);
 #if !defined(_WIN32)
 extern int max(int, int);
@@ -501,23 +449,15 @@ extern int ldround(double, int);
 extern int roundintby(int, int);
 extern int same(register s_char *, register s_char *);
 extern int scthash(register int, register int, int);
-extern void blocksig(void);
-extern void unblocksig(void);
-extern const s_char *signame(int);
 #ifdef NOSTRDUP
 extern char *strdup(char *x);
 #endif
-extern int strscan(s_char *target, s_char *string);
 
 
 /*
  * src/lib/global/ *.c 
  */
 extern void global_init(void);
-extern void init_pchr(void);
-extern void init_mchr(void);
-extern void init_plchr(void);
-
 
 
 /*
@@ -548,18 +488,8 @@ extern int getminleft(time_t, int *, int *);
 /* empmod.c */
 /* init_nats.c */
 extern int init_nats(void);
-extern int nat_cap(int);
 /* login.c */
 extern void player_login(void *);
-extern int client_cmd(struct player *, int, char **);
-extern int user_cmd(struct player *, int, char **);
-extern int sanc_cmd(struct player *, int, char **);
-extern int coun_cmd(struct player *, int, char **);
-extern int pass_cmd(struct player *, int, char **);
-extern int play_cmd(struct player *, int, char **);
-extern int kill_cmd(struct player *, int, char **);
-extern int list_cmd(struct player *, int, char **);
-extern int quit_cmd(struct player *, int, char **);
 /* nat.c */
 extern int natbyname(s_char *, natid *);
 extern int natpass(int, s_char *);
@@ -610,7 +540,6 @@ extern int shipdef(natid, natid, coord, coord);
 extern int emp_getbit(int, int, u_char *);
 extern void emp_setbit(int, int, u_char *);
 extern void emp_setbitmap(int, int, u_char *, int *);
-extern void emp_bitinit(struct nstr_sect *, u_char *);
 /* getele.c */
 extern int getele(s_char *, s_char *);
 /* land.c */
@@ -636,35 +565,19 @@ extern int islist(s_char *);
 extern s_char *mission_name(short);
 extern s_char *nameofitem(s_char *, struct genitem *, int);
 extern int collateral_damage(coord, coord, int, struct emp_qelem *);
-extern int dosupport(struct genlist *, coord, coord, natid, natid);
-extern void build_mission_list(struct genlist *, coord, coord, int, natid);
-extern void build_mission_list_type(struct genlist *, coord, coord, int,
-                                   int, natid);
-extern int perform_mission(coord, coord, natid, struct emp_qelem *, int,
-                          s_char *, int);
-extern void mission_pln_sel(struct emp_qelem *, int, int, int);
-extern int mission_pln_arm(struct emp_qelem *, coord, coord, int,
-                          int, struct ichrstr *, int, int, int *);
 extern int mission_pln_equip(struct plist *, struct ichrstr *, int,
                             s_char);
-extern int find_airport(struct emp_qelem *, coord, coord);
-extern void add_airport(struct emp_qelem *, coord, coord);
-extern void divide(struct emp_qelem *, struct emp_qelem *, coord, coord);
-extern int air_damage(struct emp_qelem *, coord, coord, int, natid,
-                     s_char *, int);
 extern int ground_interdict(coord, coord, natid, s_char *);
 extern int unit_interdict(coord, coord, natid, s_char *, int, int);
 extern int off_support(coord, coord, natid, natid);
 extern int def_support(coord, coord, natid, natid);
 extern int oprange(struct genitem *, int, int *);
-extern void find_escorts(coord, coord, natid, struct emp_qelem *);
 extern int cando(int, int);
 extern s_char *mission_short_name(int);
 extern void show_mission(int, struct nstr_item *);
 extern int air_defense(coord, coord, natid, struct emp_qelem *,
                       struct emp_qelem *);
 /* move.c */
-extern int move_map(s_char *, coord, coord, s_char *);
 extern int check_lmines(coord, coord, double);
 extern int move_ground(s_char *, struct sctstr *, struct sctstr *,
                       double, double, s_char *,
@@ -689,7 +602,6 @@ extern int natarg(s_char *, s_char *);
 extern int neigh(coord, coord, natid);
 /* nreport.c */
 extern void nreport(natid, int, natid, int);
-extern void filereport(int, int, int, int);
 /* nuke.c */
 extern int nuk_postread(int, s_char *);
 extern int nuk_prewrite(int, s_char *);
@@ -707,7 +619,6 @@ extern int pln_prewrite(int, s_char *);
 extern void pln_init(int, s_char *);
 /* plnsub.c */
 extern void count_planes(struct shpstr *);
-extern int pln_equip(struct plist *, struct ichrstr *, int, s_char);
 extern int pln_onewaymission(struct sctstr *, int *, int *);
 extern void pln_newlanding(struct emp_qelem *, coord, coord, int);
 extern int can_be_on_ship(int, int);
@@ -739,7 +650,6 @@ extern void pr_inform(struct player *, s_char *, ...);
 extern void pr_wall(s_char *, ...);
 extern void pr_player(struct player *pl, int id, s_char *buf);
 extern void pr_hilite(s_char *buf);
-extern void outid(struct player *pl, int n);
 extern void prredir(s_char *redir);
 extern void prexec(s_char *file);
 extern void prprompt(int min, int btu);
@@ -753,7 +663,6 @@ extern void pr_beep(void);
 extern void mpr(int, s_char *, ...);
 
 /* radmap.c */
-extern void radmap2(int, int, int, int, int, double, int);
 extern int deltx(struct range *, coord);
                /* Prototype include a typedef name.
                   It should be moved after the typedef declaration */
@@ -769,16 +678,12 @@ extern int setcont(natid, natid, int);
 extern int setrej(natid, natid, int, int);
 /* retreat.c */
 extern void retreat_ship(struct shpstr *, s_char);
-extern int retreat_ship1(struct shpstr *, s_char, int);
-extern int findcondition(s_char);
 extern void retreat_land(struct lndstr *, s_char);
-extern int retreat_land1(struct lndstr *, s_char, int);
 extern int check_retreat_and_do_shipdamage(struct shpstr *, int);
 extern int check_retreat_and_do_landdamage(struct lndstr *, int);
 /* sarg.c */
 extern int sarg_type(s_char *);
 extern int sarg_xy(s_char *, coord *, coord *);
-extern int sarg_getrange(s_char *, register struct range *);
 extern int sarg_area(s_char *, register struct range *);
 extern int sarg_range(s_char *, coord *, coord *, int *);
 extern int sarg_list(s_char *, register int *, int);
@@ -788,7 +693,6 @@ extern void satmap(int, int, int, int, int, int);
 extern void sathead(void);
 /* sect.c */
 extern int sct_postread(int, s_char *);
-extern int checksect(struct sctstr *);
 extern int sct_prewrite(int, s_char *);
 extern int issector(s_char *);
 extern void sct_init(coord, coord, s_char *);
@@ -798,7 +702,6 @@ extern int shp_postread(int, s_char *);
 extern int shp_prewrite(int, s_char *);
 extern void shp_init(int, s_char *);
 /* show.c */
-extern void sort_lookup_list(void);
 extern void show_bridge(int);
 extern void show_tower(int);
 extern void show_item(int);
@@ -820,15 +723,9 @@ extern void show_sect_capab(int);
 /* shpsub.c */
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
 extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);
-extern int shp_check_one_mines(struct mlist *);
 extern int shp_sweep(struct emp_qelem *, int, natid);
-extern int shp_interdict(struct emp_qelem *, coord, coord, natid);
-extern void shp_mess(s_char *, struct mlist *);
-extern int shp_check_mines(struct emp_qelem *);
-extern int shp_check_nav(struct sctstr *);
 extern s_char *shp_path(int, struct shpstr *, s_char *);
 extern void shp_put(struct emp_qelem *, natid);
-extern int shp_hit_mine(struct shpstr *, struct mchrstr *);
 extern void shp_list(struct emp_qelem *);
 extern int shp_hardtarget(struct shpstr *);
 extern void shp_view(struct emp_qelem *);
@@ -842,12 +739,8 @@ extern int snxtsct(register struct nstr_sect *, s_char *);
 /* supply.c */
 extern void resupply_all(struct lndstr *);
 extern void resupply_commod(struct lndstr *, int);
-extern int get_minimum(struct lndstr *, int);
 extern int supply_commod(int, int, int, int, int);
-extern int s_commod(int, int, int, int, int, int);
 extern int try_supply_commod(int, int, int, int, int);
-extern s_char *itemname(int);
-extern int at_minimum(struct lndstr *, int);
 extern int has_supply(struct lndstr *);
 extern int use_supply(struct lndstr *);
 /* takeover.c */
@@ -867,8 +760,6 @@ extern struct ichrstr *whichitem(char);
 extern int trechk(register natid, register natid, int);
 /* whatitem.c */
 extern struct ichrstr *whatitem(s_char *, s_char *);
-/* wire.c */
-extern int typed_wire(natid, natid, s_char *, int);
 /* wu.c */
 extern void clear_telegram_is_new(natid);
 extern int typed_wu(natid, natid, s_char *, int);
@@ -896,39 +787,21 @@ extern void finish_sects(int);
 /* human.c */
 extern int do_feed(register struct sctstr *, register struct natstr *,
                   int *, int *, int *, int);
-extern int growfood(struct sctstr *, register int *, int, int);
 extern int feed_people(register int *, int, int *);
-extern void starvation(struct sctstr *);
-extern int grow_people(struct sctstr *, register int,
-                      register struct natstr *, int *, int,
-                      register int *);
-extern void trunc_people(struct sctstr *, register struct natstr *,
-                        register int *);
 /* land.c */
-extern void upd_land(register struct lndstr *, int, register int,
-                    struct natstr *, int *, int);
 extern int prod_land(int, int, int *, int);
-extern int landrepair(register struct lndstr *, int *, struct natstr *,
-                     int *, int);
 extern int feed_land(struct lndstr *, register int *, int, int *, int);
 extern int plague_land(struct lndstr *, struct natstr *, register int *,
                       register int *, int);
 /* main.c */
 extern void update_main(void *);
-extern void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
-                   int *, int *, int *, int *);
 /* material.c */
 extern void get_materials(struct sctstr *, int *, int *, int);
 /* mobility.c */
 extern void mob_sect(register int);
-extern void do_mob_sect(register struct sctstr *, register int);
 extern void mob_ship(register int);
-extern void do_mob_ship(register struct shpstr *, register int);
 extern void mob_land(register int);
-extern void do_mob_land(register struct lndstr *, register int);
 extern void mob_plane(register int);
-extern void do_mob_plane(register struct plnstr *, register int);
-extern void do_mob_sect(register struct sctstr *sp, register int etus);
 extern void update_all_mob(void);
 extern void update_timestamps(time_t offset);
 extern void sct_do_upd_mob(register struct sctstr *sp);
@@ -939,12 +812,8 @@ extern void pln_do_upd_mob(register struct plnstr *pp);
 extern void move_sat(register struct plnstr *);
 /* nat.c */
 extern double logx(double, double);
-extern double limit_level(double, int, int);
 extern void prod_nat(int);
-extern void share_incr(register double *, register double *);
 /* nav_ship.c */
-extern void scuttle_it(register struct shpstr *);
-extern void swap(register struct shpstr *);
 extern int nav_ship(register struct shpstr *);
 /* nav_util.c */
 extern int check_nav(struct sctstr *);
@@ -959,8 +828,6 @@ extern s_char *nxtitemp(struct nstr_item *, int);
 extern struct sctstr *nxtsctp(register struct nstr_sect *);
 /* plague.c */
 extern void do_plague(struct sctstr *, struct natstr *, int);
-extern int infect_people(struct natstr *, register int *, u_int, int,
-                        struct sctstr *);
 extern int plague_people(struct natstr *, register int *, register int *,
                         int);
 /* plane.c */
@@ -979,35 +846,22 @@ extern int bank_income(struct sctstr *, int);
 /* produce.c */
 extern int produce(struct natstr *, struct sctstr *, int *, int, int, int,
                   int, int *, int *);
-extern int materials_cost(struct pchrstr *, register int *, int *);
-extern void materials_charge(struct pchrstr *, register int *,
-                            register int);
 /* removewants.c */
 extern int update_removewants(void);
 /* revolt.c */
-extern void take_casualties(struct sctstr *, int);
 extern void revolt(struct sctstr *);
 extern void guerrilla(struct sctstr *);
 /* sail.c */
-extern void fltp_to_list(struct fltheadstr *, struct emp_qelem *);
 extern void sail_ship(natid);
 /* sect.c */
 extern int dodeliver(struct sctstr *, int *);
-extern int upd_buildeff(struct natstr *, register struct sctstr *, int *,
-                       int *, int, int *, int, int *);
-extern int enlist(register int *, int, int *);
-extern void meltitems(int, int, int, int *, int, int, int, int);
 extern void do_fallout(register struct sctstr *, register int);
 extern void spread_fallout(struct sctstr *, int);
 extern void decay_fallout(struct sctstr *, int);
 extern void produce_sect(int natnum, int etu, int *bp,
                         long int (*p_sect)[2], int sector_type);
 /* ship.c */
-extern void upd_ship(register struct shpstr *, int, register int,
-                    struct natstr *, int *, int);
 extern int prod_ship(int, int, int *, int);
-extern int shiprepair(register struct shpstr *, int *, struct natstr *,
-                     int *, int);
 extern int feed_ship(struct shpstr *, register int *, int, int *, int);
 
 /*
index ceb5951eb5a6106de20572e04ae1551caa0006ea..1cf4832d02e6caf54cd3bb13a558acc41209e5dd 100644 (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)
 {
index 0a0d00ceef4d975a18c7823d17fad05e4b339f51..66046bdd3d508825b8bfc32b15879f12b3b83d2f 100644 (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) {
index b0a5952800445750b3f99a46e8e09528526b0553..5cfd5ba509476c84ce86159bbbeaa2518aa14974 100644 (file)
 #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;
index ddb265d29e0eadbcf33cd9562e74474bfcaf3b82..3cdd7904a5220f872e188a86dbd3ffbf03de121b 100644 (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;
index e49d7e43f123c19950cbe980c0e60429c29cf195..ec6d628d574aa891e3e86fc677e8cb8bd7b32061 100644 (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)
 {
index e816cb3c0382fe0e37ed07489d346032384e6939..0e5fde4d6e13cb93ed5bb158233c85785edcd32c 100644 (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)
 {
index b6755f553dd3346ee965baf34d7386f62a7e9f1d..42b88273fe7b2ca50b332fecc98ac0b4f689f1ef 100644 (file)
 #include "commands.h"
 
 #define END -1
-static void prnat(natid n);
-static void pr_plane(struct plnstr *plane);
+
+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 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);
-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);
 
 
 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;
index 7e8d0721fe6c42eb38018f6cd6c5ec26973e5667..0c5835efd205230126e825b4b46522f9409d1374 100644 (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;
index f91e413cb8ff8ab271a88bdfaee40a4f97008eb3..8e10e6aa43d8483a05c81a57745cd49da23de11d 100644 (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;
index 721d37cb555b3a4b241e51c92e20abe5bc90954f..c11ce30eaef691d445fcbb8a2de8fa1a011da5c5 100644 (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;
index 578de0402617176db9431850f0ea32ef0e43eee1..800ce8c2fd88f188a8ac0ba321b05c0aa5bc2535 100644 (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;
index 97510df74d2184a2e32e09f4d61518de18c60985..870dce735a57d8df7a3c9d769182e1e9d2dfe3cb 100644 (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;
index d924f1efbc4a2af2e7cbe8b009ddd9e72cbcfe47..699f81873663eba8207705babaffeb78a4d43099 100644 (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) {
index a8ae160c9083a1304562fdd8a93c5e78fce1d797..54e296880283f8c1820c32f8c1ec1203f6e0a033 100644 (file)
  * 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;
index 85953e553decb3c3090896ff29defcc14df804a7..f7920a0fde273936128bbee0ce7b05e681b74921 100644 (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");
index cb51043e9da365008dbb6fdfaa14982578cd0f15..8e8b965858eaf5885229c1bb90b8aedb8bf54346 100644 (file)
 #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;
index 125c7daa672f5cf21c1121c073f1c9cbfa860bf6..e9f4b8e911586ae23a007db3cbf306543117ca5a 100644 (file)
 #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;
index 629c9079ee9ed57761c6db4bb0375dc77bceccf3..3f7725103b41e0a0255eb267ff435ade56308d61 100644 (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];
index 69cfcbaf9ad5aaf47a3c5a0eed2366c7cdc440cd..6acd7b285d18c5036eb2d2781dcc335d0ae92dc1 100644 (file)
@@ -120,41 +120,3 @@ logerror(s_char *format, ...)
 #endif
     va_end(list);
 }
-
-/*VARARGS*/
-void
-filelogerror(s_char *format, ...)
-{
-#if !defined(Rel4) && !defined(__linux__) && !defined(__ppc__)
-    extern s_char *sys_errlist[];
-#endif /* Rel4 */
-    va_list list;
-    time_t now;
-    s_char buf[512];
-    s_char buf1[512];
-    int logf;
-    s_char *error;
-    s_char *p;
-
-    if (logfile == 0)
-       loginit();
-    va_start(list, format);
-    vsprintf(buf, format, list);
-    if ((p = index(buf, '\n')) != 0)
-       *p = 0;
-    (void)time(&now);
-    error = "log";
-    if (errno != 0)
-#ifdef Rel4
-       error = strerror(errno);
-#else
-       error = (s_char *)sys_errlist[errno];
-#endif /* Rel4 */
-    (void)sprintf(buf1, "%s; (%s) %s", buf, error, ctime(&now));
-    if ((logf = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0666)) < 0)
-       return;
-    (void)write(logf, buf1, strlen(buf1));
-    (void)close(logf);
-    errno = 0;
-    va_end(list);
-}
index 8613c771ff70279411eb3b931bd020f15e633c49..593189790e7e6533ee4104470b32598fb87ec8f5 100644 (file)
@@ -50,6 +50,9 @@
 #include "subs.h"
 #include "optlist.h"
 
+static void bitinit2(struct nstr_sect *, u_char *, int);
+static int bmnxtsct(register struct nstr_sect *);
+
 int
 draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
         int country)
@@ -274,7 +277,7 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
 /*
  * get the next sector in the range
  */
-int
+static int
 bmnxtsct(register struct nstr_sect *np)
 {
     while (1) {
@@ -305,7 +308,7 @@ bmnxtsct(register struct nstr_sect *np)
     /*NOTREACHED*/
 }
 
-void
+static void
 bitinit2(struct nstr_sect *np, u_char *bitmap, int country)
 {
     extern int *bitmaps[];
index 8e6be460efc4767b713e120b28870e1c1dab0495..c31fc7251220a0079f96e6c9e258bbbd594e46d8 100644 (file)
@@ -107,7 +107,7 @@ struct empfile *ep;
  * at reboot time (maybe) so we never need to free it */
 struct sctstr **neighsects = (struct sctstr **)0;
 
-s_char *
+static s_char *
 bp_init(void)
 {
     struct bestp *bp;
@@ -135,7 +135,7 @@ bp_init(void)
  * Find the best path from sector to to sector, and put the Empire movement
  * string in path.  Return 0 on success, -1 on error.
  */
-int
+static int
 best_path(struct sctstr *from, struct sctstr *to, s_char *path,
          int mob_type)
 {
index 057102b79ab461dc8b86f76fd64d6dd384cdae13..8f190cbf48b4df4c76e06b94b71f4f589f961060 100644 (file)
@@ -61,7 +61,7 @@ static void empth_setctx _PROTO((void *));
 #endif
 static void empth_restorectx _PROTO(());
 
-void *
+static void *
 empth_start(void *ctx)
 {
     struct sigaction act;
index 0c581ba49e6d0a845409f301ae6cb29241ef5bf4..cb972b407d52a6ba53e5da9910b0cc5c3dc610f0 100644 (file)
@@ -36,16 +36,16 @@ LIB = $(SRCDIR)/lib/libgen.a
 NTLIB = $(SRCDIR)\lib\libgen.lib
 
 OBJS =  atoip.o atopi.o bit.o chance.o copy.o disassoc.o dtable.o \
-       emp_config.o getstarg.o getstring.o hpux.o iceil.o inet.o io.o \
+       emp_config.o getstarg.o getstring.o hpux.o inet.o io.o \
        io_mask.o ioqueue.o lock.o mapdist.o minmax.o numstr.o onearg.o \
-       parse.o plur.o queue.o round.o same.o scthash.o signal.o \
-       strdup.o strscan.o vsprintf.o
+       parse.o plur.o queue.o round.o same.o scthash.o \
+       strdup.o vsprintf.o
 
 NTOBJS = atoip.obj atopi.obj bit.obj chance.obj copy.obj disassoc.obj \
-       dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj iceil.obj \
+       dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj \
        inet.obj io.obj io_mask.obj ioqueue.obj lock.obj mapdist.obj minmax.obj \
        numstr.obj onearg.obj parse.obj plur.obj queue.obj round.obj same.obj \
-       scthash.obj signal.obj strdup.obj strscan.obj vsprintf.obj
+       scthash.obj strdup.obj vsprintf.obj
 
 all: $(LIB)
 
diff --git a/src/lib/gen/iceil.c b/src/lib/gen/iceil.c
deleted file mode 100644 (file)
index bc11c18..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  ---
- *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
- *
- *  ---
- *
- *  iceil.c: integer ceiling/floor functions
- * 
- *  Known contributors to this file:
- *     
- */
-
-#include "gen.h"
-
-int
-iceil(double arg)
-{
-    register int i;
-
-    i = arg;
-    return (i >= arg ? i : i + 1);
-}
-
-int
-ifloor(double arg)
-{
-    register int i;
-
-    i = arg;
-    return (i <= arg ? i : i - 1);
-}
index ab9b5e9ce891714dc051fd1a0308e172a9ea6c1c..0ddb0a79aedb5bddf38359ea0f5f02340489f259 100644 (file)
@@ -33,7 +33,6 @@
 
 /*
  * mapdist returns (integer) distance between two sectors.
- * mapdsq returns the square of the distance -- more efficient.
  */
 
 #include "misc.h"
@@ -107,12 +106,3 @@ mapdist(int x1, int y1, int x2, int y2)
        return (dx - dy) / 2 + dy;
     return dy;
 }
-
-int
-mapdsq(int x1, int y1, int x2, int y2)
-{
-    int sq;
-
-    sq = mapdist(x1, y1, x2, y2);
-    return sq * sq;
-}
diff --git a/src/lib/gen/signal.c b/src/lib/gen/signal.c
deleted file mode 100644 (file)
index f5c8a7c..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  ---
- *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
- *
- *  ---
- *
- *  sig.c: block and unblock signals for critical sections
- * 
- *  Known contributors to this file:
- *     Doug Hay, 1998
- *     Steve McClure, 1998
- */
-
-#include "misc.h"
-#include "gen.h"
-#include <signal.h>
-
-u_int mask;
-
-void
-blocksig(void)
-{
-#if !defined(_WIN32)
-    mask = sigsetmask(0xffffffff);
-#endif
-}
-
-void
-unblocksig(void)
-{
-#if !defined(_WIN32)
-    sigsetmask(mask);
-#endif
-}
-
-#ifdef sys5
-const s_char *sys_siglist[] = {
-    "no signal",
-    "interrupt",
-    "quit",
-    "illegal instruction",
-    "trace trap",
-    "IOT instruction",
-    "system crash imminent",
-    "floating point exception",
-    "kill",
-    "bus error",
-    "segmentation violation",
-    "bad argument to system call",
-    "write on a pipe with no one to read it",
-    "alarm clock",
-    "software termination",
-    "user defined signal 1",
-    "user defined signal 2",
-    "death of a child",
-    "power-fail restart",
-    "asychronous i/o",
-    "PTY read/write",
-    "I/O intervention required",
-    "monitor mode granted",
-    "monitor mode retracted",
-    "sound ack",
-    "data pending",
-};
-#else
-#if (!defined __ppc__) && (!defined linux) && (!defined FBSD) && (!defined __linux__)
-/* linux and osx declare sys_siglist in signal.h */
-extern s_char *sys_siglist[];
-#endif /* linux */
-#endif /* sys5 */
-
-const s_char *
-signame(int sig)
-{
-#ifdef POSIX_SIGNALS
-    if (sig <= 0 || sig > _sys_nsig)
-       return "bad signal";
-    return _sys_siglist[sig];
-#else  /* POSIX_SIGNALS */
-    if (sig <= 0 || sig > NSIG)
-       return "bad signal";
-    return sys_siglist[sig];
-#endif /* POSIX_SIGNALS */
-}
diff --git a/src/lib/gen/strscan.c b/src/lib/gen/strscan.c
deleted file mode 100644 (file)
index 2e153c2..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  ---
- *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
- *
- *  ---
- *
- *  strscan.c: scan a string for any occurence of another string
- * 
- *  Known contributors to this file:
- *     Steve McClure, 2000
- */
-
-#ifdef Rel4
-#include <string.h>
-#endif /* Rel4 */
-#include <stdio.h>
-#include "misc.h"
-
-int
-strscan(s_char *target, s_char *string)
-{
-    int i, n, delta;
-
-    if ((string == NULL) || (target == NULL))
-       return (1);
-    n = strlen(target);
-    delta = strlen(string);
-    if (delta < n)
-       return (1);
-    delta -= n;
-    for (i = 0; i <= delta; i++) {
-       if (!strncmp(target, &(string[i]), n))
-           return (0);
-    }
-    return (1);
-}
index bc661c90640e846ac2180a6d38290d097adaadca..9e2ecebcf5713fe8b707d68ea4bbdaea81147454 100644 (file)
 #include "optlist.h"
 #include "global.h"
 
+static void init_mchr(void);
+static void init_pchr(void);
+static void init_plchr(void);
+
 void
 global_init(void)
 {
@@ -50,7 +54,7 @@ global_init(void)
     /* the same thing should be done for units... */
 }
 
-void
+static void
 init_mchr(void)
 {
     register struct mchrstr *mp;
@@ -68,7 +72,7 @@ init_mchr(void)
     }
 }
 
-void
+static void
 init_plchr(void)
 {
     register struct plchrstr *pp;
@@ -80,7 +84,7 @@ init_plchr(void)
     }
 }
 
-void
+static void
 init_pchr(void)
 {
     register struct pchrstr *p;
index dd1a213b516ea7ee324794079e4f85afdd79b04c..2c4b0ddecb066b8876edd98f497e46b09df9af46 100644 (file)
@@ -44,6 +44,8 @@
 #include "common.h"
 #include "gen.h"
 
+static int nat_cap(int);
+
 int
 init_nats(void)
 {
@@ -69,7 +71,7 @@ init_nats(void)
     return 0;
 }
 
-int
+static int
 nat_cap(int btu)
 {
     extern int s_p_etu;
index 5b3dfcdb2ffdc304c1efbaa1bde5406382a881e6..490f7ff635baae831443ff89879254915ed2e529 100644 (file)
@@ -112,7 +112,7 @@ player_login(void *ud)
     /*NOTREACHED*/
 }
 
-int
+static int
 client_cmd(struct player *player, int ac, char **av)
 {
     int i;
@@ -130,7 +130,7 @@ client_cmd(struct player *player, int ac, char **av)
     return RET_OK;
 }
 
-int
+static int
 user_cmd(struct player *player, int ac, char **av)
 {
     if (ac < 1 || av[1] == '\0')
@@ -141,7 +141,7 @@ user_cmd(struct player *player, int ac, char **av)
     return RET_OK;
 }
 
-int
+static int
 sanc_cmd(struct player *player, int ac, char **av)
 {
     struct nstr_item ni;
@@ -171,7 +171,7 @@ sanc_cmd(struct player *player, int ac, char **av)
     return RET_OK;
 }
 
-int
+static int
 coun_cmd(struct player *player, int ac, char **av)
 {
     natid cnum;
@@ -188,7 +188,7 @@ coun_cmd(struct player *player, int ac, char **av)
     return 0;
 }
 
-int
+static int
 pass_cmd(struct player *player, int ac, char **av)
 {
     if (ac < 1 || av[1] == '\0')
@@ -210,7 +210,7 @@ pass_cmd(struct player *player, int ac, char **av)
 }
 
 /*ARGSUSED*/
-int
+static int
 play_cmd(struct player *player, int ac, char **av)
 {
     extern char *banfil;
@@ -260,7 +260,7 @@ play_cmd(struct player *player, int ac, char **av)
 }
 
 /*ARGSUSED*/
-int
+static int
 kill_cmd(struct player *player, int ac, char **av)
 {
     struct player *other;
@@ -280,7 +280,7 @@ kill_cmd(struct player *player, int ac, char **av)
 }
 
 /*ARGSUSED*/
-int
+static int
 list_cmd(struct player *player, int ac, char **av)
 {
     struct player *lp;
@@ -303,7 +303,7 @@ list_cmd(struct player *player, int ac, char **av)
 }
 
 /*ARGSUSED*/
-int
+static int
 quit_cmd(struct player *player, int ac, char **av)
 {
     pr_id(player, C_EXIT, "so long\n");
index 044f063da760ff03b3d9d47c27e948b00dfddf7f..966d3078a54b4a5cb95fb94bf9eba14d102b012b 100644 (file)
@@ -42,7 +42,7 @@ OBJS = aircombat.o askyn.o aswplnsubs.o attsub.o bigmap.o border.o bsanct.o \
        neigh.o nreport.o nstr.o nuke.o nxtitem.o nxtsct.o paths.o plane.o \
        plnsub.o pr.o radmap.o rej.o retreat.o sarg.o satmap.o \
        sect.o ship.o show.o shpsub.o snxtitem.o snxtsct.o supply.o \
-       takeover.o trdsub.o trechk.o whatitem.o wire.o wu.o
+       takeover.o trdsub.o trechk.o whatitem.o wu.o
 
 NTOBJS = aircombat.obj askyn.obj aswplnsubs.obj attsub.obj bigmap.obj \
        border.obj bsanct.obj caploss.obj chkmoney.obj cnumb.obj comsub.obj \
@@ -53,7 +53,7 @@ NTOBJS = aircombat.obj askyn.obj aswplnsubs.obj attsub.obj bigmap.obj \
        plnsub.obj pr.obj radmap.obj rej.obj retreat.obj sarg.obj satmap.obj \
        sect.obj ship.obj show.obj shpsub.obj snxtitem.obj \
        snxtsct.obj supply.obj takeover.obj trdsub.obj trechk.obj whatitem.obj \
-       wire.obj wu.obj
+       wu.obj
 
 all: $(LIB)
 
index ce4994a429289e811673c8d5b71d0902b986188d..b5e099c45d62432774e588e6ccf374ddc7724f55 100644 (file)
@@ -78,29 +78,6 @@ emp_setbitmap(register int x, register int y, register u_char *bitmap,
 }
 
 
-/*
- * if we're not player->god, we have to set up the bitmaps
- * correctly for the owned sectors.  If we are player->god,
- * forego all this (expensive) nonsense!
- */
-void
-emp_bitinit(struct nstr_sect *np, u_char *bitmap)
-{
-    extern int *bitmaps[];
-    struct sctstr sect;
-    int eff;
-
-    while (nxtsct(np, &sect)) {
-       if (!player->owner)
-           continue;
-       eff = sect.sct_effic / 20;
-       if (eff > 4)
-           eff = 4;
-       emp_setbitmap(np->x, np->y, bitmap, bitmaps[eff]);
-    }
-    snxtsct_rewind(np);
-}
-
 /*
  *
  * the bit offsets for each bit pattern based on the efficiency of
index 285cd5fe36fc906aace770d97f1f25040c0f4d44..8f080d46ac309c6e100ff7a0604e1961fdcfc911 100644 (file)
@@ -63,8 +63,20 @@ struct airport {
     natid own;
 };
 
-s_char *mission_name(short int mission);
-s_char *nameofitem(s_char *buf, struct genitem *gp, int type);
+static void add_airport(struct emp_qelem *, coord, coord);
+static int air_damage(struct emp_qelem *, coord, coord, int, natid,
+                     s_char *, int);
+static void build_mission_list(struct genlist *, coord, coord, int, natid);
+static void build_mission_list_type(struct genlist *, coord, coord, int,
+                                   int, natid);
+static void divide(struct emp_qelem *, struct emp_qelem *, coord, coord);
+static int dosupport(struct genlist *, coord, coord, natid, natid);
+static int find_airport(struct emp_qelem *, coord, coord);
+static int mission_pln_arm(struct emp_qelem *, coord, coord, int,
+                          int, struct ichrstr *, int, int, int *);
+static void mission_pln_sel(struct emp_qelem *, int, int, int);
+static int perform_mission(coord, coord, natid, struct emp_qelem *, int,
+                          s_char *, int);
 
 /*
  * Interdict commodities & transported planes
@@ -250,7 +262,7 @@ def_support(coord x, coord y, natid victim, natid actee)
     return dam;
 }
 
-int
+static int
 dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee)
 {
     register int cn;
@@ -274,7 +286,7 @@ dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee)
     return dam;
 }
 
-void
+static void
 build_mission_list(struct genlist *mi, coord x, coord y, int mission,
                   natid victim)
 {
@@ -283,7 +295,7 @@ build_mission_list(struct genlist *mi, coord x, coord y, int mission,
     build_mission_list_type(mi, x, y, mission, EF_PLANE, victim);
 }
 
-void
+static void
 build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
                        int type, natid victim)
 {
@@ -394,7 +406,7 @@ build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
     }
 }
 
-void
+static void
 find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts)
 {
     struct nstr_item ni;
@@ -424,7 +436,7 @@ find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts)
     }
 }
 
-int
+static int
 perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
                int mission, s_char *s, int hardtarget)
 {
@@ -1004,7 +1016,7 @@ oprange(struct genitem *gp, int type, int *radius)
  *  Remove all planes who cannot go on
  *  the mission from the plane list.
  */
-void
+static void
 mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
                int hardtarget)
 {
@@ -1196,7 +1208,7 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
  * Arm only the planes at x,y
  *
  */
-int
+static int
 mission_pln_arm(struct emp_qelem *list, coord x, coord y, int dist,
                int mission, struct ichrstr *ip, int flags,
                int mission_flags, int *tech)
@@ -1364,7 +1376,7 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
 /*
  *  Return 1 if this x,y pair is in the list
  */
-int
+static int
 find_airport(struct emp_qelem *airp, coord x, coord y)
 {
     struct emp_qelem *qp;
@@ -1380,7 +1392,7 @@ find_airport(struct emp_qelem *airp, coord x, coord y)
 }
 
 /* #*# This needs to be changed to include acc's -KHS */
-void
+static void
 add_airport(struct emp_qelem *airp, coord x, coord y)
 {
     struct airport *a;
@@ -1400,7 +1412,7 @@ add_airport(struct emp_qelem *airp, coord x, coord y)
  *  Take all the planes in list 1 that
  *  are at x,y, and put them into list 2.
  */
-void
+static void
 divide(struct emp_qelem *l1, struct emp_qelem *l2, coord x, coord y)
 {
     struct emp_qelem *qp, *next;
@@ -1420,7 +1432,7 @@ divide(struct emp_qelem *l1, struct emp_qelem *l2, coord x, coord y)
     }
 }
 
-int
+static int
 air_damage(struct emp_qelem *bombers, coord x, coord y, int mission,
           natid victim, s_char *s, int hardtarget)
 {
index 770aab6e0c2e7808ac6ec7259c46118cd5030423..4204c082dcd4f9aa832eeee0050262b86546d891 100644 (file)
@@ -46,7 +46,7 @@
 #include "damage.h"
 #include "prototypes.h"
 
-extern int move_map(s_char *what, coord curx, coord cury, s_char *arg);
+static int move_map(s_char *what, coord curx, coord cury, s_char *arg);
 
 int
 move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
@@ -260,7 +260,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
 
 
 /*ARGSUSED*/
-int
+static int
 move_map(s_char *what, coord curx, coord cury, s_char *arg)
 {
     struct nstr_sect ns;
index 06102485578d664cb0ec04a68b61f0e6c1461804..b2f5a71b14b709a03b7379b73ddf1f40163759de 100644 (file)
@@ -41,6 +41,8 @@
 #include <fcntl.h>
 #include "prototypes.h"
 
+static void filereport(int, int, int, int);
+
 void
 nreport(natid actor, int event, natid victim, int times)
 {
@@ -188,7 +190,7 @@ ncache(time_t now, int actor, int event, int victim, int times)
     return np;
 }
 
-void
+static void
 filereport(int actor, int event, int victim, int times)
 {
     struct newscache *np;
index f32ec182f0a92410865a4fe200df124270be8ef2..d5fa20b7cc77aa7064787c09d764ca7f74e40367 100644 (file)
@@ -51,6 +51,8 @@
 #include "prototypes.h"
 #include "optlist.h"
 
+static int pln_equip(struct plist *, struct ichrstr *, int, s_char);
+
 int
 pln_onewaymission(struct sctstr *target, int *shipno, int *flagp)
 {
@@ -510,7 +512,7 @@ pln_arm(struct emp_qelem *list, int dist, int mission, struct ichrstr *ip,
     return mission_flags;
 }
 
-int
+static int
 pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
 {
     register struct plchrstr *pcp;
index a244f4de4b2e153c0307304860856184633c8c66..0bfa4fe6ff3c323b080e778efc85f8274e37832b 100644 (file)
@@ -58,7 +58,7 @@
 extern int update_pending;
 #include "prototypes.h"
 
-void outid(struct player *pl, int n);
+static void outid(struct player *pl, int n);
 
 /*VARARGS*/
 void
@@ -199,7 +199,7 @@ pr_hilite(s_char *buf)
 /*
  * output hex code + space
  */
-void
+static void
 outid(struct player *pl, int n)
 {
     s_char c;
index 9c45fb7d3c6b7c07a77c9385c346ccb6f1e75869..913bba955590fbf9b1b963d61f11110bf56b9d07 100644 (file)
@@ -44,6 +44,8 @@
 #include "prototypes.h"
 #include "optlist.h"
 
+static void radmap2(int, int, int, int, int, double, int);
+
 void
 radmap(int cx, int cy, int eff, int range, double seesub)
 {
@@ -70,7 +72,7 @@ static s_char *radbuf;
 static s_char **vis;
 static s_char *visbuf;
 
-void
+static void
 radmap2(int owner,
        int cx, int cy, int eff, int range, double seesub, int pr_flag)
 {
index ec47c80f3e143745db3a0dcda13a7e8f465477a6..b10511bea8c6d2a9d78b8ff51fb40cdb63ac193d 100644 (file)
 #include "prototypes.h"
 #include "optlist.h"
 
+static int findcondition(s_char);
+static int retreat_land1(struct lndstr *, s_char, int);
+static int retreat_ship1(struct shpstr *, s_char, int);
+
 struct ccode {
     s_char code;
     s_char *desc[2];
@@ -122,7 +126,7 @@ retreat_ship(struct shpstr *sp, s_char code)
     }
 }
 
-int
+static int
 retreat_ship1(struct shpstr *sp, s_char code, int orig)
 
 
@@ -356,7 +360,8 @@ struct sctstr *sect;
     return CN_NAVIGABLE;
 }
 #endif
-int
+
+static int
 findcondition(s_char code)
 {
     int x;
@@ -417,7 +422,7 @@ retreat_land(struct lndstr *lp, s_char code)
     }
 }
 
-int
+static int
 retreat_land1(struct lndstr *lp, s_char code, int orig)
 
 
index f80956874355b6d96e4876fb466be795fe7556af..2f3598d96d9cd5dff8bea8e8fed76f2c3efad3c7 100644 (file)
@@ -90,7 +90,7 @@ sarg_xy(s_char *ptr, coord *xp, coord *yp)
 }
 
 /* returns absolute coords */
-int
+static int
 sarg_getrange(s_char *buf, register struct range *rp)
 {
     register int rlm;
index 23eaf73691dcec3d227b8064850e40ebb33d02a3..2d5a56bb22ebb03a919d8caa2b44e552de631a42 100644 (file)
@@ -46,6 +46,7 @@
 #include "prototypes.h"
 #include "optlist.h"
 
+static int checksect(struct sctstr *);
 static void give_back_cap(struct sctstr *sp);
 
 /*ARGSUSED*/
@@ -75,7 +76,7 @@ sct_prewrite(int id, s_char *ptr)
     return 1;
 }
 
-int
+static int
 checksect(struct sctstr *sp)
 {
     int mil, civs, loyalcivs;
index f787b3070914e70ce6b502b5a1e5eea0d338f3b6..4c854e97ca245d47d03af88dca56a1dbb18a1d0f 100644 (file)
@@ -150,7 +150,7 @@ struct look_list {
                                   or land units. */
 static int lookup_list_cnt = 0;
 
-void
+static void
 sort_lookup_list(void)
 {
     struct natstr *np = getnatp(player->cnum);
index 94bba0df346749c0974420b1f638c37226ad1a66..635696a7387793a0d2a17197b33a09e19ce623c8 100644 (file)
@@ -56,6 +56,11 @@ extern double tfactfire(natid, double);
 
 extern int etu_per_update;
 
+static int shp_check_nav(struct sctstr *);
+static int shp_check_one_mines(struct mlist *);
+static int shp_hit_mine(struct shpstr *, struct mchrstr *);
+static void shp_mess(s_char *, struct mlist *);
+
 void
 shp_sel(struct nstr_item *ni, struct emp_qelem *list)
 
@@ -278,7 +283,7 @@ shp_sweep(struct emp_qelem *ship_list, int verbose, natid actor)
     return stopping;
 }
 
-int
+static int
 shp_check_one_mines(struct mlist *mlp)
 {
     struct sctstr sect;
@@ -307,7 +312,7 @@ shp_check_one_mines(struct mlist *mlp)
     return 0;
 }
 
-int
+static int
 shp_check_mines(struct emp_qelem *ship_list)
 {
     struct emp_qelem *qp;
@@ -362,7 +367,7 @@ shp_list(struct emp_qelem *ship_list)
     }
 }
 
-void
+static void
 shp_mess(s_char *str, struct mlist *mlp)
 {
     mpr(mlp->ship.shp_own, "%s %s & stays in %s\n",
@@ -374,7 +379,7 @@ shp_mess(s_char *str, struct mlist *mlp)
     free((s_char *)mlp);
 }
 
-int
+static int
 shp_check_nav(struct sctstr *sect)
 {
     extern struct dchrstr dchr[];
@@ -717,7 +722,7 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
     return 0;
 }
 
-int
+static int
 shp_interdict(struct emp_qelem *list, coord newx, coord newy, natid victim)
 {
     int stopping = 0;
@@ -767,7 +772,7 @@ shp_hardtarget(struct shpstr *sp)
                 (20 + (double)sp->shp_speed * onsea / 2.0 - vis));
 }
 
-int
+static int
 shp_hit_mine(struct shpstr *sp, struct mchrstr *mcp)
 {
     double m;
index ed7b9bba70a825fd8a7bea0a37b80795eca20855..f79abf4aeea9e45f271ac7f7e4415924535fcf2a 100644 (file)
 #include "player.h"
 #include "prototypes.h"
 
+static int get_minimum(struct lndstr *, int);
+static s_char *itemname(int);
+static int s_commod(int, int, int, int, int, int);
+
 /*
  * We want to get enough guns to be maxed out, enough shells to
  *     fire once, one update's worth of food, enough fuel for
@@ -158,7 +162,7 @@ try_supply_commod(int own, int x, int y, int type, int total_wanted)
 }
 
 /* Get supplies of a certain type */
-int
+static int
 s_commod(int own, int x, int y, int type, int total_wanted,
         int actually_doit)
 {
@@ -455,7 +459,7 @@ s_commod(int own, int x, int y, int type, int total_wanted,
 }
 
 
-s_char *
+static s_char *
 itemname(int type)
 {
     register int t;
@@ -469,25 +473,13 @@ itemname(int type)
     return 0;
 }
 
-int
-at_minimum(struct lndstr *lp, int type)
-{
-    int vec[I_MAX + 1];
-
-    getvec(VT_ITEM, vec, (s_char *)lp, EF_LAND);
-    if (vec[type] <= get_minimum(lp, type))
-       return 1;
-
-    return 0;
-}
-
 /*
  * We want to get enough shells to fire once,
  * one update's worth of food, enough fuel for
  * one update.
  */
 
-int
+static int
 get_minimum(struct lndstr *lp, int type)
 {
     struct lchrstr *lcp;
diff --git a/src/lib/subs/wire.c b/src/lib/subs/wire.c
deleted file mode 100644 (file)
index b411c58..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  ---
- *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
- *
- *  ---
- *
- *  wire.c: Write an announcement to the world
- * 
- *  Known contributors to this file:
- *    
- */
-
-#include "misc.h"
-#include <fcntl.h>
-#if !defined(_WIN32)
-#include <sys/uio.h>
-#endif
-#include "nat.h"
-#include "tel.h"
-#include "file.h"
-#include "prototypes.h"
-
-#if 0
-int
-typed_wire(natid from, natid to, s_char *message, int type)
-{
-    register s_char *bp;
-    int len;
-    struct telstr tel;
-    struct natstr *np;
-    struct iovec iov[2];
-    int fd;
-    s_char buf[1024];
-
-    if ((np = getnatp(to)) == 0 ||
-       ((np->nat_stat & STAT_NORM) == 0 &&
-        (np->nat_stat & STAT_SANCT) == 0))
-       return 0;
-    if ((fd = open(wirebox(buf, to), O_WRONLY | O_APPEND, 0)) < 0) {
-       logerror("telegram 'open' of %s (#%d) failed",
-                wirebox(buf, to), to);
-       return 0;
-    }
-    tel.tel_from = from;
-    (void)time(&tel.tel_date);
-    bp = message;
-    while (*bp++) ;
-    len = bp - message;
-    if (len >= MAXTELSIZE)
-       len = MAXTELSIZE;
-    message[len] = 0;
-    tel.tel_length = len;
-    tel.tel_type = type;
-    iov[0].iov_base = (caddr_t)&tel;
-    iov[0].iov_len = sizeof(tel);
-    iov[1].iov_base = message;
-    iov[1].iov_len = len;
-    if (writev(fd, iov, 2) < iov[0].iov_len + iov[1].iov_len) {
-       logerror("telegram 'write' to #%d failed", to);
-    } else {
-       np->nat_ann++;
-       /* don't do putnat because of expense */
-    }
-    (void)close(fd);
-    return 0;
-}
-#endif
index 009c0e172123e7d5fe1832cfee423d90bcaa032f..ab71ce10722ed1f2e245a28784ae958f59dfb86c 100644 (file)
 #include "gen.h"
 #include "subs.h"
 
+static int grow_people(struct sctstr *, register int,
+                      register struct natstr *, int *, int,
+                      register int *);
+static int growfood(struct sctstr *, register int *, int, int);
+static void starvation(struct sctstr *);
+static void trunc_people(struct sctstr *, register struct natstr *,
+                        register int *);
+
 /*
  * feed the individual sector
  *
@@ -136,7 +144,7 @@ do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
     return sctwork;
 }
 
-int
+static int
 growfood(struct sctstr *sp, register int *vec, int work, int etu)
 {
     extern double fgrate;
@@ -244,7 +252,7 @@ feed_people(register int *vec, int etu, int *needed)
 /*
  * Truncate any extra people that may be around
  */
-void
+static void
 trunc_people(struct sctstr *sp, register struct natstr *np,
             register int *vec)
 {
@@ -262,7 +270,7 @@ trunc_people(struct sctstr *sp, register struct natstr *np,
  * rate limitation on countries with high tech
  * production?  Maybe with just high education?
  */
-int
+static int
 grow_people(struct sctstr *sp, register int etu,
            register struct natstr *np, int *workp, int sctwork,
            register int *vec)
@@ -324,7 +332,7 @@ grow_people(struct sctstr *sp, register int etu,
 /*
  * percentage of people who starved
  */
-void
+static void
 starvation(struct sctstr *sp)
 {
     sp->sct_work = 0;
index d31bf0108f9ef4e8aaab298d3b5ca5c27dd1d4fc..6805a32df9456168fd81af7354c7d2e5ef59bef7 100644 (file)
@@ -59,8 +59,10 @@ int mil_dbl_pay;
 #define MIN(x,y)       ((x) > (y) ? (y) : (x))
 #endif
 
-void upd_land(register struct lndstr *lp, int landno, register int etus,
-             struct natstr *np, int *bp, int build);
+static int landrepair(register struct lndstr *, int *, struct natstr *,
+                     int *, int);
+static void upd_land(register struct lndstr *lp, int landno, register int etus,
+                    struct natstr *np, int *bp, int build);
 
 int
 prod_land(int etus, int natnum, int *bp, int build)
@@ -109,7 +111,7 @@ prod_land(int etus, int natnum, int *bp, int build)
     return k;
 }
 
-void
+static void
 upd_land(register struct lndstr *lp, int landno, register int etus,
         struct natstr *np, int *bp, int build)
               /* build = 1, maintain = 0 */
@@ -239,7 +241,7 @@ upd_land(register struct lndstr *lp, int landno, register int etus,
 }
 
 /*ARGSUSED*/
-int
+static int
 landrepair(register struct lndstr *land, int *vec, struct natstr *np,
           int *bp, int etus)
 {
index 1082aaa6cd41442780eb92d50115b2dc625156ac..e1354890b0120211843715025405bc83c0626547 100644 (file)
@@ -61,6 +61,9 @@ long tpops[MAXNOC];
 extern int mil_dbl_pay;
 int update_pending = 0;
 
+static void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
+                   int *, int *, int *, int *);
+
 /*ARGSUSED*/
 void
 update_main(void *argv)
@@ -212,7 +215,7 @@ update_main(void *argv)
     /*NOTREACHED*/
 }
 
-void
+static void
 do_prod(int sector_type, int etu, int n, int *bp, long int (*p_sect)[2],
        int *ship_build, int *ship_maint, int *plane_build,
        int *plane_maint, int *land_build, int *land_maint)
index 0785d257a54cd6b680e64add1e6fa24554f6eb77..333421a2e0fa0d7c2cb15335e38ed6eb8b0e2786 100644 (file)
@@ -51,6 +51,10 @@ extern int timestamp_fixing;
 extern int update_pending;
 int do_upd_checking = 0;
 
+static void do_mob_land(register struct lndstr *, register int);
+static void do_mob_plane(register struct plnstr *, register int);
+static void do_mob_sect(register struct sctstr *sp, register int etus);
+static void do_mob_ship(register struct shpstr *, register int);
 
 int
 increase_mob(time_t * counter, float mult)
@@ -239,7 +243,7 @@ mob_sect(register int etus)
     }
 }
 
-void
+static void
 do_mob_sect(register struct sctstr *sp, register int etus)
 {
     extern float sect_mob_scale;
@@ -279,7 +283,7 @@ mob_ship(register int etus)
     }
 }
 
-void
+static void
 do_mob_ship(register struct shpstr *sp, register int etus)
 {
     extern int ship_mob_max;
@@ -392,7 +396,7 @@ mob_land(register int etus)
     }
 }
 
-void
+static void
 do_mob_land(register struct lndstr *lp, register int etus)
 {
     extern int land_mob_max;
@@ -539,7 +543,7 @@ mob_plane(register int etus)
     }
 }
 
-void
+static void
 do_mob_plane(register struct plnstr *pp, register int etus)
 {
     extern int plane_mob_max;
index 8bd4c8aa661c0979868416c5cf85a431d60de98b..b40ad983099fc50fda92025fffe3a6a101ef955a 100644 (file)
@@ -45,8 +45,6 @@
 #include "update.h"
 #include "subs.h"
 
-float levels[MAXNOC][4];
-
 /*
  * hap and edu avg mean that the weight on current happiness is
  *  (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu);
@@ -62,6 +60,8 @@ extern float hap_avg;
 extern float edu_avg;
 extern float ally_factor;
 
+static void share_incr(register double *, register double *);
+
 /*
  * for values below the "easy level" values, production is
  * as normal.  For values above "easy", production gets harder
@@ -78,6 +78,8 @@ extern float ally_factor;
 float level_easy[4] = { 0.75, 0.75, 5.00, 5.00 };
 float level_log[4] = { 1.75, 2.00, 4.00, 6.00 };
 
+float levels[MAXNOC][4];
+
 /*
  * technique to limit the sharpers who turn entire countries
  * into tech plants overnight...
@@ -91,7 +93,7 @@ logx(double d, double base)
     return log10(d) / log10(base);
 }
 
-double
+static double
 limit_level(double level, int type, int flag)
 {
     double above_easy;
@@ -241,7 +243,7 @@ prod_nat(int etu)
 /*
  * find out everyones increment
  */
-void
+static void
 share_incr(register double *res, register double *tech)
 {
     register struct natstr *np;
index 5021d504950151aef7797b3669b6f24fc91cae07..7b9aa1e036eb7b0673d0140318faa52f21ac0825 100644 (file)
@@ -54,8 +54,9 @@
 #include <stdlib.h>
 
 extern int check_nav(struct sctstr *sect);
+static void swap(register struct shpstr *);
 
-void
+static void
 scuttle_it(register struct shpstr *sp)
 {
     struct sctstr *sectp;
@@ -116,7 +117,7 @@ nav_check_atdest(register struct shpstr *sp, struct mchrstr *mcp)
 /* flip the 2 fields that deal with autonav movement. */
 /* CZ 6/1/94                                         */
 
-void
+static void
 swap(register struct shpstr *sp)
 {
     coord tcord;
index 909f63fede2ad8735c2dd72a2504b9ea098cfcc3..ac4637597f4ab5818bfd5aa7ff280d3da20514bc 100644 (file)
@@ -47,6 +47,9 @@
 #include "lost.h"
 #include "gen.h"
 
+static int infect_people(struct natstr *, register int *, u_int, int,
+                        struct sctstr *);
+
 void
 do_plague(struct sctstr *sp, struct natstr *np, int etu)
 {
@@ -119,7 +122,7 @@ do_plague(struct sctstr *sp, struct natstr *np, int etu)
 }
 
 /*ARGSUSED*/
-int
+static int
 infect_people(struct natstr *np, register int *vec, u_int eff, int mobil,
              struct sctstr *sp)
 {
index f3eb61bacc92a2d26dbc8cd925bc5656a76e49ae..3d835170abe0adb08c8df5dadd027590b5488895 100644 (file)
 #include "common.h"
 #include "optlist.h"
 
+static void materials_charge(struct pchrstr *, register int *,
+                            register int);
+static int materials_cost(struct pchrstr *, register int *, int *);
+
 s_char *levelnames[] =
     { "Technology", "Research", "Education", "Happiness" };
 
@@ -186,7 +190,7 @@ produce(struct natstr *np, struct sctstr *sp, int *vec, int work,
     return 0;
 }
 
-int
+static int
 materials_cost(struct pchrstr *product, register int *vec, int *costp)
 {
     register u_char *vp;
@@ -212,7 +216,7 @@ materials_cost(struct pchrstr *product, register int *vec, int *costp)
     return count;
 }
 
-void
+static void
 materials_charge(struct pchrstr *product, register int *vec,
                 register int count)
 {
index 9d3b767fae73dac39dce03d5e4b67678a8e6b7b2..763abba12daebf273b381f85f5b304562acd9cdf 100644 (file)
@@ -50,6 +50,8 @@
 #include "lost.h"
 #include "subs.h"
 
+static void take_casualties(struct sctstr *, int);
+
 #define        get_che_cnum(x)         ((x) >> 8)
 #define set_che_cnum(x, cn)    ((x) = ((x) & 0xff) | ((cn) << 8))
 #define get_che_value(x)       ((x) & 0xff)
@@ -452,7 +454,7 @@ guerrilla(struct sctstr *sp)
     }
 }
 
-void
+static void
 take_casualties(struct sctstr *sp, int mc)
 {
     int orig_mil;
index 3103b222ba6a32ac7b4b0c54372e5e73f486cff4..8d642d6ede98eaf4a24470f213a674c588d403a4 100644 (file)
@@ -50,6 +50,8 @@
 #include "common.h"
 #include <stdlib.h>
 
+static void fltp_to_list(struct fltheadstr *, struct emp_qelem *);
+
 static void
 cost_ship(struct shpstr *sp, struct fltelemstr *ep, struct fltheadstr *fp)
 {
@@ -331,7 +333,7 @@ sail_ship(natid cn)
 
 /* The following is a total hack by Ken Stevens to cut down dramatically on repeated code 1995 */
 
-void
+static void
 fltp_to_list(struct fltheadstr *fltp, struct emp_qelem *list)
 {
     struct fltelemstr *fe;
index 8ba9304c7ea294aa6680ba91b260486a1195a5ea..23eeb3a038f0b14083920a8c7f2b871b589a109e 100644 (file)
@@ -95,7 +95,7 @@ dodeliver(struct sctstr *sp, int *vec)
  * decrease sector efficiency if old type != new type.
  * Return amount of work used.
  */
-int
+static int
 upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp,
             int *vec, int etu, int *desig, int sctwork, int *cost)
 {
@@ -179,7 +179,7 @@ upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp,
  * Conversion will happen much more slowly without
  * some mil initially.
  */
-int
+static int
 enlist(register int *vec, int etu, int *cost)
 {
     int maxmil;
@@ -203,7 +203,7 @@ enlist(register int *vec, int etu, int *cost)
 
 extern int melt_item_denom[];
 
-void
+static void
 meltitems(int etus, int fallout, int own, int *vec, int type, int x, int y,
          int uid)
 {
index fa83cb94e485229bebeed012ee71de12d7571192..04596212c32da0e3f5dccdb8c1b6d5176a97ee02 100644 (file)
 #define MIN(x,y)        ((x) > (y) ? (y) : (x))
 #endif
 
+static int shiprepair(register struct shpstr *, int *, struct natstr *,
+                     int *, int);
+static void upd_ship(register struct shpstr *, int, register int,
+                    struct natstr *, int *, int);
+
 int
 prod_ship(int etus, int natnum, int *bp, int build)
                /* build = 1, maintain = 0 */
@@ -104,7 +109,7 @@ prod_ship(int etus, int natnum, int *bp, int build)
     return k;
 }
 
-void
+static void
 upd_ship(register struct shpstr *sp, int shipno, register int etus,
         struct natstr *np, int *bp, int build)
               /* build = 1, maintain = 0 */
@@ -258,7 +263,7 @@ upd_ship(register struct shpstr *sp, int shipno, register int etus,
  * battleships +8 % eff each etu.  This will cost around
  * 8 * 8 * $40 = $2560!
  */
-int
+static int
 shiprepair(register struct shpstr *ship, int *vec, struct natstr *np,
           int *bp, int etus)
 {