Supply prototypes where possible. This uncovered type errors with

thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
This commit is contained in:
Markus Armbruster 2004-02-17 17:59:30 +00:00
parent 7dbb87b0e0
commit 237baffca9
108 changed files with 505 additions and 877 deletions

View file

@ -45,14 +45,13 @@
#include "update.h"
#include "subs.h"
#include "common.h"
#include "prototypes.h"
int
dodistribute(struct sctstr *sp, int imex, s_char *path, double dist_i_cost,
double dist_e_cost)
/* import or export? */
{
struct sctstr *getdistsp();
float distpathcost();
struct ichrstr *ip;
struct sctstr *dist;
int amt;

View file

@ -72,9 +72,9 @@ 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 *BestDistPath(s_char *, struct sctstr *, struct sctstr *, double *, int);
s_char *ReversePath(s_char *path);
double pathcost();
double pathcost(struct sctstr *, s_char *, int);
void
finish_sects(int etu)
@ -240,8 +240,7 @@ assemble_dist_paths(struct distinfo *distptrs)
}
}
s_char
*
s_char *
ReversePath(s_char *path)
{
s_char *patharray = "aucdefjhigklmyopqrstbvwxnz";

View file

@ -121,7 +121,6 @@ upd_land(register struct lndstr *lp, int landno, register int etus,
int vec[I_MAX + 1];
int cvec[I_MAX + 1];
int n;
double techfact(int, double);
int min = morale_base - (int)np->nat_level[NAT_HLEV];
int mult;
extern double money_land;
@ -245,7 +244,6 @@ static int
landrepair(register struct lndstr *land, int *vec, struct natstr *np,
int *bp, int etus)
{
extern int mil_dbl_pay;
extern int land_grow_scale;
register int delta;
struct sctstr *sp;

View file

@ -56,7 +56,7 @@ 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
static int
increase_mob(time_t * counter, float mult)
{
time_t secs;

View file

@ -241,7 +241,6 @@ nav_loadship(register struct shpstr *sp, natid cnum)
int
nav_ship(register struct shpstr *sp)
{
extern double techfact(int, double);
struct sctstr *sectp;
s_char *cp, item;
int stopping;

View file

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

View file

@ -144,7 +144,6 @@ revolt(struct sctstr *sp)
void
guerrilla(struct sctstr *sp)
{
extern s_char *effadv();
struct sctstr *nsp;
int recruit;
int move;
@ -168,9 +167,7 @@ guerrilla(struct sctstr *sp)
int val;
int oldmob;
struct lndstr *lp;
s_char *nxtitemp(struct nstr_item *np, int owner);
struct nstr_item ni;
extern double hap_fact();
mc = cc = 0;
recruit = 0;
@ -463,7 +460,6 @@ take_casualties(struct sctstr *sp, int mc)
int cantake;
int nunits = 0, each, deq;
struct lndstr *lp;
s_char *nxtitemp(struct nstr_item *np, int owner);
struct nstr_item ni;
/* casualties come out of mil first */

View file

@ -445,7 +445,6 @@ feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
int starved, lvec[I_MAX + 1];
struct nstr_item ni;
struct lndstr *lp;
s_char *nxtitemp(struct nstr_item *np, int owner);
if (opt_NOFOOD)
return 0; /* no food no work to do */