]> git.pond.sub.org Git - empserver/commitdiff
Supply prototypes where possible. This uncovered type errors with
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Feb 2004 17:59:30 +0000 (17:59 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Feb 2004 17:59:30 +0000 (17:59 +0000)
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.

108 files changed:
include/budg.h
include/combat.h
include/empthread.h
include/file.h
include/item.h
include/land.h
include/lwp.h
include/misc.h
include/nat.h
include/nsc.h
include/optlist.h
include/path.h
include/plane.h
include/player.h
include/prototype.h [deleted file]
include/prototypes.h
include/sect.h
include/ship.h
include/trade.h
include/xy.h
src/client/expect.c
src/client/fnlist.h
src/client/handle.c
src/client/host.c
src/client/ioqueue.c
src/client/login.c
src/client/main.c
src/client/queue.c
src/client/saveargv.c
src/client/servcmd.c
src/client/serverio.c
src/client/tags.c
src/client/termio.c
src/client/termlib.c
src/doconfig/doconfig.c
src/lib/as/as.h
src/lib/as/as_cache.c
src/lib/as/as_search.c
src/lib/commands/anti.c
src/lib/commands/best.c
src/lib/commands/bomb.c
src/lib/commands/budg.c
src/lib/commands/buil.c
src/lib/commands/cons.c
src/lib/commands/desi.c
src/lib/commands/diss.c
src/lib/commands/land.c
src/lib/commands/ldump.c
src/lib/commands/look.c
src/lib/commands/lstat.c
src/lib/commands/mark.c
src/lib/commands/mfir.c
src/lib/commands/miss.c
src/lib/commands/mora.c
src/lib/commands/new.c
src/lib/commands/path.c
src/lib/commands/shut.c
src/lib/commands/sinf.c
src/lib/commands/thre.c
src/lib/commands/upgr.c
src/lib/common/file.c
src/lib/common/keyword.c
src/lib/common/log.c
src/lib/common/path.c
src/lib/common/sectdamage.c
src/lib/empthread/lwp.c
src/lib/empthread/ntthread.c
src/lib/empthread/pthread.c
src/lib/gen/emp_config.c
src/lib/gen/getstarg.c
src/lib/gen/io.c
src/lib/gen/onearg.c
src/lib/lwp/arch.c
src/lib/lwp/lwp.c
src/lib/lwp/lwpint.h
src/lib/lwp/misc/lwp.h
src/lib/lwp/queue.c
src/lib/lwp/sel.c
src/lib/lwp/sem.c
src/lib/player/empmod.c
src/lib/player/player.c
src/lib/subs/aswplnsubs.c
src/lib/subs/attsub.c
src/lib/subs/lndsub.c
src/lib/subs/mission.c
src/lib/subs/move.c
src/lib/subs/retreat.c
src/lib/subs/show.c
src/lib/subs/shpsub.c
src/lib/subs/takeover.c
src/lib/update/distribute.c
src/lib/update/finish.c
src/lib/update/land.c
src/lib/update/mobility.c
src/lib/update/nav_ship.c
src/lib/update/nav_util.c
src/lib/update/revolt.c
src/lib/update/ship.c
src/server/idle.c
src/server/lostitem.c
src/server/main.c
src/server/marketup.c
src/server/shutdown.c
src/server/timestamp.c
src/server/update.c
src/util/fairland.c
src/util/files.c
src/util/pconfig.c

index 06150cfb91365fe8bf79b0888114657f8d9c79a3..a5a6ca17361de7e68421d3da018abfe9a203cabc 100644 (file)
  *     Ville Virrankoski, 1995
  */
 
-void fill_update_array();
-int *get_wp();
-int gt_bg_nmbr();
-void pt_bg_nmbr();
-void get_materials();
+void fill_update_array(int *bp, struct sctstr *sp);
+int *get_wp(int *bp, struct sctstr *sp, int cm);
+int gt_bg_nmbr(int *bp, struct sctstr *sp, int comm);
+void pt_bg_nmbr(int *bp, struct sctstr *sp, int comm, int amount);
+void get_materials(struct sctstr *sp, int *bp, int *mvec, int check);
 
 extern int mil_dbl_pay;
index 856d9fd87e0898fe1ccb84ac331ddccc4d2363e9..5b8286aa70866f2910d4c513b8fb64fbc0052b98 100644 (file)
@@ -97,9 +97,6 @@ extern int att_fight(int, struct combat *, struct emp_qelem *, double,
 extern int att_free_lists(struct emp_qelem *, struct emp_qelem *);
 
 
-extern double att_asupport();
-extern double att_dsupport();
-extern double att_mine_dsupport();
 extern double combat_mob;
 extern s_char *att_mode[];
 
index d0eed3911d0e4835c23f9446da970c2b6b4e0dbf..1e5709fae7daec64a869c0746386e066fd911fef 100644 (file)
@@ -36,7 +36,6 @@
 #ifndef _EMTHREAD_H_
 #define _EMTHREAD_H_
 
-#include "prototype.h"
 #include "misc.h"
 
 #if defined(_WIN32)
@@ -66,14 +65,13 @@ typedef struct lwpSem empth_sem_t;
 #define EMPTH_PRINT       0x1
 #define EMPTH_STACKCHECK  0x2
 
-typedef void (*vf_ptr) ();
 #define EMPTH_KILLED  1
 typedef struct empth_ctx_t {
     char *name;                        /* thread name */
     char *desc;                        /* description */
     void *ud;                  /* user data */
     int state;                 /* my state */
-    vf_ptr ep;                 /* entry point */
+    void (*ep)(void *);                /* entry point */
     pthread_t id;              /* thread id */
 } empth_t;
 
@@ -110,20 +108,19 @@ typedef void empth_sem_t;
 
 #endif
 
-int empth_init _PROTO((char **ctx, int flags));
-empth_t *empth_create _PROTO((int, void (*)(), int,
-                             int, char *, char *, void *));
-empth_t *empth_self();
-void empth_exit _PROTO((void));
-void empth_yield _PROTO((void));
-void empth_terminate _PROTO((empth_t *));
-void empth_select _PROTO((int fd, int flags));
-void empth_wakeup _PROTO((empth_t *));
-void empth_sleep _PROTO((long until));
-empth_sem_t *empth_sem_create _PROTO((char *name, int count));
-void empth_sem_signal _PROTO((empth_sem_t *));
-void empth_sem_wait _PROTO((empth_sem_t *));
-void empth_alarm _PROTO((int));
+int empth_init(char **ctx, int flags);
+empth_t *empth_create(int, void (*)(void *), int, int, char *, char *, void *);
+empth_t *empth_self(void);
+void empth_exit(void);
+void empth_yield(void);
+void empth_terminate(empth_t *);
+void empth_select(int fd, int flags);
+void empth_wakeup(empth_t *);
+void empth_sleep(long until);
+empth_sem_t *empth_sem_create(char *name, int count);
+void empth_sem_signal(empth_sem_t *);
+void empth_sem_wait(empth_sem_t *);
+void empth_alarm(int);
 
 
 #include "prototypes.h"                /* must come at end, after defines and typedefs */
index f67032760bed05537c21374d3d414ade218e147a..cf20114f09d908be7df8fe67015d2f924022b457 100644 (file)
@@ -109,7 +109,7 @@ extern int ef_vars(int, register s_char *, u_char **,
                   u_char **, u_short **);
 extern int ef_byname(s_char *);
 
-extern int ef_nbread();
+extern int ef_nbread(int type, int id, caddr_t ptr);
 extern struct empfile empfile[];
 
 #endif /* _FILE_H_ */
index 888677b742d05123038d4458db97311c234a7e7a..5013171c481735800aaba0c8ff6d2b90cd24899e 100644 (file)
@@ -53,7 +53,7 @@ extern int maxitem;
 
 /* procedures using/returning this struct */
 
-extern struct ichrstr *whatitem();
+extern struct ichrstr *whatitem(s_char *ptr, s_char *prompt);
 
 extern int itm_maxno;
 
index cf393a93b6161e0399b9d96259e6651f893c81ee..8906d40b7dfa1632ab820a8c812106dc57961234 100644 (file)
@@ -228,10 +228,7 @@ extern int lnd_support(natid, natid, coord, coord);
 extern int lnd_can_attack(struct lndstr *);
 extern int lnd_fortify (struct lndstr *lp, int hard_amt);
 
-void landdamage();
-void lnd_nav();
-int lnd_check_nav();
-double sqrt();
-s_char *prland();
+void landdamage(struct lndstr *lp, int dam);
+s_char *prland(struct lndstr *lp);
 
 #endif /* _LAND_H_ */
index f29a0d4aa4be9000fee3ad0b558306b068e22771..435b229aaf6419fe66a6c948dda0f25508c97139 100644 (file)
@@ -22,7 +22,6 @@
  */
 #ifndef _LWP_H_
 #define _LWP_H_
-#include "prototype.h"
 #ifdef UCONTEXT
 #include <ucontext.h>
 #else  /* UCONTEXT */
@@ -42,7 +41,7 @@ struct lwpProc {
 #endif                         /* UCONTEXT */
     void *sbtm;                        /* bottom of stack attached to it */
     int size;                  /* size of stack */
-    void (*entry) ();          /* entry point */
+    void (*entry)(void *);     /* entry point */
     int dead;                  /* whether the process can be rescheduled */
     int pri;                   /* which scheduling queue we're on */
     long runtime;              /* time at which process is restarted */
@@ -76,27 +75,27 @@ struct lwpSem {
 
 #define LWP_MAX_PRIO   8
 
-struct lwpProc *lwpInitSystem _PROTO((int prio, char **ctxp, int flags));
-struct lwpProc *lwpCreate _PROTO((int prio, void (*)(), int size,
-                                 int flags, char *name, char *desc,
-                                 int argc, char **argv, void *ud));
-void lwpExit _PROTO((void));
-void lwpTerminate _PROTO((struct lwpProc * p));
-void lwpYield _PROTO((void));
-void lwpSleepFd _PROTO((int fd, int flags));
-void lwpSleepUntil _PROTO((long until));
-void lwpWakeupFd _PROTO((struct lwpProc * p));
-void *lwpGetUD _PROTO((struct lwpProc * p));
-void lwpSetUD _PROTO((struct lwpProc * p, char *ud));
-void lwpSetDesc _PROTO((struct lwpProc * p, char *name, char *desc));
-int lwpSetPriority _PROTO((int prio));
-void lwpReschedule _PROTO((void));
+struct lwpProc *lwpInitSystem(int prio, char **ctxp, int flags);
+struct lwpProc *lwpCreate(int prio, void (*)(void *), int size,
+                         int flags, char *name, char *desc,
+                         int argc, char **argv, void *ud);
+void lwpExit(void);
+void lwpTerminate(struct lwpProc * p);
+void lwpYield(void);
+void lwpSleepFd(int fd, int flags);
+void lwpSleepUntil(long until);
+void lwpWakeupFd(struct lwpProc * p);
+void *lwpGetUD(struct lwpProc * p);
+void lwpSetUD(struct lwpProc * p, char *ud);
+void lwpSetDesc(struct lwpProc * p, char *name, char *desc);
+int lwpSetPriority(int prio);
+void lwpReschedule(void);
 
-struct lwpSem *lwpCreateSem _PROTO((char *name, int count));
-void lwpSignal _PROTO((struct lwpSem *));
-void lwpWait _PROTO((struct lwpSem *));
-void lwpSelect _PROTO((int argc, char **argv));
-void lwpStatus _PROTO((struct lwpProc * proc, char *format, ...));
+struct lwpSem *lwpCreateSem(char *name, int count);
+void lwpSignal(struct lwpSem *);
+void lwpWait(struct lwpSem *);
+void lwpSelect(void *);
+void lwpStatus(struct lwpProc * proc, char *format, ...);
 
 extern struct lwpProc *LwpCurrent;
 
index 92a49e5fec3193396da96559186835b3f8eef0ef..0a407d8605e130372f307c332adcc274feef185d 100644 (file)
@@ -57,7 +57,6 @@ typedef unsigned int u_int;
 /*#define _POSIX_ */
 #endif
 
-#include "prototype.h"
 #include "options.h"
 
 /* This is the structure we use to keep track of the global mobility
@@ -115,7 +114,6 @@ typedef short coord;                /* also change NSC_COORD in nsc.h */
 #define hours(x)       (60*60*(x))
 #define days(x)                (60*60*24*(x))
 
-typedef void (*voidfunc) ();
 typedef int (*qsort_func_t) (const void *, const void *);
 
        /* return codes from command routines */
@@ -124,70 +122,18 @@ typedef int (*qsort_func_t) (const void *, const void *);
 #define        RET_SYN         2       /* syntax error in command */
 #define        RET_SYS         3       /* system error (missing file, etc) */
 
-#define MAX_DISTPATH_LEN       10      /* Has to go somewhere */
+double dmax(double n1, double n2);
+double dmin(double n1, double n2);
 
-/*
- * references to library functions which aren't related to any
- * particular object, and are of general interest
- */
-#if !defined(ALPHA) && !defined(__osf__) && !defined(__linux__) && !defined(_WIN32)
-extern long random();
-#endif
-
-double dmax _PROTO((double n1, double n2));
-double dmin _PROTO((double n1, double n2));
-
-extern s_char *numstr _PROTO((s_char buf[], int n));
-extern s_char *esplur _PROTO((int n));
-extern s_char *splur _PROTO((int n));
-extern s_char *iesplur _PROTO((int n));
-extern s_char *plur _PROTO((int n, s_char *no, s_char *yes));
-extern s_char *getstarg
-_PROTO((s_char *input, s_char *prompt, s_char buf[]));
-extern s_char *getstring _PROTO((s_char *prompt, s_char buf[]));
+extern s_char *numstr(s_char buf[], int n);
+extern s_char *esplur(int n);
+extern s_char *splur(int n);
+extern s_char *iesplur(int n);
+extern s_char *plur(int n, s_char *no, s_char *yes);
+extern s_char *getstarg(s_char *input, s_char *prompt, s_char buf[]);
+extern s_char *getstring(s_char *prompt, s_char buf[]);
 extern s_char *prbuf(s_char *format, ...);
 
-/*
- * frequently used libc functions
- */
-
-#if !defined(_WIN32)
-#if defined(linux)
-#ifndef __STDC__
-extern char *malloc();
-extern char *calloc();
-#endif
-#else
-#if !defined(ALPHA) && !defined(__osf__) && !defined(ultrix) && !defined(hpux) && !defined(FBSD)
-extern char *malloc();
-extern char *calloc();
-#endif
-#endif
-#endif
-
-#if (!defined (aix) && !defined (sgi))
-extern char *ctime();
-extern char *strncpy();
-extern char *strcpy();
-#endif /* !aix && !sgi */
-
-extern time_t time();
-#if !defined(_WIN32)
-#ifdef linux
-#ifndef atof
-extern double atof();
-#endif
-#else
-extern double atof();
-#endif
-#endif
-
-#if !defined(_WIN32)
-#if !defined (__ppc__) && !defined (hpux) && !defined (aix) && !defined (linux) && !defined(ALPHA) && !defined(__osf__) && !defined(SUN4) && !defined (Rel4) && !(defined (ultrix) && (defined (__STDC__) || defined (__SYSTEMFIVE) || defined (__POSIX)))
-extern char *sprintf();
-#endif /* aix */
-#endif
-
 #define MAXCHRNV 12
 
 #include "prototypes.h"                /* must come at end, after defines and typedefs */
index 891715a68ab3d9fcd826b51e93f791d31cb2446d..6abba32262bb8c10af91b395f6f44e38d59d22c5 100644 (file)
@@ -191,7 +191,6 @@ extern void putrel(struct natstr *np, natid them, int relate);
 extern void putreject(struct natstr *np, natid them, int how, int what);
 extern void putcontact(struct natstr *np, natid them, int contact);
 extern void agecontact(struct natstr *np);
-extern struct fixnat *natfield();
 
 #define NF_INFORM      bit(0)  /* Inform me of telegrams right away */
 #define NF_FLASH       bit(1)  /* Allow other players to flash me (sicko :) */
index 8a03763f5106334f80a4103cb07499b394971232..15493c77eeab2e239000e933f4dc41517734ec74 100644 (file)
@@ -34,7 +34,6 @@
 #ifndef _NSC_H_
 #define _NSC_H_
 
-#include "prototype.h"
 #include "xy.h"
 
 #define NS_LSIZE       128
@@ -55,7 +54,7 @@ struct nstr_sect {
     struct range range;                /* area of coverage */
     int dist;                  /* dist query: range */
     coord cx, cy;              /* dist query: center x-y */
-    int (*read) ();            /* read function */
+    int (*read)(int type, int id, caddr_t ptr);        /* read function */
     int ncond;                 /* # of selection conditions */
     struct nscstr cond[NS_NCOND];      /* selection conditions */
 };
@@ -72,7 +71,7 @@ struct nstr_item {
     int size;                  /* NS_LIST: size of list */
     int index;                 /* NS_LIST: index */
     int list[NS_LSIZE];                /* NS_LIST: item list */
-    int (*read) ();            /* read function */
+    int (*read)(int type, int id, caddr_t ptr);        /* read function */
     int flags;                 /* EFF_ flags */
     int ncond;                 /* # of selection conditions */
     struct nscstr cond[NS_NCOND];      /* selection conditions */
@@ -161,6 +160,6 @@ extern s_char *nstr_comp(struct nscstr *, int *, int, s_char *);
 extern int encode(register s_char *, long *, int);
 
 
-extern s_char *decodep _PROTO((register long code, register void *addr));
+extern s_char *decodep(register long code, register void *addr);
 
 #endif /* _NSC_H_ */
index 65b2332725d405be6f5915a0837399209cf2fe91..a1bfe52ec4ffc760fb2d734bdbbc8a99d2bc1702 100644 (file)
@@ -35,8 +35,6 @@
 #ifndef _OPTLIST_H_
 #define _OPTLIST_H_
 
-#include "prototype.h"
-
 struct option_list {
     char *opt_key;
     int *opt_valuep;
@@ -44,8 +42,8 @@ struct option_list {
 
 extern struct option_list Options[];
 
-extern void set_option _PROTO((const char *key));
-extern void delete_option _PROTO((const char *key));
+extern void set_option(const char *key);
+extern void delete_option(const char *key);
 
 extern int WORLD_X;
 extern int WORLD_Y;
@@ -104,7 +102,7 @@ extern int opt_ROLLOVER_AVAIL;
 struct keymatch;               /* forward decl */
 
 /* function prototype for variable setting routines */
-typedef void KmFunc _PROTO((struct keymatch * kp, s_char **av));
+typedef void KmFunc(struct keymatch * kp, s_char **av);
 
 /* current known routines */
 #if defined(__cplusplus) || (defined(__STDC__) &&__STDC__)
index b990bc3e521a9d0385432e73d10a592b7e3b3597..684e549b8e6f391fe6481f9919b422954e1c5677 100644 (file)
@@ -72,10 +72,7 @@ extern int chkpath(natid, s_char *, coord, coord);
 extern void pathrange(register coord, register coord, register s_char *,
                      int, struct range *);
 
-extern s_char *masktopath();
-extern long pathtomask();
-
-extern double sector_mcost();
+extern double sector_mcost(struct sctstr *sp, int do_bonus);
 
 #define        P_NONE          0       /* NO destinations allowed */
 #define        P_WALKING       1       /* use BestLandPath, only owned */
index 3becdf3a22558562ea3eb47185a7d58c44a5b7c2..2004373bfb7d3c82ec6af16f214da6adb40e778f 100644 (file)
@@ -165,14 +165,10 @@ struct shiplook {
 #define PLN_LOAD(b, t) (t ? (b * (logx((double)t, (double)50.0) < 1.0 ? 1.0 : \
                                  logx((double)t, (double)50.0))) : b)
 
-double sqrt();
-double logx();
-
-float pln_damage_sect();
+double logx(double d, double base);
 
 void count_planes();
-double sqrt();
-s_char *prplane();
+s_char *prplane(struct plnstr *pp);
 
 
 /* src/lib/subs/aircombat.c */
index a1744fb2dfcb5aec8e2e857f8ab43d4fc42f3296..1940281312cb22d94114ef951c1cd097c0e92cdd 100644 (file)
@@ -39,7 +39,6 @@
 #if !defined(_WIN32)
 #include <netinet/in.h>
 #endif
-#include "prototype.h"
 #include "queue.h"
 #include "misc.h"
 #include "com.h"
diff --git a/include/prototype.h b/include/prototype.h
deleted file mode 100644 (file)
index 68ec07f..0000000
+++ /dev/null
@@ -1,44 +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.
- *
- *  ---
- *
- *  prototype.h: Various prototype stuff
- * 
- *  Known contributors to this file:
- * 
- */
-
-/* this stuff ought to be somewhere general... */
-#ifndef _PROTOTYPE_H_
-#define _PROTOTYPE_H_
-#if defined(__cplusplus) || (defined(__STDC__) &&__STDC__) || defined(_WIN32)
-#define _PROTO(x)       x
-#else
-#define _PROTO(x)       ()
-#define const
-#define volatile
-#endif
-#endif /* _PROTOTYPE_H_ */
index dca8442d1fa4d7cb4eeeb55232bece8abac0aad6..a7c6914135397f25f6a07fa56059c987cc11133b 100644 (file)
@@ -58,7 +58,7 @@ extern void shutdwn(int sig);
 /* src/lib/empthread/lwp.c */
 #ifdef _EMPTH_LWP
 extern int empth_init(char **ctx, int flags);
-extern empth_t *empth_create(int prio, void (*entry) (), int size,
+extern empth_t *empth_create(int prio, void (*entry)(void *), int size,
                             int flags, char *name, char *desc, void *ud);
 #if 0
 extern void empth_setctx(void *ctx);
@@ -79,7 +79,7 @@ extern void empth_alarm(int sig);
 /* src/lib/empthread/pthread.c */
 #ifdef _EMPTH_POSIX
 extern int empth_init(char **ctx_ptr, int flags);
-extern empth_t *empth_create(int prio, void (*entry) (),
+extern empth_t *empth_create(int prio, void (*entry)(void *),
                             int size, int flags,
                             char *name, char *desc, void *ud);
 extern empth_t *empth_self(void);
@@ -346,9 +346,9 @@ 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 void bp_enable_cachepath();
-extern void bp_disable_cachepath();
-extern void bp_clear_cachepath();
+extern void bp_enable_cachepath(void);
+extern void bp_disable_cachepath(void);
+extern void bp_clear_cachepath(void);
 extern s_char *BestDistPath(s_char *, struct sctstr *, struct sctstr *,
                            double *, int);
 extern s_char *BestLandPath(s_char *, struct sctstr *, struct sctstr *,
@@ -856,6 +856,6 @@ extern int feed_ship(struct shpstr *, register int *, int, int *, int);
  */
 /* shutdown.c */
 extern void shutdown_init(void);
-extern void shutdown_sequence(int argc, s_char **argv);
+extern void shutdown_sequence(void *);
 
 #endif /* _PROTOTYPES_H_ */
index e4e512dd622d9c400fede5bcd353e206d78c801b..dfc0e8c3745b754535b5cbe7ccdf0efa3c51170b 100644 (file)
@@ -168,7 +168,7 @@ struct dchrstr {
 
 /* things relating to sectors */
 extern int sctoff(coord x, coord y);
-extern double landgun();
+extern double landgun(int effic, int guns);
 
 extern int sct_maxno;
 extern struct dchrstr dchr[];
index 7eaceadc43b2bfe0b318aa6d49edd6b4942a3b40..97e20d4e1becea02bf5f11568e2a0817aa979edc 100644 (file)
@@ -193,7 +193,7 @@ struct mchrstr {
 #define getshipp(n) \
        (struct shpstr *) ef_ptr(EF_SHIP, n)
 
-extern double seagun();
+extern double seagun(int effic, int guns);
 
 extern struct mchrstr mchr[];
 extern int shp_maxno;
@@ -216,8 +216,7 @@ struct mlist {
 #define SHP_FIR(b, t) (t ? (b * (logx((double)t, (double)60.0) < 1.0 ? 1.0 : \
                             logx((double)t, (double)60.0))) : b)
 
-double sqrt();
-double logx();
+double logx(double d, double base);
 
  /* return codes from shp_check_nav */
 #define CN_NAVIGABLE   (0)
index bca64db704d2ac4dc015217a988a33e5654a2dd2..9beac75cb6014a0a1e76b8b363f68f102c176e97 100644 (file)
@@ -43,8 +43,6 @@
 #include "land.h"
 #include "ship.h"
 
-#include "prototype.h"
-
 struct trdstr {
     short ef_type;
     natid trd_owner;
@@ -76,7 +74,7 @@ union trdgenstr {
     struct shpstr shp;
 };
 
-s_char *trade_nameof _PROTO((struct trdstr * tp, union trdgenstr * tgp));
+s_char *trade_nameof(struct trdstr * tp, union trdgenstr * tgp);
 
 #define gettrade(n, p) \
        ef_read(EF_TRADE, n, (caddr_t)p)
index 163859c86ef99efdf70299fef06c561fd08d758e..bb8276276414c40cddb929cee0e4349a683b3017 100644 (file)
@@ -53,7 +53,6 @@ struct range {
     int height;
 };
 
-extern s_char *xyfmt();
 extern s_char *xyas(coord x, coord y, natid country);
 extern s_char *ownxy(struct sctstr *sp);
 extern coord xrel(struct natstr *np, coord absx);
index 803f41030bc08b6b3c1f851a6c0d3aff0ba83420..b44ee9fd102cdf3ef50bd488ad609bbf3bc2a6ef 100644 (file)
 #endif
 
 int
-expect(s, match, buf)
-int s;
-int match;
-s_char *buf;
+expect(int s, int match, s_char *buf)
 {
     int size;
     s_char *p;
@@ -143,10 +140,7 @@ s_char *buf;
 }
 
 void
-sendcmd(s, cmd, arg)
-int s;
-int cmd;
-s_char *arg;
+sendcmd(int s, int cmd, s_char *arg)
 {
     extern struct fn fnlist[];
     s_char buf[128];
index 908c7a75569553c8386ae7be6999d0ac46927d8e..bccff963be6343b0be64fd07db5a82d7303b05e5 100644 (file)
@@ -36,7 +36,7 @@
 #define _FNLIST_H_
 
 struct fn {
-    int (*func) ();
+    int (*func)(void);
     s_char *name;
     int value;
 };
index ef3645f2345e43ab194f9a105c828cc88f67dcbc..0cffd316c6e478a950cb34987fc46bc6500188cb 100644 (file)
@@ -37,8 +37,7 @@
 #endif
 
 int
-handleintr(s)
-int s;
+handleintr(int s)
 {
     extern int interrupt;
 
index 6900a937d20538cf4fc41557e9009319153cd57c..d801c56c1ccb0ad4f579900139d881df3371afd3 100644 (file)
@@ -50,9 +50,7 @@
 #include "misc.h"
 
 int
-hostaddr(name, addr)
-s_char *name;
-struct sockaddr_in *addr;
+hostaddr(s_char *name, struct sockaddr_in *addr)
 {
     struct hostent *hp;
 
@@ -76,9 +74,7 @@ struct sockaddr_in *addr;
 }
 
 int
-hostport(name, addr)
-s_char *name;
-struct sockaddr_in *addr;
+hostport(s_char *name, struct sockaddr_in *addr)
 {
     struct servent *sp;
 
@@ -101,8 +97,7 @@ struct sockaddr_in *addr;
 }
 
 int
-hostconnect(addr)
-struct sockaddr_in *addr;
+hostconnect(struct sockaddr_in *addr)
 {
     int s;
 
index be4542bbd010d839c12e845cc2a6fd760a365808..5d735b61982de18ee90e35bbc422ab244417bf0c 100644 (file)
@@ -51,20 +51,18 @@ typedef struct iovec {
 #endif
 
 
-static int ioqtobuf();
-static int ioqtoiov();
-static void enqueuecc();
-static int dequeuecc();
+static int ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc);
+static int ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max);
+static void enqueuecc(struct ioqueue *ioq, s_char *buf, int cc);
+static int dequeuecc(register struct ioqueue *ioq, register int cc);
 
-void insque();
-void remque();
-void initque();
-struct qelem *makeqt();
+void insque(struct qelem *, struct qelem *);
+void remque(struct qelem *);
+void initque(struct qelem *p);
+struct qelem *makeqt(int nelem);
 
 void
-ioq_init(ioq, bsize)
-struct ioqueue *ioq;
-int bsize;
+ioq_init(struct ioqueue *ioq, int bsize)
 {
     extern s_char num_teles[];
 
@@ -80,10 +78,7 @@ int bsize;
  * return # of iovec initialized.
  */
 int
-ioq_peekiov(ioq, iov, max)
-struct ioqueue *ioq;
-struct iovec *iov;
-int max;
+ioq_peekiov(struct ioqueue *ioq, struct iovec *iov, int max)
 {
     if (ioq->cc <= 0)
        return 0;
@@ -96,18 +91,13 @@ int max;
  * number of bytes actually found.
  */
 int
-ioq_peek(ioq, buf, cc)
-struct ioqueue *ioq;
-s_char *buf;
-int cc;
+ioq_peek(struct ioqueue *ioq, s_char *buf, int cc)
 {
     return ioqtobuf(ioq, buf, cc);
 }
 
 int
-ioq_dequeue(ioq, cc)
-struct ioqueue *ioq;
-int cc;
+ioq_dequeue(struct ioqueue *ioq, int cc)
 {
     if (dequeuecc(ioq, cc) != cc)
        return 0;
@@ -115,10 +105,7 @@ int cc;
 }
 
 int
-ioq_read(ioq, buf, cc)
-struct ioqueue *ioq;
-s_char *buf;
-int cc;
+ioq_read(struct ioqueue *ioq, s_char *buf, int cc)
 {
     int n;
 
@@ -129,24 +116,19 @@ int cc;
 }
 
 void
-ioq_write(ioq, buf, cc)
-struct ioqueue *ioq;
-s_char *buf;
-int cc;
+ioq_write(struct ioqueue *ioq, s_char *buf, int cc)
 {
     enqueuecc(ioq, buf, cc);
 }
 
 int
-ioq_qsize(ioq)
-struct ioqueue *ioq;
+ioq_qsize(struct ioqueue *ioq)
 {
     return ioq->cc;
 }
 
 void
-ioq_drain(ioq)
-struct ioqueue *ioq;
+ioq_drain(struct ioqueue *ioq)
 {
     struct io *io;
     struct qelem *qp;
@@ -161,10 +143,7 @@ struct ioqueue *ioq;
 }
 
 s_char *
-ioq_gets(ioq, buf, cc)
-struct ioqueue *ioq;
-s_char *buf;
-int cc;
+ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
 {
     register s_char *p;
     register s_char *end;
@@ -195,10 +174,7 @@ int cc;
  * left for a higher level.
  */
 static int
-ioqtobuf(ioq, buf, cc)
-register struct ioqueue *ioq;
-s_char *buf;
-int cc;
+ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc)
 {
     register struct io *io;
     struct qelem *qp;
@@ -235,10 +211,7 @@ int cc;
  * of a full ioqueue still be quick.
  */
 static int
-ioqtoiov(ioq, iov, max)
-register struct ioqueue *ioq;
-register struct iovec *iov;
-register int max;
+ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max)
 {
     register struct io *io;
     register int cc;
@@ -265,10 +238,7 @@ register int max;
  * append a buffer to the end of the ioq.
  */
 static void
-enqueuecc(ioq, buf, cc)
-struct ioqueue *ioq;
-s_char *buf;
-int cc;
+enqueuecc(struct ioqueue *ioq, s_char *buf, int cc)
 {
     struct io *io;
 
@@ -286,9 +256,7 @@ int cc;
  * which are no longer used.
  */
 static int
-dequeuecc(ioq, cc)
-register struct ioqueue *ioq;
-register int cc;
+dequeuecc(register struct ioqueue *ioq, register int cc)
 {
     register struct io *io;
     register struct qelem *qp;
index 1479cc12e57eb9bfb76d0bbfb559be37b5e05edf..f8c43e15755d41446d6b9457755ad4343f80c993 100644 (file)
 #include <unistd.h>
 #endif
 
-int expect();
-void sendcmd();
+int expect(int s, int match, s_char *buf);
+void sendcmd(int s, int cmd, s_char *arg);
 
 int
-login(s, uname, cname, cpass, kill_proc)
-int s;
-s_char *uname;
-s_char *cname;
-s_char *cpass;
-int kill_proc;
+login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
 {
     s_char tmp[128];
     s_char buf[1024];
index 5da18dc19313213619462373c8a93e19ce5c1a5b..e3571a15b5cf65dedbc9f307c1a9f72647b5c659 100644 (file)
@@ -72,27 +72,25 @@ HANDLE hStdIn;
 int interrupt;
 int sock;
 
-void saveargv();
-void getsose();
-int hostport();
-int hostaddr();
-int hostconnect();
-int login();
-void ioq_init();
-void io_init();
-int handleintr();
-int termio();
-int serverio();
-void servercmd();
-void ioq_drain();
+void saveargv(int ac, s_char **src, s_char **dst);
+void getsose(void);
+int hostport(s_char *name, struct sockaddr_in *addr);
+int hostaddr(s_char *name, struct sockaddr_in *addr);
+int hostconnect(struct sockaddr_in *addr);
+int login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc);
+void ioq_init(struct ioqueue *ioq, int bsize);
+void io_init(void);
+int handleintr(int);
+int termio(int fd, int sock, FILE *auxfi);
+int serverio(int s, struct ioqueue *ioq);
+void servercmd(struct ioqueue *ioq, FILE *auxfi);
+void ioq_drain(struct ioqueue *ioq);
 
 static void intr(int sig);
 
 
 int
-main(ac, av)
-int ac;
-s_char *av[];
+main(int ac, s_char **av)
 {
 #ifdef _WIN32
     WSADATA WsaData;
index 4de7856f0e28e0e07c04f305f80cb616c8b4199c..a71285760586f99d78ae9ec4da0b258d1a1321b5 100644 (file)
@@ -39,9 +39,7 @@
 #include "queue.h"
 
 void
-insque(p, q)
-struct qelem *p;
-struct qelem *q;
+insque(struct qelem *p, struct qelem *q)
 {
     p->q_forw = q->q_forw;
     p->q_back = q;
@@ -50,24 +48,21 @@ struct qelem *q;
 }
 
 void
-remque(p)
-struct qelem *p;
+remque(struct qelem *p)
 {
     p->q_back->q_forw = p->q_forw;
     p->q_forw->q_back = p->q_back;
 }
 
 void
-initque(p)
-struct qelem *p;
+initque(struct qelem *p)
 {
     p->q_forw = p;
     p->q_back = p;
 }
 
 struct qelem *
-makeqt(nelem)
-int nelem;
+makeqt(int nelem)
 {
     struct qelem *table;
     struct qelem *qp;
index eacebd502d771e94c1f8496eded5a8b9dd2be1d6..388ba57de12b10cf168b3f413976f1fd658a0a52 100644 (file)
 #include "misc.h"
 
 void
-saveargv(ac, src, dst)
-int ac;
-s_char **src;
-s_char **dst;
+saveargv(int ac, s_char **src, s_char **dst)
 {
     register s_char *ptr;
     register int i;
index 60cbb1664ed2e7c85c78e758257609d3c531427d..5e3f507bb8c5a690ed54cd494ff8837e73415025 100644 (file)
@@ -48,7 +48,7 @@
 #include <io.h>
 #endif
 
-extern s_char *gettag();
+extern s_char *gettag(s_char *p);
 
 s_char num_teles[64];
 static s_char the_prompt[1024];
@@ -59,23 +59,21 @@ FILE *redir_fp;
 FILE *pipe_fp;
 int exec_fd;
 
-void prompt();
-void doredir();
-void dopipe();
-void doexecute();
-void output();
-void screen();
-int sendeof();
-int termio();
-void _noecho();
+void prompt(FILE *auxfi);
+void doredir(s_char *p);
+void dopipe(s_char *p);
+void doexecute(s_char *p, FILE *auxfi);
+void output(int code, s_char *buf, FILE *auxfi);
+void screen(register s_char *buf);
+int sendeof(int);
+int termio(int fd, int sock, FILE *auxfi);
+void _noecho(int);
 
 extern s_char *SO;
 extern s_char *SE;
 
 void
-servercmd(ioq, auxfi)
-struct ioqueue *ioq;
-FILE *auxfi;
+servercmd(struct ioqueue *ioq, FILE *auxfi)
 {
     s_char *ioq_gets(struct ioqueue *, s_char *, int);
     s_char buf[1024];
@@ -133,8 +131,7 @@ FILE *auxfi;
 }
 
 void
-prompt(auxfi)
-FILE *auxfi;
+prompt(FILE *auxfi)
 {
     if (mode == C_PROMPT) {
        if (redir_fp) {
@@ -166,8 +163,7 @@ FILE *auxfi;
  * opens redir_fp if successful
  */
 void
-doredir(p)
-s_char *p;
+doredir(s_char *p)
 {
     s_char *how;
     s_char *name;
@@ -219,8 +215,7 @@ s_char *p;
  * opens "pipe_fp" if successful
  */
 void
-dopipe(p)
-s_char *p;
+dopipe(s_char *p)
 {
     s_char *tag;
 
@@ -250,9 +245,7 @@ s_char *p;
 }
 
 void
-doexecute(p, auxfi)
-s_char *p;
-FILE *auxfi;
+doexecute(s_char *p, FILE *auxfi)
 {
     extern int sock;
     int fd;
@@ -296,10 +289,7 @@ FILE *auxfi;
 }
 
 void
-output(code, buf, auxfi)
-int code;
-s_char *buf;
-FILE *auxfi;
+output(int code, s_char *buf, FILE *auxfi)
 {
     switch (code) {
     case C_NOECHO:
@@ -357,8 +347,7 @@ FILE *auxfi;
 }
 
 void
-screen(buf)
-register s_char *buf;
+screen(register s_char *buf)
 {
     register s_char *sop;
     register s_char c;
index 57d69936487d5a822bbd623b2d4a196f78f82d42..3420fc0eb322dcd1f5027be8e9a9c680eb71ffed 100644 (file)
 #include <io.h>
 #endif
 
-void ioq_write();
+void ioq_write(struct ioqueue *ioq, s_char *buf, int cc);
 
 int
-serverio(s, ioq)
-int s;
-struct ioqueue *ioq;
+serverio(int s, struct ioqueue *ioq)
 {
     s_char *buf;
     int n;
index 7661110b26ad48d0e4c9681dc22e5280859da4be..cff7a39cfd516ab9b2cfb0883d9cb0ebcd891d0f 100644 (file)
@@ -48,7 +48,7 @@ s_char exec[8];
 static unsigned short tagnum;
 
 void
-io_init()
+io_init(void)
 {
     taglist = NULL;
     buf[0] = 0;
@@ -57,8 +57,7 @@ io_init()
 }
 
 s_char *
-gettag(p)
-s_char *p;
+gettag(s_char *p)
 {
     struct tagstruct *tag1, *tag2;
 
index a5646c0ea90f5c0ef2acb9983784eb0616f3c1b5..73de77a6a85b7882f6008a4c12cbeee2133cb61b 100644 (file)
@@ -60,13 +60,10 @@ extern s_char exec[];
 extern HANDLE hStdIn;
 #endif
 
-int sendeof();
+int sendeof(int sock);
 
 int
-termio(fd, sock, auxfi)
-int fd;
-int sock;
-FILE *auxfi;
+termio(int fd, int sock, FILE *auxfi)
 {
     s_char out[4096];
     int i, n;
@@ -226,8 +223,7 @@ FILE *auxfi;
 }
 
 int
-sendeof(sock)
-int sock;
+sendeof(int sock)
 {
 #ifndef _WIN32
     if (write(sock, "ctld\n", 5) < 5) {
@@ -245,8 +241,7 @@ int echomode = 1;
 
 #if defined(hpux) || defined(aix) || defined (sgi) || defined(linux)
 void
-_noecho(fd)
-int fd;
+_noecho(int fd)
 {
     struct termio io;
 
@@ -257,8 +252,7 @@ int fd;
 }
 
 void
-_echo(fd)
-int fd;
+_echo(int fd)
 {
     struct termio io;
 
index f5083feadf1772c802a4ef827c8cd73fb6e18611..214721570966080c4944a7e9038bef4812858089 100644 (file)
 s_char *SO = 0;
 s_char *SE = 0;
 
-int tgetent();
+int tgetent(char *, char *);
 
 void
-parsedelay(r)
-s_char *r;
+parsedelay(s_char *r)
 {
     s_char *s, *t;
 
@@ -64,10 +63,10 @@ s_char *r;
 }
 
 void
-getsose()
+getsose(void)
 {
 #ifndef _WIN32
-    extern s_char *tgetstr();
+    extern s_char *tgetstr(char *, char **);
     s_char *cp;
     s_char *term;
     static s_char tbuf[1024];
index 83fd4ebdd6c1e50e131ad609e10ecf305daf7ac2..c42e7bfe397b1576e28e65be8d5cd526b5afd83b 100644 (file)
@@ -54,7 +54,7 @@ char *_ipglob_copyright_header =
 
 
 int
-main()
+main(void)
 {
     char buf[256];
     char *cp;
index cb95e316fff2ce348948d7023ec1be1df67eb558..50b1ed6559654f287d4a590122854a4475e21759 100644 (file)
@@ -165,9 +165,9 @@ extern struct as_path *as_find_cachepath(coord fx,
 /* Functions that are "private" to algorithm */
 
 extern void as_add_cachepath(struct as_data *adp);
-extern void as_clear_cachepath();
-extern void as_enable_cachepath();
-extern void as_disable_cachepath();
+extern void as_clear_cachepath(void);
+extern void as_enable_cachepath(void);
+extern void as_disable_cachepath(void);
 
 extern void as_makepath(struct as_data *adp);
 extern void as_free_path(struct as_path *pp);
index c3a12cf6d9d621e108c2c1b6751a3767df7dbbbc..5d27ed27f7daaf6ae28abc49af3b63db171cc735 100644 (file)
@@ -55,13 +55,13 @@ static struct as_frompath **fromhead = (struct as_frompath **)0;
 static int as_cachepath_on = 0;        /* Default to off */
 
 void
-as_enable_cachepath()
+as_enable_cachepath(void)
 {
     as_cachepath_on = 1;
 }
 
 void
-as_disable_cachepath()
+as_disable_cachepath(void)
 {
     as_cachepath_on = 0;
 }
@@ -135,7 +135,7 @@ as_add_cachepath(struct as_data *adp)
 }
 
 void
-as_clear_cachepath()
+as_clear_cachepath(void)
 {
     struct as_frompath *from, *from2;
     struct as_topath *to, *to2;
index 7f957b30842d43278a5949a899dfa418d07b2d9f..fd88559257735ab1bd5df496071b7474b7799512 100644 (file)
@@ -47,7 +47,6 @@ as_search(struct as_data *adp)
     struct as_queue *qp;
     struct as_path *pp;
 #endif /* DEBUG */
-    struct as_queue *as_extend(struct as_data *adp);
 
     as_reset(adp);
 
index 981fe4bd0a460465276bc546406393a2811ed915..bc62b9d50e1212be679f92a69996a428996beed3 100644 (file)
@@ -67,7 +67,6 @@ anti(void)
     double odds, damil, dache;
     int mob;
     int n_cheleft;
-    extern double hap_fact();
 
     if (!snxtsct(&nstr, player->argp[1]))
        return RET_SYN;
index 0add43f527a171b6ad50bd31dbd37b2e383cbc35..8e0000ab5be51732ab139501dd830e4bb6fddd9e 100644 (file)
@@ -48,7 +48,7 @@ int
 best(void)
 {
     double cost;
-    s_char *BestDistPath(), *BestLandPath(), *s;
+    s_char *s;
     struct sctstr s1, s2;
     struct nstr_sect nstr, nstr2;
     s_char buf[1024];
index cbf44321f776535a920deda4a9f8f8670456c195..579d74fa8621d0d4dfcc0af701a4af105d6d9aff 100644 (file)
@@ -214,7 +214,6 @@ bomb(void)
 static void
 pin_bomb(struct emp_qelem *list, struct sctstr *target)
 {
-    extern s_char *effadv();
     struct dchrstr *dcp;
     int nplanes;
     int nships;
index c0d417f45c7598cda6e0cec69a558988dd35f1f8..c71589c0992387ec58f0c742ee081375e0a6f369 100644 (file)
@@ -348,7 +348,6 @@ calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs, int *Nuws,
     extern long lnd_money[MAXNOC];
     extern long air_money[MAXNOC];
     extern long tpops[MAXNOC];
-    extern int mil_dbl_pay;
 
     lnd_money[player->cnum] = sea_money[player->cnum] = 0;
     air_money[player->cnum] = 0;
index b92411208505dd1aa4277c1a002b3632b41cf493..b77bfc9d9b7a401aaa05137ea10f116642ecf564 100644 (file)
@@ -31,6 +31,7 @@
  *      Steve McClure, 1998-2000
  */
 
+#include <math.h>
 #ifdef Rel4
 #include <string.h>
 #endif /* Rel4 */
@@ -69,9 +70,6 @@ static int build_plane(register struct sctstr *sp,
 
 static int cash;               /* static ok */
 
-double sqrt(double);
-double logx();
-
 extern int morale_base;
 extern int sect_mob_neg_factor;
 extern int etu_per_update;
@@ -494,7 +492,6 @@ build_land(register struct sctstr *sp, register struct lchrstr *lp,
     int points;
     struct natstr *natp;
     float eff = ((float)LAND_MINEFF / 100.0);
-    double techfact(int, double);
     int mil, lcm, hcm, gun, shell;
     int freeland = 0;
 
index 4313a497613ef48a701efc3023fdb9d6d1e99ee6..d0d38d6cb9e15dbdaec6284640c80e4c519f473f 100644 (file)
@@ -111,9 +111,7 @@ static int
 cons_choose(struct ltcomstr *ltcp)
 {
     s_char *p;
-    extern int disloan();
-    extern int distrea();
-    int (*dis) ();
+    int (*dis)();
     struct lonstr *lp;
     struct trtstr *tp;
     s_char prompt[128];
index 93995340ef1047c8140c351d9d9bcabe9f7bac50..f51a6c6eabb11364995397d180f116da17838209 100644 (file)
@@ -71,8 +71,6 @@ static long
 do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash,
        int for_real)
 {
-    extern int opt_NO_LCMS;
-    extern int opt_NO_HCMS;
     register int n;
     s_char *p;
     int breaksanct;
index 1099e183dc30f91f2e80100da2c104a906341fa4..b61a5c478ee4256eb66dd4cf0c2fed737a7a2d61 100644 (file)
@@ -53,7 +53,6 @@
 int
 diss(void)
 {
-    int quit(void);
     struct sctstr sect;
     struct lndstr land;
     struct shpstr ship;
index e4eb20fcb961d4fc6d552cb4dcbb8cc96a996cd0..fffb012a4513964665f27ad40d225f0bd0d54518 100644 (file)
@@ -51,7 +51,6 @@ land(void)
     struct nstr_item ni;
     struct lndstr land;
     int vec[I_MAX + 1];
-    s_char *mission_short_name();
 
     if (!snxtitem(&ni, EF_LAND, player->argp[1]))
        return RET_SYN;
index 6072e1046633ac98eb1c3417a5b1f5b70db216b0..7a8d730b20a63ad9d0bec7d4c8c4bce480efcd43 100644 (file)
@@ -53,7 +53,7 @@ ldump(void)
     struct nstr_item ni;
     struct lndstr land;
     int vec[I_MAX + 1];
-    s_char *mission_short_name();
+    s_char *mission_short_name(int);
     int n, i;
     struct natstr *np;
     time_t now;
index b4e681896a5295c04686f37bad8c793ba67d67b6..5620493fdaf1b7a8f3829b1c19817afb9ba0adce 100644 (file)
@@ -257,7 +257,6 @@ look_land(register struct lndstr *lookland)
     int vrange;
     int i;
     int dist;
-    double techfact(int, double);
 
     drange = techfact(lookland->lnd_tech, (double)lookland->lnd_spy);
     drange = (drange * ((double)lookland->lnd_effic / 100.0));
index f24452015f0924b1c947036f0c9eea5f893cc24d..2b6edc54f104f0bec757532bfc1fbeab0e5110f5 100644 (file)
@@ -50,7 +50,7 @@ lsta(void)
     int nunits;
     struct nstr_item ni;
     struct lndstr land;
-    s_char *mission_short_name();
+    s_char *mission_short_name(int);
 
     if (!snxtitem(&ni, EF_LAND, player->argp[1]))
        return RET_SYN;
index b9bab295a4910532ccc54c0b46d977b1390ee2da..d35ec1da50eadd47462a701f4d42c220425281c0 100644 (file)
@@ -57,7 +57,7 @@ mark(void)
        return display_mark("   ");
 }
 
-void
+static void
 pr_mark(struct comstr *comm)
 {
     time_t now;
index 610542e9e32b7fb38dc1c4939de786546076c4e7..4b35da692ee307c6cfffce6b9fefa4fdbe17a17a 100644 (file)
@@ -780,7 +780,6 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
     struct sctstr firing;
     struct nstr_sect ns;
     struct flist *fp;
-    double techfact(int, double);
     extern int torpedo_damage;
     int gun;
 
index bbcc7ac40b97938ecef938b7cc3b629931d8c798..99b79f9a4ad4ff0e0a3b042cdde162ff880951e7 100644 (file)
@@ -71,7 +71,6 @@ mission(void)
     extern int land_mob_max;
     extern int plane_mob_max;
     extern double mission_mob_cost;
-    s_char *nameofitem();
     s_char prompt[128];
     s_char buf[1024];
 
index 0c1f0eccc993e39844c041ee6acb636a82b04e30..6d77f57971ff19e3d0612f99b8d5d90b1f8e293c 100644 (file)
@@ -53,7 +53,6 @@ morale(void)
     int i, min;
     s_char *p;
     s_char mess[128];
-    double techfact(int, double);
     s_char buf[1024];
 
     if (!snxtitem(&np, EF_LAND, player->argp[1]))
index 4a6aa96ff2d96bc2eb8acced412a879704a7667f..93b154197eea3652b361bcb2702abd5e04072d05 100644 (file)
@@ -46,8 +46,8 @@
 #include "optlist.h"
 #include "commands.h"
 
-
 #include <fcntl.h>
+#include <math.h>
 
 extern float start_education, start_happiness;
 extern float start_technology, start_research;
@@ -321,7 +321,6 @@ deity_build_land(int type, coord x, coord y, natid own, int tlev)
     struct lchrstr *lp;
     struct nstr_item nstr;
     struct natstr *natp;
-    double techfact(int, double);
     int lvec[I_MAX + 1];
     int extend = 1;
 
index dcbf364a8f749fb3310272b3f4360233fae09d16..7980dc17f8d8d11dfd0e9b3af990212a6d6943be 100644 (file)
@@ -58,7 +58,7 @@ path(void)
     coord cx, cy;
     int i;
     int y;
-    s_char *pp, *p, *BestDistPath();
+    s_char *pp, *p;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
     static s_char *mapbuf = (s_char *)0;
index c78ead66e3f1d850a2d6ba48e3184b97677e67e1..1a0c299eb000d6e21fbc5b12d0901bbef1300cae 100644 (file)
@@ -38,8 +38,7 @@
 #include "nat.h"
 #include "file.h"
 #include "commands.h"
-
-extern void shutdown_sequence();
+#include "prototypes.h"
 
 int
 shut(void)
index 6977a10ece3b893f9ece447228277a680ce8e04e..6aa607ff775c95257ba8bf9faf9429d5ad23decc 100644 (file)
@@ -42,6 +42,7 @@
 #include "path.h"
 #include "file.h"
 #include "commands.h"
+#include "combat.h"
 
 int
 sinfra(void)
@@ -49,8 +50,6 @@ sinfra(void)
     struct sctstr sect;
     int nsect;
     struct nstr_sect nstr;
-    double sector_mcost();
-    double sector_strength(struct sctstr *);
 
     if (!snxtsct(&nstr, player->argp[1]))
        return RET_SYN;
index 164389de3fd3cb63e650b9a3fe55a6f4cf24c714..4f76e861629888bee6e3e5bbe46c7fdb32673338 100644 (file)
@@ -49,7 +49,7 @@
 int
 thre(void)
 {
-    extern struct ichrstr *whatitem();
+    extern struct ichrstr *whatitem(s_char *, s_char *);
     struct sctstr sect;
     struct nstr_sect nstr;
     int val;
index e9f4b8e911586ae23a007db3cbf306543117ca5a..c767c54876e2192539f485e430fc470f28f8315d 100644 (file)
@@ -32,6 +32,8 @@
  *     Steve McClure, 1996-2000
  */
 
+#include <math.h>
+
 #include "misc.h"
 #include "player.h"
 #include "xy.h"
index faf782b2a91bfcdae2a38ef01a488026140b02d3..183f0ec116010f6d93b5bb05948f9e59419d7280 100644 (file)
@@ -424,8 +424,6 @@ ef_flags(int type)
 time_t
 ef_mtime(int type)
 {
-    extern time_t fdate(int fd);
-
     if (empfile[type].fd <= 0)
        return 0;
     return fdate(empfile[type].fd);
index cb882abb4da1cc472facc61686fbbea135cf66e9..4a80f9babb0e200c0041658a1b4cd2c834a63132 100644 (file)
@@ -110,8 +110,6 @@ kw_find(s_char *name)
 s_char *
 kw_parse(int type, s_char *text, int *data)
 {
-    s_char *get_time(s_char *ptr, int *data);
-    s_char *weekday(s_char *ptr, int *data);
     s_char *next;
 
     while (isspace(*text))
index dcc997d955aba27c5edd80dbdaaad96ef4a4bad9..34bee7d51ecc3c66eec14bc16e2b61742aa9ee96 100644 (file)
@@ -51,7 +51,7 @@
 static s_char *logfile = 0;
 
 s_char *
-getlogfile()
+getlogfile(void)
 {
     return (s_char *)logfile;
 }
index 3bba0d7ae8273f5c1710f32bedc8e03faf86ae51..8f79912b1ed2aaa124c32e7e2c520f4d1c22b4bf 100644 (file)
@@ -441,19 +441,19 @@ bp_coord_hash(struct as_coord c)
 }
 
 void
-bp_enable_cachepath()
+bp_enable_cachepath(void)
 {
     as_enable_cachepath();
 }
 
 void
-bp_disable_cachepath()
+bp_disable_cachepath(void)
 {
     as_disable_cachepath();
 }
 
 void
-bp_clear_cachepath()
+bp_clear_cachepath(void)
 {
     as_clear_cachepath();
 }
index cf1c2d59d8b7b444a4ecdbbf99ad7f2fd308eccf..d4c9964f0c83832e6ffcaf18327521d9c741cd33 100644 (file)
@@ -49,6 +49,7 @@
 #include "gen.h"
 #include "subs.h"
 #include "lost.h"
+#include "combat.h"
 
 int
 sect_damage(struct sctstr *sp, int dam, struct emp_qelem *list)
@@ -93,7 +94,6 @@ sectdamage(struct sctstr *sp, int dam, struct emp_qelem *list)
     struct plnstr plane;
     double real_dam;
     int eff;
-    double sector_strength();
 
     /* Some sectors are harder/easier to kill..   */
     /* Average sector has a dstr of 1, so adjust  */
index 70a76531405d26d826e923ada70d96635a6a1c93..9879f002d945420afa85bf97256031c49244e59e 100644 (file)
@@ -46,8 +46,8 @@ empth_init(char **ctx, int flags)
 
 
 empth_t *
-empth_create(int prio, void (*entry) (), int size, int flags, char *name,
-            char *desc, void *ud)
+empth_create(int prio, void (*entry)(void *), int size, int flags,
+            char *name, char *desc, void *ud)
 {
     /* inherit flags */
     if (!flags)
index 2accf92ac445846362c918937531b028f7ca7aa1..3d827e4c3961eec856c10ee504cbc4f19c1788b3 100644 (file)
@@ -390,7 +390,7 @@ empth_init(char **ctx_ptr, int flags)
  *         It is also passed to the entry function...
  */
 empth_t *
-empth_create(int prio, void (*entry) (), int size, int flags,
+empth_create(int prio, void (*entry)(void *), int size, int flags,
             char *name, char *desc, void *ud)
 {
     loc_Thread_t *pThread = NULL;
index 92f283ecf28b2fde6eb90a36b86b1916774aa32e..7c074705162a5279b3642711106debc79ff9e1f4 100644 (file)
@@ -57,9 +57,9 @@ static pthread_mutex_t mtx_ctxsw;     /* thread in critical section */
 
 
 #if 0
-static void empth_setctx _PROTO((void *));
+static void empth_setctx(void *);
 #endif
-static void empth_restorectx _PROTO(());
+static void empth_restorectx();
 
 static void *
 empth_start(void *ctx)
@@ -176,7 +176,7 @@ empth_init(char **ctx_ptr, int flags)
  * More then that priority is not needed even in lwp threads.
  */
 empth_t *
-empth_create(int prio, void (*entry) (), int size, int flags,
+empth_create(int prio, void (*entry)(void *), int size, int flags,
             char *name, char *desc, void *ud)
 {
     pthread_t t;
index fb0c34122be57003480e9b442ad6bc912b63537e..7d4a4fbaa67f16aeb9147ddf0c5adc9700efe460 100644 (file)
@@ -392,9 +392,8 @@ struct keymatch configkeys[] = {
     {NULL, NULL, (caddr_t)0, 0, NULL}
 };
 
-static void fixup_files _PROTO((void));
-static struct keymatch *keylookup
-_PROTO((s_char *key, struct keymatch tbl[]));
+static void fixup_files(void);
+static struct keymatch *keylookup(s_char *key, struct keymatch tbl[]);
 
 
 /*
index fb42f5d18107e46622967b373807201e811b2140..64dfe84e85d72bef284735a6d7bc7905f50ea6c0 100644 (file)
@@ -37,8 +37,6 @@
 s_char *
 getstarg(s_char *input, s_char *prompt, s_char *buf)
 {
-    extern s_char *getstring(s_char *prompt, s_char *buf);
-
     *buf = '\0';
     if (input == 0 || *input == 0) {
        if (getstring(prompt, buf) == 0)
index 16547babef5988730fc51ab8664b17076c7b5b15..75a9c364d4594f8360d9f009e102982de00e10bb 100644 (file)
@@ -72,7 +72,7 @@ struct iop {
     int flags;
     s_char *assoc;
     int bufsize;
-    int (*notify) ();
+    int (*notify)(void);
 };
 
 void
@@ -81,7 +81,7 @@ io_init(void)
 }
 
 struct iop *
-io_open(int fd, int flags, int bufsize, int (*notify) (void),
+io_open(int fd, int flags, int bufsize, int (*notify)(void),
        s_char *assoc)
 {
     struct iop *iop;
index b679d2b8aac548e3438a46d6c451a10c02ac6bd8..3f7f8253eaf0744deefc74a11d89d973b7560c30 100644 (file)
@@ -37,7 +37,6 @@
 int
 onearg(s_char *arg, s_char *prompt)
 {
-    extern s_char *getstring(s_char *prompt, s_char *buf);
     int n;
     s_char buf[1024];
 
index c076c89bc2000910eebd03a57a24833759309650..0d6dc44f304b08ab5cf2f4b22f424881897c3c5c 100644 (file)
@@ -48,7 +48,8 @@ static struct lwpProc *tempcontext;
 struct lwpProc *initcontext = NULL;
 int startpoint;
 
-startcontext()
+static void
+startcontext(void)
 {
     int space[10000];
     int x;
@@ -64,9 +65,7 @@ startcontext()
 }
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     struct lwpProc holder;
     int endpoint;
@@ -96,9 +95,7 @@ void *sp;
 #elif defined(hpux)
 
 void
-lwpInitContext(newp, sp)
-volatile struct lwpProc *volatile newp;
-void *sp;
+lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
 {
     static jmp_buf *cpp;
     extern struct lwpProc *LwpCurrent;
@@ -113,8 +110,7 @@ void *sp;
 }
 
 int
-lwpSave(jb)
-jmp_buf jb;
+lwpSave(jmp_buf jb)
 {
     /* save stack pointer and return program counter */
     asm("stw   %sp, 4(%arg0)");
@@ -149,8 +145,7 @@ jmp_buf jb;
 }
 
 void
-lwpRestore(jb)
-jmp_buf jb;
+lwpRestore(jmp_buf jb)
 {
     /* restore stack pointer and program counter */
     asm volatile ("ldw 4(%arg0), %sp");
@@ -185,9 +180,7 @@ jmp_buf jb;
 
 #elif defined(BSD386)
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     newp->context[2] = (int)sp;
     newp->context[0] = (int)lwpEntryPoint;
@@ -196,9 +189,7 @@ void *sp;
 #elif defined(FBSD)
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     setjmp(newp->context);
     newp->context->_jb[2] = (int)sp;
@@ -209,9 +200,7 @@ void *sp;
 #elif defined(__linux__)
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
 #if defined(__GLIBC__) && (__GLIBC__ >= 2)
 #if defined(__PPC__)
@@ -232,9 +221,7 @@ void *sp;
 #elif defined(SUN3)
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     newp->context[2] = (int)sp;
     newp->context[3] = (int)lwpEntryPoint;
@@ -245,9 +232,7 @@ void *sp;
 #include <stdio.h>
 
 void
-lwpInitContext(newp, stack)
-struct lwpProc *newp;
-void *stack;
+lwpInitContext(struct lwpProc *newp, void *stack)
 {
     int *sp = (int *)stack;
     int *fp = 0;
@@ -282,8 +267,7 @@ void *stack;
 }
 
 int
-lwpSave(jb)
-jmp_buf jb;
+lwpSave(jmp_buf jb)
 {
     asm("movl 4(ap), r0");     /* r0 = &jb */
     asm("movl r6, (r0)");      /* jb[0] = r6 */
@@ -298,8 +282,7 @@ jmp_buf jb;
 }
 
 void
-lwpRestore(jb)
-jmp_buf jb;
+lwpRestore(jmp_buf jb)
 {
     asm("movl 4(ap), r0");     /* r0 = &jb */
     asm("movl (r0), r6");      /* r6 = jb[0] */
@@ -319,9 +302,7 @@ jmp_buf jb;
 #elif defined(SUN4)
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     static jmp_buf *cpp;
     extern struct lwpProc *LwpCurrent;
@@ -377,9 +358,7 @@ void *sp;
  */
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     newp->context[4] = (int)sp;
     newp->context[5] = (int)lwpEntryPoint;
@@ -395,9 +374,7 @@ void *sp;
  */
 
 void
-lwpInitContext(newp, spp)
-struct lwpProc *newp;
-stack_t *spp;
+lwpInitContext(struct lwpProc *newp, stack_t *spp)
 {
     getcontext(&(newp->context));
     newp->context.uc_stack.ss_sp = spp->ss_sp;
@@ -410,9 +387,7 @@ stack_t *spp;
 #include <c_asm.h>
 
 void
-lwpInitContext(newp, sp)
-struct lwpProc *newp;
-void *sp;
+lwpInitContext(struct lwpProc *newp, void *sp)
 {
     extern long *_gp;
 
@@ -425,15 +400,13 @@ void *sp;
 }
 
 int
-lwpSave(jb)
-jmp_buf jb;
+lwpSave(jmp_buf jb)
 {
     return _setjmp(jb);
 }
 
 void
-lwpRestore(jb)
-jmp_buf jb;
+lwpRestore(jmp_buf jb)
 {
     /* resume, but get the pv from the jmp_buf */
     asm("ldq   %pv, 248(%a0)");
index 3bef1e0c82375c370eca3b3effab9162c39ced46..458271ce0d01536edb88051935583949c1f7288a 100644 (file)
@@ -58,14 +58,13 @@ static int oldmask;
 extern char *strdup();
 #endif /* NOSTRDUP */
 
-static void lwpStackCheckInit();
-static int lwpStackCheck();
-static void lwpStackCheckUsed();
+static void lwpStackCheckInit(struct lwpProc *newp);
+static int lwpStackCheck(struct lwpProc *newp);
+static void lwpStackCheckUsed(struct lwpProc *newp);
 
 /* check stack direction */
 static int
-growsdown(x)
-void *x;
+growsdown(void *x)
 {
     int y;
 
@@ -86,7 +85,7 @@ void *x;
  * processes here and free them.
  */
 void
-lwpReschedule()
+lwpReschedule(void)
 {
     extern struct lwpQueue LwpSchedQ[];
     static int lcount = LCOUNT;
@@ -195,9 +194,8 @@ lwpReschedule()
  * lwpEntryPoint -- process entry point.
  */
 void
-lwpEntryPoint()
+lwpEntryPoint(void)
 {
-    extern struct lwpProc *LwpCurrent;
 #ifdef POSIXSIGNALS
     sigset_t set;
 #endif /* POSIXSIGNALS */
@@ -215,8 +213,7 @@ lwpEntryPoint()
     *LwpContextPtr = LwpCurrent->ud;
 
     lwpStatus(LwpCurrent, "starting at entry point");
-    (*LwpCurrent->entry) (LwpCurrent->argc, LwpCurrent->argv,
-                         LwpCurrent->ud);
+    (*LwpCurrent->entry)(LwpCurrent->ud);
     lwpExit();
 #ifdef BOUNDS_CHECK
     BOUNDS_CHECKING_ON;
@@ -229,18 +226,8 @@ lwpEntryPoint()
  * lwpCreate -- create a process.
  */
 struct lwpProc *
-lwpCreate(priority, entry, size, flags, name, desc, argc, argv, ud)
-int priority;
-void (*entry) ();
-int size;
-int flags;
-char *name;
-char *desc;
-int argc;
-char *argv[];
-void *ud;
+lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name, char *desc, int argc, char **argv, void *ud)
 {
-    extern struct lwpProc *LwpCurrent;
     struct lwpProc *newp;
     int *s, x;
 #ifdef UCONTEXT
@@ -329,8 +316,7 @@ void *ud;
 }
 
 void
-lwpDestroy(proc)
-struct lwpProc *proc;
+lwpDestroy(struct lwpProc *proc)
 {
     if (proc->flags & LWP_STACKCHECK) {
        lwpStackCheckUsed(proc);
@@ -355,12 +341,8 @@ struct lwpProc *proc;
  * lwpReady -- put process on ready queue.  if null, assume current.
  */
 void
-lwpReady(p)
-struct lwpProc *p;
+lwpReady(struct lwpProc *p)
 {
-    extern struct lwpProc *LwpCurrent;
-    extern struct lwpQueue LwpSchedQ[];
-
     if (!p)
        p = LwpCurrent;
     lwpStatus(p, "added to run queue");
@@ -371,8 +353,7 @@ struct lwpProc *p;
  * return user's data
  */
 void *
-lwpGetUD(p)
-struct lwpProc *p;
+lwpGetUD(struct lwpProc *p)
 {
     if (!p)
        p = LwpCurrent;
@@ -383,9 +364,7 @@ struct lwpProc *p;
  * set user's data
  */
 void
-lwpSetUD(p, ud)
-struct lwpProc *p;
-char *ud;
+lwpSetUD(struct lwpProc *p, char *ud)
 {
     if (!p)
        p = LwpCurrent;
@@ -396,10 +375,7 @@ char *ud;
  * set name & desc
  */
 void
-lwpSetDesc(p, name, desc)
-struct lwpProc *p;
-char *name;
-char *desc;
+lwpSetDesc(struct lwpProc *p, char *name, char *desc)
 {
     if (!p)
        p = LwpCurrent;
@@ -413,7 +389,7 @@ char *desc;
  * lwpYield -- yield the processor to another thread.
  */
 void
-lwpYield()
+lwpYield(void)
 {
     lwpStatus(LwpCurrent, "yielding control");
     lwpReady(LwpCurrent);
@@ -424,7 +400,7 @@ lwpYield()
  * cause the current process to be scheduled for deletion.
  */
 void
-lwpExit()
+lwpExit(void)
 {
     lwpStatus(LwpCurrent, "marking self as dead");
     LwpCurrent->dead = 1;
@@ -436,8 +412,7 @@ lwpExit()
  * remove any lingering FD action
  */
 void
-lwpTerminate(p)
-struct lwpProc *p;
+lwpTerminate(struct lwpProc *p)
 {
     lwpStatus(p, "terminating process");
     p->dead = 1;
@@ -450,8 +425,7 @@ struct lwpProc *p;
  * if the new priority is lower than the old, we reschedule.
  */
 int
-lwpSetPriority(new)
-int new;
+lwpSetPriority(int new)
 {
     int old = LwpCurrent->pri;
 
@@ -470,13 +444,8 @@ int new;
  * initialise the coroutine structures
  */
 struct lwpProc *
-lwpInitSystem(pri, ctxptr, flags)
-int pri;
-char **ctxptr;
-int flags;
+lwpInitSystem(int pri, char **ctxptr, int flags)
 {
-    extern struct lwpQueue LwpSchedQ[];
-    extern struct lwpProc *LwpCurrent;
     struct lwpQueue *q;
     int i, *stack;
     struct lwpProc *sel;
@@ -517,8 +486,7 @@ int flags;
  * used.
  */
 static void
-lwpStackCheckInit(newp)
-struct lwpProc *newp;
+lwpStackCheckInit(struct lwpProc *newp)
 {
     register int i;
     register long *lp;
@@ -542,8 +510,7 @@ struct lwpProc *newp;
  *   down the entire process.
  */
 static int
-lwpStackCheck(newp)
-struct lwpProc *newp;
+lwpStackCheck(struct lwpProc *newp)
 {
     register int end, amt;
     register unsigned int i;
@@ -602,8 +569,7 @@ struct lwpProc *newp;
  * Figure out how much stack was used by this thread.
  */
 static void
-lwpStackCheckUsed(newp)
-struct lwpProc *newp;
+lwpStackCheckUsed(struct lwpProc *newp)
 {
     register int i;
     register long *lp;
index 53fc15359c226d29bd662ed9ab1901b05834d4e7..4e356f55251d39fc1281dc60907d35f922edf73b 100644 (file)
 #define LCOUNT -1
 
 #ifdef hpux
-int lwpSave _PROTO((jmp_buf));
-void lwpRestore _PROTO((jmp_buf));
+int lwpSave(jmp_buf);
+void lwpRestore(jmp_buf);
 #endif
 
 #if defined(MIPS) || defined(AIX32) || defined(ALPHA) || defined(__vax)
-int lwpSave _PROTO((jmp_buf));
-void lwpRestore _PROTO((jmp_buf));
+int lwpSave(jmp_buf);
+void lwpRestore(jmp_buf);
 #elif defined(SUN4)
 #define        lwpSave(x)      _setjmp(x)
 #define lwpRestore(x)  _longjmp(x, 1)
@@ -78,27 +78,27 @@ typedef struct {
 #endif
 
 /* internal routines */
-void lwpAddTail _PROTO((struct lwpQueue *, struct lwpProc *));
-struct lwpProc *lwpGetFirst _PROTO((struct lwpQueue *));
-void lwpReschedule _PROTO((void));
-void lwpReady _PROTO((struct lwpProc *));
-void lwpOnalarm _PROTO((void));
+void lwpAddTail(struct lwpQueue *, struct lwpProc *);
+struct lwpProc *lwpGetFirst(struct lwpQueue *);
+void lwpReschedule(void);
+void lwpReady(struct lwpProc *);
+void lwpOnalarm(void);
 
 #ifdef UCONTEXT
-void lwpInitContext _PROTO((struct lwpProc *, stack_t *));
+void lwpInitContext(struct lwpProc *, stack_t *);
 #else  /* GETCONTEXT */
 #ifdef hpc
-void lwpInitContext _PROTO((struct lwpProc *, void *));
+void lwpInitContext(struct lwpProc *, void *);
 #else
 #ifdef hpux
-void lwpInitContext _PROTO((volatile struct lwpProc * volatile, void *));
+void lwpInitContext(volatile struct lwpProc * volatile, void *);
 #else
-void lwpInitContext _PROTO((struct lwpProc *, void *));
+void lwpInitContext(struct lwpProc *, void *);
 #endif /* hpux */
 #endif /* hpc */
 #endif /* GETCONTEXT */
-void lwpEntryPoint _PROTO((void));
-void lwpInitSelect _PROTO((struct lwpProc * self));
-void lwpDestroy _PROTO((struct lwpProc * proc));
+void lwpEntryPoint(void);
+void lwpInitSelect(struct lwpProc * self);
+void lwpDestroy(struct lwpProc * proc);
 
 #endif /* _LWP_H */
index 69fa110a5079308ba5ac40961a8cec149c9ee209..13d8123f7626e993acbcb6a3bd1331d46fd1a065 100644 (file)
 #ifndef _LWP_H
 #define _LWP_H
 
-#ifndef _PROTO
-#ifdef __cplusplus
-#define _PROTO(x)      x
-#else
-#define _PROTO(x)      ()
-#endif
-#endif
-
 #include <setjmp.h>
 #include <sys/time.h>
 
@@ -67,24 +59,23 @@ struct lwpSem {
 
 #define LWP_MAX_PRIO   8
 
-struct lwpProc *lwpInitSystem _PROTO((int));
-struct lwpProc *lwpCreate
-_PROTO((int, void (*)(), int, int, char **, void *));
-void lwpExit _PROTO((void));
-void lwpTerminate _PROTO((struct lwpProc *));
-void lwpYield _PROTO((void));
-void lwpSleepFd _PROTO((int fd, int flags));
-void lwpSleepUntil _PROTO((long until));
-void lwpWakeupFd _PROTO((struct lwpProc *));
-void *lwpGetUD _PROTO((struct lwpProc *));
-void lwpSetUD _PROTO((struct lwpProc *, char *));
-int lwpSetPriority _PROTO((int));
-void lwpReschedule _PROTO(());
+struct lwpProc *lwpInitSystem(int);
+struct lwpProc *lwpCreate(int, void (*)(void *), int, int, char **, void *);
+void lwpExit(void);
+void lwpTerminate(struct lwpProc *);
+void lwpYield(void);
+void lwpSleepFd(int fd, int flags);
+void lwpSleepUntil(long until);
+void lwpWakeupFd(struct lwpProc *);
+void *lwpGetUD(struct lwpProc *);
+void lwpSetUD(struct lwpProc *, char *);
+int lwpSetPriority(int);
+void lwpReschedule();
 
-struct lwpSem *lwpCreateSem _PROTO((int));
-void lwpSignal _PROTO((struct lwpSem *));
-void lwpWait _PROTO((struct lwpSem *));
-void lwpSelect _PROTO((int argc, char **argv));
+struct lwpSem *lwpCreateSem(int);
+void lwpSignal(struct lwpSem *);
+void lwpWait(struct lwpSem *);
+void lwpSelect(int argc, char **argv);
 
 extern struct lwpProc *LwpCurrent;
 
index b44e85f93e6976d29b9cf20523136585eaf0fe34..73e0695d47784f79ad73f76460e5d83fcece9044 100644 (file)
@@ -27,8 +27,7 @@
 #if defined(_EMPTH_LWP)
 
 struct lwpProc *
-lwpGetFirst(q)
-struct lwpQueue *q;
+lwpGetFirst(struct lwpQueue *q)
 {
     struct lwpProc *head;
 
@@ -38,9 +37,7 @@ struct lwpQueue *q;
 }
 
 void
-lwpAddTail(q, p)
-register struct lwpQueue *q;
-register struct lwpProc *p;
+lwpAddTail(register struct lwpQueue *q, register struct lwpProc *p)
 {
     if (!q->tail)
        q->head = p;
index 0cc400e4c4c200b91d6a503447e832fe473b4a52..0e369d2d98db5eca877d9d8e0e4ae28b515e2d20 100644 (file)
@@ -62,8 +62,7 @@ struct lwpSelect {
 struct lwpSelect LwpSelect;
 
 void
-lwpInitSelect(proc)
-struct lwpProc *proc;
+lwpInitSelect(struct lwpProc *proc)
 {
     LwpSelect.maxfd = 0;
     LwpSelect.nfds = 0;
@@ -82,9 +81,7 @@ struct lwpProc *proc;
 }
 
 void
-lwpSleepFd(fd, mask)
-int fd;
-int mask;
+lwpSleepFd(int fd, int mask)
 {
     extern struct lwpProc *LwpCurrent;
 
@@ -116,8 +113,7 @@ int mask;
 }
 
 void
-lwpWakeupFd(proc)
-struct lwpProc *proc;
+lwpWakeupFd(struct lwpProc *proc)
 {
     if (proc->fd < 0)
        return;
@@ -132,8 +128,7 @@ struct lwpProc *proc;
 }
 
 void
-lwpSleepUntil(until)
-long until;
+lwpSleepUntil(long int until)
 {
     extern struct lwpProc *LwpCurrent;
 
@@ -149,9 +144,7 @@ long until;
 
 /*ARGSUSED*/
 void
-lwpSelect(argc, argv)
-int argc;
-char **argv;
+lwpSelect(void *arg)
 {
     extern struct lwpProc *LwpCurrent;
     struct lwpProc *us = LwpCurrent;
index 58867cf26fb89d873b725de243c14eba78481f4c..16147db57435f2f39af29d3c55707c73f5f45781 100644 (file)
@@ -38,9 +38,7 @@ extern char *strdup();
  * create a lwpSemaphore.
  */
 struct lwpSem *
-lwpCreateSem(name, count)
-char *name;
-int count;
+lwpCreateSem(char *name, int count)
 {
     struct lwpSem *new;
 
@@ -57,8 +55,7 @@ int count;
  * the blocked process has a higher priority than ours'.
  */
 void
-lwpSignal(s)
-struct lwpSem *s;
+lwpSignal(struct lwpSem *s)
 {
     extern struct lwpProc *LwpCurrent;
 
@@ -78,8 +75,7 @@ struct lwpSem *s;
  * wait on a lwpSemaphore
  */
 void
-lwpWait(s)
-struct lwpSem *s;
+lwpWait(struct lwpSem *s)
 {
     extern struct lwpProc *LwpCurrent;
 
index 9ff92943b075c38a6d58d466bad2adb1f5b68f7e..3a4ef837212b74b0f6f39135b60541f08bbe77c5 100644 (file)
 #include "nat.h"
 #include "file.h"
 
-extern int add();
-extern int anti();
-extern int assa();
-extern int atta();
-extern int boar();
-extern int bdes();
-extern int bomb();
-extern int buil();
-extern int chan();
-extern int coas();
-extern int comm();
-extern int coun();
-extern int decl();
-extern int deli();
-extern int show();
+extern int add(void);
+extern int anti(void);
+extern int assa(void);
+extern int atta(void);
+extern int boar(void);
+extern int bdes(void);
+extern int bomb(void);
+extern int buil(void);
+extern int chan(void);
+extern int coas(void);
+extern int comm(void);
+extern int coun(void);
+extern int decl(void);
+extern int deli(void);
+extern int show(void);
 extern int show_motd(void);
-extern int desi();
-extern int diss();
-extern int drop();
+extern int desi(void);
+extern int diss(void);
+extern int drop(void);
 extern int echo(void);
-extern int enli();
-extern int fire();
-extern int flee();
-extern int fly();
-extern int force();
-extern int info();
-extern int apro();
-extern int load();
-extern int look();
-extern int map();
-extern int mine();
-extern int move();
-extern int nati();
-extern int navi();
-extern int head(), news();
-extern int nuke();
-extern int offs();
-extern int para();
-extern int path();
-extern int payo();
-extern int powe();
-extern int rada();
-extern int rea();
-extern int real();
-extern int reco();
-extern int rout();
-extern int sona();
-extern int spy();
-extern int tele();
-extern int tend();
-extern int torp();
-extern int tran();
-extern int trea();
-extern int turn();
-extern int vers();
+extern int enli(void);
+extern int fire(void);
+extern int flee(void);
+extern int fly(void);
+extern int force(void);
+extern int info(void);
+extern int apro(void);
+extern int load(void);
+extern int look(void);
+extern int map(void);
+extern int mine(void);
+extern int move(void);
+extern int nati(void);
+extern int navi(void);
+extern int head(void), news(void);
+extern int nuke(void);
+extern int offs(void);
+extern int para(void);
+extern int path(void);
+extern int payo(void);
+extern int powe(void);
+extern int rada(void);
+extern int rea(void);
+extern int real(void);
+extern int reco(void);
+extern int rout(void);
+extern int sona(void);
+extern int spy(void);
+extern int tele(void);
+extern int tend(void);
+extern int torp(void);
+extern int tran(void);
+extern int trea(void);
+extern int turn(void);
+extern int vers(void);
 /*
  * new commands
  */
-extern int repo();
-extern int laun();
-extern int new();
-extern int shoo();
-extern int thre();
-extern int dist();
-extern int sct();
-extern int plan();
-extern int arm();
-extern int hard();
-extern int upgr();
-extern int surv();
-extern int capi();
-extern int orig();
-extern int conv();
-extern int leve();
-extern int cuto();
-extern int prod();
-extern int wai();
-extern int carg();
-extern int terr();
-extern int sate();
-extern int give();
-extern int edit();
-extern int wipe();
-extern int dump();
-extern int ldump();
-extern int ndump();
-extern int pdump();
-extern int pboa();
-extern int sdump();
-extern int lost();
-extern int explore();
-extern int reso();
-extern int scra();
-extern int rela();
-extern int brea();
-extern int upda();
-extern int hidd();
-extern int orde();
-extern int qorde();
-extern int sorde();
-extern int reje();
-extern int acce();
-extern int sabo();
-extern int scut();
-extern int grin();
-extern int shar();
-extern int sail();             /* Forsman's hacks */
-extern int foll();
-extern int mobq();
-extern int name();
-extern int range();
-extern int zdon();
-extern int fuel();
-extern int multifire();
-extern int retr();
-extern int budg();
-extern int wire();
-extern int stop();
-extern int start();
+extern int repo(void);
+extern int laun(void);
+extern int new(void);
+extern int shoo(void);
+extern int thre(void);
+extern int dist(void);
+extern int sct(void);
+extern int plan(void);
+extern int arm(void);
+extern int hard(void);
+extern int upgr(void);
+extern int surv(void);
+extern int capi(void);
+extern int orig(void);
+extern int conv(void);
+extern int leve(void);
+extern int cuto(void);
+extern int prod(void);
+extern int wai(void);
+extern int carg(void);
+extern int terr(void);
+extern int sate(void);
+extern int give(void);
+extern int edit(void);
+extern int wipe(void);
+extern int dump(void);
+extern int ldump(void);
+extern int ndump(void);
+extern int pdump(void);
+extern int pboa(void);
+extern int sdump(void);
+extern int lost(void);
+extern int explore(void);
+extern int reso(void);
+extern int scra(void);
+extern int rela(void);
+extern int brea(void);
+extern int upda(void);
+extern int hidd(void);
+extern int orde(void);
+extern int qorde(void);
+extern int sorde(void);
+extern int reje(void);
+extern int acce(void);
+extern int sabo(void);
+extern int scut(void);
+extern int grin(void);
+extern int shar(void);
+extern int sail(void);         /* Forsman's hacks */
+extern int foll(void);
+extern int mobq(void);
+extern int name(void);
+extern int range(void);
+extern int zdon(void);
+extern int fuel(void);
+extern int multifire(void);
+extern int retr(void);
+extern int budg(void);
+extern int wire(void);
+extern int stop(void);
+extern int start(void);
 
-extern int land();
-extern int supp();
-extern int lboa();
-extern int lcarg();
-extern int lload();
-extern int army();
-extern int lrange();
-extern int morale();
-extern int lretr();
-extern int landmine();
-extern int fort();
-extern int march();
-extern int llook();
-extern int mission();
-extern int work();
-extern int ltend();
-extern int cede();
-extern int best();
-extern int newe();
-extern int starve();
+extern int land(void);
+extern int supp(void);
+extern int lboa(void);
+extern int lcarg(void);
+extern int lload(void);
+extern int army(void);
+extern int lrange(void);
+extern int morale(void);
+extern int lretr(void);
+extern int landmine(void);
+extern int fort(void);
+extern int march(void);
+extern int llook(void);
+extern int mission(void);
+extern int work(void);
+extern int ltend(void);
+extern int cede(void);
+extern int best(void);
+extern int newe(void);
+extern int starve(void);
 
-extern int setres();
-extern int setsector();
+extern int setres(void);
+extern int setsector(void);
 
-extern int disa();
-extern int enab();
+extern int disa(void);
+extern int enab(void);
 
 /*
  * Undeclared functions
  */
 extern int quit(void);
-extern int cens();
-extern int demo();
-extern int shi();
-extern int wing();
+extern int cens(void);
+extern int demo(void);
+extern int shi(void);
+extern int wing(void);
 extern int execute(void);
 extern int explain(void);
-extern int set();
+extern int set(void);
 extern int flash(void);
-extern int wall();
-extern int shut();
-extern int togg();
-extern int stre();
-extern int skyw();
-extern int play();
-extern int swaps();
+extern int wall(void);
+extern int shut(void);
+extern int togg(void);
+extern int stre(void);
+extern int skyw(void);
+extern int play(void);
+extern int swaps(void);
 
-extern int trad();
-extern int mark();
-extern int buy();
-extern int mult();
-extern int sell();
-extern int rese();
+extern int trad(void);
+extern int mark(void);
+extern int buy(void);
+extern int mult(void);
+extern int sell(void);
+extern int rese(void);
 
-extern int repa();
-extern int fina();
-extern int coll();
-extern int cons();
-extern int ledg();
-extern int shark();
-extern int offe();
+extern int repa(void);
+extern int fina(void);
+extern int coll(void);
+extern int cons(void);
+extern int ledg(void);
+extern int shark(void);
+extern int offe(void);
 
-extern int mobupdate();
+extern int mobupdate(void);
 
-extern int sinfra();
-extern int improve();
-extern int lsta();
-extern int pstat();
-extern int sstat();
+extern int sinfra(void);
+extern int improve(void);
+extern int lsta(void);
+extern int pstat(void);
+extern int sstat(void);
 
 struct cmndstr player_coms[] = {
 /*  command form                       cost    addr    permit */
index c90d639a2b8aa9b3f8ffb2b2ccda225af21503ff..90ee70af590215fdd5bd5d96cdea6af994e0f6d6 100644 (file)
@@ -163,7 +163,6 @@ command(void)
 {
     register unsigned int x;
     s_char *redir;
-    int kill_player();
     s_char scanspace[1024];
 
     if (getcommand(player->combuf) < 0)
index a7dc836f7072e1e6612cbe306082e7b68e10c666..04d02814f2ea7eda5c47e1f1f6e8d2c7bfa73640 100644 (file)
@@ -148,7 +148,6 @@ int
 print_found(struct shiplook *head)
 {
     struct shiplook *s;
-    extern s_char *effadv(int);
     int first;
     struct mchrstr *mp;
     struct shpstr ship;
index 5a575494d7656da29ec03e73a6eb4b869a833074..f40a8d840308babd3ac6a5f6e1b7bc68526a61d1 100644 (file)
@@ -157,9 +157,7 @@ prcom(int inon, struct combat *com)
 
 /* Doing a sneak attack */
 static void
-do_sneak(def, success)
-struct combat *def;
-int success;
+do_sneak(struct combat *def, int success)
 {
     struct sctstr sect;
     struct natstr *natp = getnatp(player->cnum);
@@ -1147,7 +1145,6 @@ att_combat_eff(struct combat *com)
 {
     double eff = 1.0;
     double str;
-    double sector_strength(struct sctstr *sp);
     struct shpstr ship;
 
     if (com->type == EF_SECTOR) {
index d8ac4692035b6fe5a35e833aa44b6e9158b55475..20c5c0ad610ea81a5cff2ebb9cc82669df8feff9 100644 (file)
@@ -315,7 +315,6 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
 void
 lnd_takemob(struct emp_qelem *list, double loss)
 {
-    extern double combat_mob;
     struct emp_qelem *qp, *next;
     struct llist *llp;
     int new;
index f6873fa9415934fa6613ba05d03c4b06d8231aaf..1b61462d798966018eb0d504894f651b17b38704 100644 (file)
@@ -140,7 +140,7 @@ collateral_damage(coord x, coord y, int dam, struct emp_qelem *list)
     return 0;
 }
 
-int
+static int
 only_subs(struct emp_qelem *list)
 {
     struct emp_qelem *qp;
@@ -977,7 +977,6 @@ show_mission(int type, struct nstr_item *np)
 int
 oprange(struct genitem *gp, int type, int *radius)
 {
-    double techfact(int, double);
     int range;
     struct shpstr ship;
     struct lndstr land;
index a405b707df87c013372df516997feb1abd54719e..e21e4fa436b2348db85acdb3befd7a0c0a2cca97 100644 (file)
@@ -60,8 +60,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
     coord curx, cury, oldx, oldy;
     coord tmpx, tmpy;
     coord dx, dy;
-    s_char *movstr, *BestLandPath(s_char *, struct sctstr *,
-                                 struct sctstr *, double *, int);
+    s_char *movstr;
     double sect_mcost;
     double total_mcost;
     double mv_cost;
index 743c1406b31663ba005efca2232efdba92827bd9..a3044000c81aa958ca0740c26195c6d05d639adc 100644 (file)
@@ -133,7 +133,6 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
 
                        /* Is this the originally scared ship, or a follower */
 {
-    extern double techfact(int, double);
     struct sctstr sect;
     register int n;
     register int m;
@@ -425,7 +424,6 @@ retreat_land1(struct lndstr *lp, s_char code, int orig)
 
                        /* Is this the originally scared unit, or a follower */
 {
-    extern double techfact(int, double);
     struct sctstr sect;
     register int n;
     register int m;
index c1f7ac200417392c149dd43c6d376e1802375f9d..34e5dd65fcf21b3a00f91b14095d611157126c50 100644 (file)
@@ -41,6 +41,7 @@
  *                                    (bailey@mcs.kent.edu)
  */
 
+#include <math.h>
 #include "misc.h"
 #include "player.h"
 #include "nuke.h"
@@ -55,8 +56,6 @@
 #include "nat.h"
 #include "prototypes.h"
 
-double sqrt(double);
-double logx(double, double);
 
 /*
  * This cruft really belongs in the empglb.c file.
index da0e25aa3d210a0772da7da6ca3a87e8c096ebf1..a88e1cffaec98cea4bf15e704bdc3988ca00e2b1 100644 (file)
@@ -380,8 +380,6 @@ shp_mess(s_char *str, struct mlist *mlp)
 static int
 shp_check_nav(struct sctstr *sect)
 {
-    extern struct dchrstr dchr[];
-
     switch (dchr[sect->sct_type].d_flg & 03) {
     case NAVOK:
        break;
index eb0f49982593f1dd9e31f167908df22096544b11..d6c6350ff747151618977e2fdc6d54abaa1bc43a 100644 (file)
@@ -64,7 +64,6 @@ takeover(register struct sctstr *sp, natid newown)
     struct nstr_item ni;
     struct plnstr p;
     struct lndstr land;
-    extern double hap_fact(struct natstr *, struct natstr *);
     extern int etu_per_update;
     extern int sect_mob_neg_factor;
 
index 5d198777086eb6195e77dc4b63011a713df4caea..9f9ec8ee2734a81e2d3f2a6b94bca50ac886468f 100644 (file)
 #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;
index 5e555bba3fd2581d6c8065e941c72cc48ee399df..2edf7cfceef1705b7d4b201a9361d91154933666 100644 (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";
index 9db0d5cd9ae92deee69082d089cac576884edc68..e78a329be0472023e6671f691d5787ff92128218 100644 (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;
index 66558913496654355b8142652e8058648f973394..c2c0c578c082b8bf2c1be5142261537ee012ef43 100644 (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;
index 61622bee7ce467076c3e42df1659cdf98c55a738..223942a6014aeed363f6b4ae095bda0214d1c91e 100644 (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;
index fa3c709722a1d6dcb9333209ac649d5fbaaeb66c..cc30724b3698639db009699f779f0a442aadeff5 100644 (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;
index 382f647403212ed0a27aec6315454c3592ba5192..9cba533031484a6ec9c1c699de826de04663986f 100644 (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 */
index 1190e846660d11e26875c03241f95f7790a983a8..eb474609aea2a48f1b2bf185a0405478b691146b 100644 (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 */
index 60b1978269dc2aa7036b5a3d541c58a14e5048a0..209a605e48192a1504d86183a8a09f14f169bc56 100644 (file)
@@ -40,8 +40,7 @@
 
 /*ARGSUSED*/
 void
-player_kill_idle(argv)
-void *argv;
+player_kill_idle(void *argv)
 {
     extern int max_idle;
     struct player *p;
index 8dcb19393eab4559aece16cf4f2224e1cbf03af7..d14648e84c32d3d3165dddf86f2a051471cb164c 100644 (file)
@@ -43,8 +43,7 @@
 
 /*ARGSUSED*/
 void
-delete_lostitems(argv)
-void *argv;
+delete_lostitems(void *argv)
 {
     extern int lost_items_timeout;
     time_t now;
index 1de51efd8425955985b9f0721b1bd4b633976958..d7e780cde7037582f1e6195b85212db3b2f2a635 100644 (file)
 
 s_char program[] = "server";
 
-extern void player_accept();
-extern void player_kill_idle();
-extern void update_sched();
-extern void delete_lostitems();
+extern void player_accept(void *);
+extern void player_kill_idle(void *);
+extern void update_sched(void *);
+extern void delete_lostitems(void *);
 void nullify_objects(void);
 void init_files(void);
 void close_files(void);
@@ -81,18 +81,16 @@ static void loc_NTInit(void);
 static void loc_NTTerm(void);
 #endif
 
-extern void mobility_init();
-extern void mobility_check();
-extern void market_update();
+extern void mobility_init(void);
+extern void mobility_check(void *);
+extern void market_update(void *);
 
 #if !defined(_WIN32)
 static int mainpid = 0;
 #endif
 
 int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char **argv)
 {
     time_t now;
     int hour[2];
index 1f015eb5a25ac113cebf45e2bcc9d50b4c1933a2..a7d5700bb07e94c1bdbb53760157948e8c64226a 100644 (file)
@@ -42,8 +42,7 @@
 
 /*ARGSUSED*/
 void
-check_all_markets(argv)
-void *argv;
+check_all_markets(void *argv)
 {
     player->proc = empth_self();
     player->cnum = 0;
@@ -67,8 +66,7 @@ void *argv;
 
 /*ARGSUSED*/
 void
-market_update(argv)
-void *argv;
+market_update(void *argv)
 {
     time_t now;
     struct player *dp;
index dcdfd998ce7bf1221ee3846db7d5b3bc32fc87b5..532271847dd6a36cae7b4e1b53b4d4748f474f4f 100644 (file)
@@ -50,9 +50,7 @@ shutdown_init(void)
 }
 
 void
-shutdown_sequence(argc, argv)
-int argc;
-s_char **argv;
+shutdown_sequence(void *argv)
 {
     struct natstr *god;
     struct tm *tm;
index 2af831abbb9c05b997abee9f5c1acaea5b2c0df6..c481297bf73cf3348b5f922f553f58c920c925e0 100644 (file)
@@ -42,9 +42,7 @@
 
 /*ARGSUSED*/
 void
-mobility_check(argv)
-void *argv;
-
+mobility_check(void *argv)
 {
     extern s_char *timestampfil;
     extern int updating_mob;
@@ -93,7 +91,7 @@ void *argv;
 }
 
 void
-mobility_init()
+mobility_init(void)
 {
     extern s_char *timestampfil;
     extern int updating_mob;
index a3f9a8adab6a3f3edf23dc5c4f02b0e181514e6e..cc2eb58781924ba025064b986318cb3e29e7edbb 100644 (file)
 
 empth_sem_t *update_sem;
 
-extern void update_main();
-extern void update_wait();
+extern void update_main(void *);
+extern void update_wait(void *argv);
 time_t update_time;
 
 /*ARGSUSED*/
 void
-update_sched(argv)
-void *argv;
+update_sched(void *argv)
 {
     extern int s_p_etu;
     extern int etu_per_update;
@@ -110,8 +109,7 @@ void *argv;
 
 /*ARGSUSED*/
 void
-update_wait(argv)
-void *argv;
+update_wait(void *argv)
 {
     struct player *p;
     int running;
index ea243f20d7b9e1993663d498336e956a81f1d818..fa9fd328ed3ab7bddc5681c50e41f449153cdaa3 100644 (file)
@@ -87,7 +87,7 @@ static int quiet = 0;
 #define PLATMIN                36      /* plate altitude for plateau */
 #define HIGHMIN                98      /* plate altitude for mountains */
 
-static void qprint _PROTO((const char *str));
+static void qprint(const char *str);
 
 static const char *outfile = "newcap_script";
 /* mark the continents with a * so you can tell them
@@ -170,10 +170,10 @@ void translate_continents(void);
 int map_symbol(int x, int y);
 static void fl_sct_init(coord x, coord y, s_char *ptr);
 
-void print_vars();
+void print_vars(void);
 void fl_move(int);
-void next_coast();
-void grow_islands();
+void next_coast(int c, int x, int y, int *xp, int *yp);
+void grow_islands(void);
 
 /****************************************************************************
   MAIN
@@ -262,7 +262,7 @@ main(int argc, char *argv[])
 }
 
 void
-print_vars()
+print_vars(void)
 {
     if (quiet)
        return;
@@ -279,9 +279,8 @@ print_vars()
     printf("World dimensions: %dx%d\n", WORLD_X, WORLD_Y);
 }
 
-int
-my_sqrt(n)
-int n;
+static int
+my_sqrt(int n)
 {
     int i;
 
@@ -492,9 +491,8 @@ init(void)
 
 /* How isolated is capital j?
 */
-int
-iso(j, newx, newy)
-int j, newx, newy;
+static int
+iso(int j, int newx, int newy)
 {
     int i, md, d = WORLD_X + WORLD_Y;
 
@@ -550,8 +548,7 @@ stable(void)
 */
 
 void
-fl_move(j)
-int j;
+fl_move(int j)
 {
     int i, n, newx, newy;
 
@@ -573,9 +570,8 @@ int j;
 /* Look for a coastal sector of continent c
 */
 
-void
-find_coast(c)
-int c;
+static void
+find_coast(int c)
 {
     int i, j;
 
@@ -589,9 +585,8 @@ int c;
 
 /* Used for measuring distances
 */
-int
-next_vector(n)
-int n;
+static int
+next_vector(int n)
 {
     int i;
 
@@ -608,9 +603,8 @@ int n;
 
 /* Test to see if we're allowed to grow there: the arguments di and id
 */
-int
-try_to_grow(c, newx, newy, d)
-int c, newx, newy, d;
+static int
+try_to_grow(int c, int newx, int newy, int d)
 {
     int i, j, px, py;
 
@@ -640,8 +634,7 @@ int c, newx, newy, d;
 */
 
 void
-next_coast(c, x, y, xp, yp)
-int c, x, y, *xp, *yp;
+next_coast(int c, int x, int y, int *xp, int *yp)
 {
     int i, nx, ny, wat = 0;
 
@@ -667,7 +660,7 @@ int c, x, y, *xp, *yp;
 /* Choose a sector to grow from
 */
 
-int
+static int
 new_try(int c)
 {
     int i, starti;
@@ -695,9 +688,8 @@ new_try(int c)
 /* Grow continent c by 1 sector
 */
 
-int
-grow_one_sector(c)
-int c;
+static int
+grow_one_sector(int c)
 {
     int done, coast_search, try1, x, y, newx, newy, i, n, sx, sy;
 
@@ -774,9 +766,8 @@ grow_continents(void)
 
 /* Choose a place to start growing an island from
 */
-int
-place_island(c, xp, yp)
-int c, *xp, *yp;
+static int
+place_island(int c, int *xp, int *yp)
 {
     int d, sx, sy;
     int ssy = rnd(WORLD_Y);
@@ -806,7 +797,7 @@ int c, *xp, *yp;
 */
 
 void
-grow_islands()
+grow_islands(void)
 {
     int c, x, y, isiz;
 
@@ -839,9 +830,8 @@ create_elevations(void)
 /* Generic function for finding the distance to the closest sea, land, or
    mountain
 */
-int
-distance_to_what(x, y, flag)
-int x, y, flag;
+static int
+distance_to_what(int x, int y, int flag)
 {
     int j, d, px, py;
 
@@ -987,9 +977,8 @@ elevate_sea(void)
   ADD THE RESOURCES
 ****************************************************************************/
 
-int
-set_fert(e)
-int e;
+static int
+set_fert(int e)
 {
     int fert = 0;
     if (e < LANDMIN)
@@ -1001,9 +990,8 @@ int e;
     return fert;
 }
 
-int
-set_oil(e)
-int e;
+static int
+set_oil(int e)
 {
     int oil = 0;
     if (e < LANDMIN)
@@ -1015,9 +1003,8 @@ int e;
     return oil;
 }
 
-int
-set_iron(e)
-int e;
+static int
+set_iron(int e)
 {
     int iron = 0;
     if (e >= IRON_MIN && e < HIGHMIN)
@@ -1027,9 +1014,8 @@ int e;
     return iron;
 }
 
-int
-set_gold(e)
-int e;
+static int
+set_gold(int e)
 {
     int gold = 0;
     if (e >= GOLD_MIN) {
@@ -1043,9 +1029,8 @@ int e;
     return gold;
 }
 
-int
-set_uran(e)
-int e;
+static int
+set_uran(int e)
 {
     int uran = 0;
     if (e >= URAN_MIN && e < HIGHMIN)
@@ -1055,9 +1040,8 @@ int e;
     return uran;
 }
 
-void
-add_resources(sct)
-struct sctstr *sct;
+static void
+add_resources(struct sctstr *sct)
 {
     sct->sct_fertil = set_fert(sct->sct_elev);
     sct->sct_oil = set_oil(sct->sct_elev);
@@ -1249,8 +1233,7 @@ write_newcap_script(void)
 }
 
 static void
-qprint(str)
-const char *str;
+qprint(const char *str)
 {
     if (quiet == 0)
        fputs(str, stdout);
index ed9c587ddc44413703764249ced0d11b5b506c12..f0eae78c2a6d7f56b70f78f5de535f5ee40cefee 100644 (file)
@@ -72,7 +72,6 @@ static void file_sct_init(coord x, coord y, s_char *ptr);
 int
 main(int argc, char *argv[])
 {
-    extern s_char *annfil;
     extern s_char *timestampfil;
     extern s_char *infodir;
     extern s_char *commfil;
index 4797825004b40362bd86dc9346c352b6e25f1c28..0c15e8bbb21b75e2e1a530c1927a488884e30340 100644 (file)
@@ -36,9 +36,7 @@
 #include "prototypes.h"
 
 int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char **argv)
 {
     if (argc > 1)
        emp_config(argv[1]);