Declare all configuration variables in optlist.h. Include that

instead of declaring them all over the place.  This uncovered type
errors:
(s_p_etu, adj_update): Defined long, sometimes declared int.  Kills
big endian machines where sizeof(long) != sizeof(int).  Change to
int.

(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
This commit is contained in:
Markus Armbruster 2004-02-17 22:58:04 +00:00
parent 80aae5b8e6
commit 8cd0160176
62 changed files with 143 additions and 258 deletions

View file

@ -102,7 +102,6 @@ void
landdamage(struct lndstr *lp, int dam)
{
double damage_factor, m;
extern int land_mob_max;
m = (double)land_mob_max;
@ -183,7 +182,6 @@ effdamage(register int amt, int dam)
int
commdamage(register int amt, int dam, int vtype)
{
extern double people_damage;
int lost;
if (vtype == V_BAR && opt_SUPER_BARS)

View file

@ -44,6 +44,7 @@
#include "keyword.h"
#include "file.h"
#include "common.h"
#include "optlist.h"
#if defined(Rel4) || defined(_WIN32)
#include <time.h>
@ -59,7 +60,6 @@
int
gamehours(time_t now, int *hour)
{
extern s_char *game_days, *game_hours;
extern struct tm *localtime(const time_t *);
register s_char *bp;
register struct tm *tm;

View file

@ -47,6 +47,7 @@
#include "deity.h"
#include "player.h"
#include "common.h"
#include "optlist.h"
static s_char *logfile = 0;
@ -63,7 +64,6 @@ void
loginit(void)
{
extern s_char program[];
extern s_char *datadir;
s_char buf[1024];
#if !defined(_WIN32)

View file

@ -88,7 +88,6 @@ sect_damage(struct sctstr *sp, int dam, struct emp_qelem *list)
int
sectdamage(struct sctstr *sp, int dam, struct emp_qelem *list)
{
extern double unit_damage;
struct nstr_item ni;
struct lndstr land;
struct plnstr plane;

View file

@ -126,7 +126,6 @@ vl_damage(register int pct, register u_char *typevec,
{
register int i;
register int lose;
extern double people_damage;
if (pct >= 100)
return 0;

View file

@ -54,9 +54,6 @@
void
update_policy_check(void)
{
extern int update_policy, update_demandpolicy;
extern int update_wantmin, blitz_time;
if (update_policy < 0)
update_policy = UDP_DEFAULT;
if (update_policy > UDP_MAX)
@ -80,7 +77,6 @@ demand_update_time(time_t * now)
s_char *p;
int curtime;
int hour[2];
extern s_char *update_demandtimes;
tm = localtime(now);
curtime = tm->tm_min + tm->tm_hour * 60;
@ -98,9 +94,6 @@ demand_update_time(time_t * now)
static void
regular_update_time(time_t * now, time_t * tim, time_t * delta)
{
extern int s_p_etu;
extern int etu_per_update;
extern int adj_update;
s_char *p;
time_t tw;
int secs_per_update;
@ -119,8 +112,6 @@ scheduled_update_time(time_t * now, int *which)
s_char *p, *p1;
int curtime;
int hour;
extern int hourslop;
extern s_char *update_times;
*which = -1;
p = update_times;
@ -146,7 +137,6 @@ next_scheduled_time(time_t * now, time_t * tim, time_t * delta)
int curtime;
int hour;
int mintime;
extern s_char *update_times;
p = update_times;
if (*p == 0)
@ -197,12 +187,10 @@ demand_update_want(int *want, int *pop, int which)
static int
demand_check(void)
{
extern int update_wantmin, update_missed;
struct natstr *natp;
int want, pop, cn, veto;
time_t now;
time_t cur;
extern long last_demand_update;
time(&cur);
@ -278,8 +266,6 @@ demand_check(void)
int
demandupdatecheck(void)
{
extern int update_demandpolicy;
if (UDDEM_COMSET != update_demandpolicy) {
logerror("no demand update, not policy.");
return (0);
@ -295,7 +281,6 @@ demandupdatecheck(void)
int
updatetime(time_t * now)
{
extern int update_policy;
int which;
if (opt_BLITZ && update_policy == UDP_BLITZ) {
@ -333,9 +318,7 @@ next_update_time(time_t * now, time_t * tim, time_t * delta)
/* Time of next update */
/* Seconds till next update */
{
extern int update_policy;
time_t stim, sdelta;
extern int blitz_time;
switch (update_policy) {
case UDP_NORMAL:
@ -369,9 +352,7 @@ next_update_check_time(time_t * now, time_t * tim, time_t * delta)
/* Time of next update */
/* Seconds till next update check */
{
extern int update_policy;
time_t stim, sdelta;
extern int blitz_time;
switch (update_policy) {
case UDP_NORMAL: