Add some missing declarations to headers. Remove some redundant

declarations elsewhere.  Change linkage of some functions to static.
This commit is contained in:
Markus Armbruster 2004-02-20 10:51:03 +00:00
parent e7811102a3
commit 4a3f0b8146
43 changed files with 72 additions and 169 deletions

View file

@ -44,9 +44,7 @@
#include "tel.h"
#include "land.h"
#include "commands.h"
extern float start_education, start_happiness;
extern float start_technology, start_research;
#include "optlist.h"
int
add(void)

View file

@ -48,8 +48,6 @@
#include "commands.h"
#include "optlist.h"
extern int etu_per_update;
extern int sect_mob_neg_factor;
/*
* format: anti <SECT>
*/

View file

@ -56,15 +56,6 @@
#define MIN(x,y) ((x) > (y) ? (y) : (x))
#endif
extern int etu_per_update;
extern double bankint;
extern double money_civ;
extern double money_uw;
extern double money_mil;
extern double obrate, uwbrate;
extern int etu_per_update;
extern double money_res;
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,

View file

@ -68,10 +68,6 @@ static int build_plane(register struct sctstr *sp,
static int cash; /* static ok */
extern int morale_base;
extern int sect_mob_neg_factor;
extern int etu_per_update;
/*
* build <WHAT> <SECTS> <TYPE|DIR|MEG> [NUMBER]
*/

View file

@ -54,8 +54,6 @@
#include "commands.h"
#include "optlist.h"
extern int MARK_DELAY;
/*
* format: buy <COMMODITY>
*

View file

@ -46,9 +46,6 @@
static int explore_map(s_char *what, coord curx, coord cury, s_char *arg);
extern int etu_per_update;
extern int sect_mob_neg_factor;
int
explore(void)
{

View file

@ -235,7 +235,6 @@ printdir(void)
extern int alphasort(const struct dirent *const *,
const struct dirent *const *);
#endif
extern s_char *infodir;
static time_t lastmodtime;
static int number;
static struct dirent **dp;
@ -369,7 +368,6 @@ apro(void)
int
info(void)
{
extern s_char *infodir;
s_char buf[255];
FILE *fp;
s_char *bp;
@ -441,7 +439,6 @@ info(void)
static int
printdir(void)
{
extern s_char *infodir;
HANDLE hDir;
WIN32_FIND_DATA fData;
int count;
@ -473,7 +470,6 @@ printdir(void)
int
apro(void)
{
extern s_char *infodir;
HANDLE hDir;
WIN32_FIND_DATA fData;
FILE *fp;

View file

@ -55,7 +55,6 @@
#define LOAD 1
#define UNLOAD -1
void gift(int givee, int giver, s_char *ptr, int type, s_char *mesg);
static int load_plane_ship(struct sctstr *sectp, struct shpstr *sp,
int noisy, int load_unload, int *nshipsp);
static int load_land_ship(struct sctstr *sectp, struct shpstr *sp,

View file

@ -41,8 +41,7 @@
#include "nat.h"
#include "deity.h"
#include "commands.h"
extern int morale_base;
#include "optlist.h"
int
morale(void)

View file

@ -49,10 +49,6 @@
#include <fcntl.h>
#include <math.h>
extern float start_education, start_happiness;
extern float start_technology, start_research;
extern int morale_base;
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);
@ -64,9 +60,6 @@ static struct range defrealm = { -8, -5, 10, 5, 0, 0 };
int
new(void)
{
#ifdef START_UNITS
extern int start_unit_type[START_UNITS];
#endif /* START_UNITS */
struct sctstr sect;
struct natstr *natp;
struct boundstr newrealms;

View file

@ -48,7 +48,6 @@
#include "land.h"
#include "commands.h"
extern int etu_per_update;
static void starv_sects(s_char *range);
static void starv_ships(s_char *range);
static void starv_units(s_char *range);

View file

@ -57,8 +57,6 @@ 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);
int
torp(void)
{

View file

@ -55,10 +55,6 @@
#include "commands.h"
#include "optlist.h"
extern int sect_mob_neg_factor;
extern int etu_per_update;
extern int TRADE_DELAY;
/*
* format: trade
*/

View file

@ -47,8 +47,6 @@
#include "optlist.h"
#include "commands.h"
extern float drnuke_const;
int
vers(void)
{

View file

@ -34,8 +34,7 @@
#include "misc.h"
#include "nat.h"
#include "file.h"
extern float fire_range_factor;
#include "optlist.h"
double
tfact(natid cn, double mult)

View file

@ -52,6 +52,7 @@
#include "match.h"
#include "file.h"
#include "optlist.h"
#include "tel.h"
#include "gen.h" /* parse */
/* for systems without strdup */
@ -380,9 +381,6 @@ struct otherfiles {
char *name;
};
extern s_char *upfil, *downfil, *disablefil, *banfil, *authfil;
extern s_char *commfil, *annfil, *telfil, *teldir, *timestampfil;
/* list of other well known files... -maybe tailor these oneday
* anyway - meantime they are all relative to datadir */
static struct otherfiles ofiles[] = {

View file

@ -63,8 +63,6 @@
#include "empthread.h"
extern struct player *player; /* XXX */
struct iop {
int fd;
struct ioqueue *input;

View file

@ -98,7 +98,6 @@ void
lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
{
static jmp_buf *cpp;
extern struct lwpProc *LwpCurrent;
if (!lwpSave(LwpCurrent->context)) {
cpp = (jmp_buf *) & newp->context;
@ -305,7 +304,6 @@ void
lwpInitContext(struct lwpProc *newp, void *sp)
{
static jmp_buf *cpp;
extern struct lwpProc *LwpCurrent;
memset(newp->context, 0, sizeof(newp->context));
newp->context[0] = (int)sp;

View file

@ -36,11 +36,6 @@
#include <bounds/unchecked.h>
#endif
#ifdef hpc
extern struct lwpProc *initcontext;
extern int startpoint;
#endif
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
struct lwpProc *LwpCurrent = NULL;

View file

@ -29,6 +29,11 @@
/* more inefficient the context switch time */
#define LCOUNT -1
#ifdef hpc
extern struct lwpProc *initcontext;
extern int startpoint;
#endif
#ifdef hpux
int lwpSave(jmp_buf);
void lwpRestore(jmp_buf);

View file

@ -61,7 +61,6 @@
#include <fcntl.h>
struct player *player;
extern int m_m_p_d;
void
player_main(struct player *p)

View file

@ -47,7 +47,7 @@
#include "optlist.h"
#include "prototypes.h"
void kaboom(int x, int y, int rad, natid cn);
static void kaboom(int x, int y, int rad, natid cn);
int
detonate(struct plnstr *pp, int x, int y)
@ -317,7 +317,7 @@ detonate(struct plnstr *pp, int x, int y)
/*
* silly to be sure.
*/
void
static void
kaboom(int x, int y, int rad, natid cn)
{
mpr(cn, "\n\nK A B ");

View file

@ -43,17 +43,6 @@
#include "prototypes.h"
#include "optlist.h"
extern struct castr sect_ca[];
extern struct castr news_ca[];
extern struct castr loan_ca[];
extern struct castr ship_ca[];
extern struct castr plane_ca[];
extern struct castr treaty_ca[];
extern struct castr nuke_ca[];
extern struct castr trade_ca[];
extern struct castr commodity_ca[];
extern struct castr lost_ca[];
struct fileinit fileinit[EF_MAX] = {
{(ef_fileinit)sct_init, sct_postread, sct_prewrite, sect_ca},
{shp_init, shp_postread, shp_prewrite, ship_ca},

View file

@ -53,8 +53,6 @@
#define QUIET 0
#define NOISY 1
extern double tfactfire(natid, double);
/*
* See if any nearby ships will open up on the attacker
* Return damage done to attacker, if any.

View file

@ -47,8 +47,6 @@
#include "file.h"
#include "prototypes.h"
extern s_char *effadv(int);
int
shipsatxy(coord x, coord y, int wantflags, int nowantflags)
{

View file

@ -53,8 +53,6 @@
#include "optlist.h"
#include "prototypes.h"
extern int etu_per_update;
int
attack_val(int combat_mode, struct lndstr *lp)
{
@ -934,7 +932,6 @@ static int
lnd_fort_interdiction(struct emp_qelem *list,
coord newx, coord newy, natid victim)
{
extern int fort_max_interdiction_range;
struct nstr_sect ns;
struct sctstr fsect;
int trange;

View file

@ -40,8 +40,6 @@
#include "optlist.h"
#include "server.h"
extern s_char *relates[];
int
setrel(natid us, natid them, int rel)
{

View file

@ -336,8 +336,6 @@ static int
check_nav(sect)
struct sctstr *sect;
{
extern struct dchrstr dchr[];
switch (dchr[sect->sct_type].d_flg & 03) {
case NAVOK:
break;

View file

@ -46,8 +46,6 @@
#include "prototypes.h"
#include "optlist.h"
void satdisp(struct sctstr *sp, int acc, int showstuff);
static s_char **rad;
static s_char *radbuf;

View file

@ -53,10 +53,6 @@
#include "server.h"
#include "prototypes.h"
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 *);

View file

@ -47,10 +47,6 @@
#define CHE_MAX 255
void takeover_land(register struct lndstr *landp, natid newown,
int hostile);
void takeover_plane(register struct plnstr *pp, natid newown);
void
takeover(register struct sctstr *sp, natid newown)
{

View file

@ -72,9 +72,7 @@ static s_char *finish_path = "h"; /* Placeholder indicating path exists */
#endif /* SAVE_FINISH_PATHS */
static void assemble_dist_paths(struct distinfo *distptrs);
s_char *BestDistPath(s_char *, struct sctstr *, struct sctstr *, double *, int);
s_char *ReversePath(s_char *path);
double pathcost(struct sctstr *, s_char *, int);
static s_char *ReversePath(s_char *path);
void
finish_sects(int etu)
@ -240,7 +238,7 @@ assemble_dist_paths(struct distinfo *distptrs)
}
}
s_char *
static s_char *
ReversePath(s_char *path)
{
s_char *patharray = "aucdefjhigklmyopqrstbvwxnz";

View file

@ -58,7 +58,6 @@ long lnd_money[MAXNOC];
long air_money[MAXNOC];
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 *,

View file

@ -57,10 +57,6 @@
* level of 0 yields (1) 0.4, (6) 2.2, (12) 3.9, (18) 5.2.
*/
extern float hap_avg;
extern float edu_avg;
extern float ally_factor;
static void share_incr(register double *, register double *);
/*

View file

@ -53,7 +53,6 @@
#include "common.h"
#include <stdlib.h>
extern int check_nav(struct sctstr *sect);
static void swap(register struct shpstr *);
static void

View file

@ -52,8 +52,6 @@
#include "gen.h"
#include "common.h"
extern float levels[MAXNOC][4];
void
prepare_sects(int etu, int *bp)
{

View file

@ -55,8 +55,6 @@
#include "lost.h"
#include "gen.h"
extern float levels[MAXNOC][4];
int
dodeliver(struct sctstr *sp, int *vec)
{
@ -201,8 +199,6 @@ enlist(register int *vec, int etu, int *cost)
/* Fallout is calculated here. */
extern int melt_item_denom[];
static void
meltitems(int etus, int fallout, int own, int *vec, int type, int x, int y,
int uid)