Break inclusion cycle: prototypes.h and commands.h included each
other. Ensure headers in include/ can be included in any order (except for econfig-spec.h, which is special). New header types.h to help avoid inclusion cycles. Sort include directives. Remove some superflous includes.
This commit is contained in:
parent
16a0869bb0
commit
e42053d928
373 changed files with 1193 additions and 2516 deletions
|
@ -45,14 +45,14 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "xy.h"
|
||||
#include "sect.h"
|
||||
#include "file.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "path.h"
|
||||
#include "common.h"
|
||||
#include "optlist.h"
|
||||
#include "path.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
static int owned_and_navigable(char *, int, int, int);
|
||||
|
||||
|
|
|
@ -33,19 +33,20 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "plague.h"
|
||||
#include "sect.h"
|
||||
#include "path.h"
|
||||
#include "file.h"
|
||||
#include "xy.h"
|
||||
#include "plane.h"
|
||||
#include "land.h"
|
||||
#include "nsc.h"
|
||||
#include "common.h"
|
||||
#include "subs.h"
|
||||
#include "lost.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "nuke.h"
|
||||
#include "optlist.h"
|
||||
#include "path.h"
|
||||
#include "plague.h"
|
||||
#include "plane.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
void
|
||||
bridgefall(struct sctstr *sp, struct emp_qelem *list)
|
||||
|
|
|
@ -33,21 +33,21 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "xy.h"
|
||||
#include "commodity.h"
|
||||
#include "file.h"
|
||||
#include "land.h"
|
||||
#include "loan.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "nuke.h"
|
||||
#include "plane.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
#include "plane.h"
|
||||
#include "nuke.h"
|
||||
#include "land.h"
|
||||
#include "nsc.h"
|
||||
#include "nat.h"
|
||||
#include "commodity.h"
|
||||
#include "loan.h"
|
||||
#include "commands.h"
|
||||
#include "trade.h"
|
||||
#include "xy.h"
|
||||
|
||||
/* Note that timestamps make things tricky. And, we don't
|
||||
* really care about the timestamp, we just care about the rest
|
||||
|
|
|
@ -36,10 +36,10 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "optlist.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
#include "product.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
static int read_custom_table_file(char *);
|
||||
|
||||
|
|
|
@ -34,19 +34,17 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "damage.h"
|
||||
#include "land.h"
|
||||
#include "misc.h"
|
||||
#include "nsc.h"
|
||||
#include "nuke.h"
|
||||
#include "optlist.h"
|
||||
#include "plane.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
#include "land.h"
|
||||
#include "plane.h"
|
||||
#include "nuke.h"
|
||||
#include "nsc.h"
|
||||
#include <fcntl.h>
|
||||
#include "optlist.h"
|
||||
#include "damage.h"
|
||||
#include "common.h"
|
||||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
|
||||
void
|
||||
item_damage(int pct, short *item)
|
||||
|
|
|
@ -35,10 +35,11 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
#include <stdlib.h>
|
||||
#include "file.h"
|
||||
#include "misc.h"
|
||||
#include "nsc.h"
|
||||
#include "product.h"
|
||||
|
||||
static void verify_fail(int, int, struct castr *, int, char *, ...)
|
||||
ATTRIBUTE((format (printf, 5, 6)));
|
||||
|
|
|
@ -38,18 +38,16 @@
|
|||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "common.h"
|
||||
#include "file.h"
|
||||
#include "gen.h"
|
||||
#include "match.h"
|
||||
#include "misc.h"
|
||||
#include "nsc.h"
|
||||
#include "optlist.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
static int fillcache(struct empfile *, int);
|
||||
static int do_write(struct empfile *, void *, int, int);
|
||||
|
|
|
@ -35,15 +35,14 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "prototypes.h"
|
||||
|
||||
/*
|
||||
* return the size of the file in bytes.
|
||||
*/
|
||||
|
|
|
@ -33,14 +33,14 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "xy.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "common.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "xy.h"
|
||||
|
||||
double
|
||||
hap_fact(struct natstr *tnat, struct natstr *vnat)
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <time.h>
|
||||
#include "misc.h"
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include "misc.h"
|
||||
#include "empthread.h"
|
||||
|
|
|
@ -33,16 +33,15 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "file.h"
|
||||
#include "path.h"
|
||||
#include "xy.h"
|
||||
#include "land.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "common.h"
|
||||
#include "subs.h"
|
||||
#include "path.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
int
|
||||
adj_units(coord x, coord y, natid own)
|
||||
|
|
|
@ -34,18 +34,16 @@
|
|||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include <stdlib.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "player.h"
|
||||
#include "common.h"
|
||||
#include "optlist.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
/* Debugging? If yes call abort() on internal error. */
|
||||
int debug = 0;
|
||||
|
|
|
@ -33,10 +33,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "tel.h"
|
||||
#include "optlist.h"
|
||||
#include <stdio.h>
|
||||
#include "optlist.h"
|
||||
#include "tel.h"
|
||||
|
||||
char *
|
||||
mailbox(char *buf, natid cn)
|
||||
|
|
|
@ -34,21 +34,23 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
#include "nsc.h"
|
||||
#include <ctype.h>
|
||||
#include "com.h"
|
||||
#include "empobj.h"
|
||||
#include "file.h"
|
||||
#include "nat.h"
|
||||
#include "map.h"
|
||||
#include "ship.h"
|
||||
#include "land.h"
|
||||
#include "plane.h"
|
||||
#include "common.h"
|
||||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
#include "map.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "nuke.h"
|
||||
#include "optlist.h"
|
||||
#include "plane.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
#include "xy.h"
|
||||
|
||||
static int bmnxtsct(struct nstr_sect *);
|
||||
static char map_char(unsigned char type, natid own, int owner_or_god);
|
||||
|
|
|
@ -34,11 +34,10 @@
|
|||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "xy.h"
|
||||
#include "sect.h"
|
||||
#include "path.h"
|
||||
#include "nat.h"
|
||||
#include "common.h"
|
||||
#include "path.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
double
|
||||
sector_mcost(struct sctstr *sp, int mobtype)
|
||||
|
|
|
@ -33,11 +33,10 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "prototypes.h"
|
||||
#include "file.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
#include "sect.h"
|
||||
|
||||
char *relates[] = {
|
||||
/* must follow nation relation defines in nat.h */
|
||||
|
|
|
@ -37,17 +37,15 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../as/as.h"
|
||||
#include "misc.h"
|
||||
#include "path.h"
|
||||
#include "xy.h"
|
||||
#include "sect.h"
|
||||
#include "file.h"
|
||||
#include "common.h"
|
||||
#include "gen.h"
|
||||
#include "misc.h"
|
||||
#include "optlist.h"
|
||||
#include "path.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define BP_ASHASHSIZE 128 /* A* queue hash table size */
|
||||
#define BP_NEIGHBORS 6 /* max number of neighbors */
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
#include "xy.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "optlist.h"
|
||||
#include "common.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
int
|
||||
max_population(float research, int desig, int eff)
|
||||
|
|
|
@ -34,21 +34,19 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "combat.h"
|
||||
#include "damage.h"
|
||||
#include "file.h"
|
||||
#include "land.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "nsc.h"
|
||||
#include "optlist.h"
|
||||
#include "plane.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
#include "land.h"
|
||||
#include "plane.h"
|
||||
#include "xy.h"
|
||||
#include "nsc.h"
|
||||
#include "file.h"
|
||||
#include "nat.h"
|
||||
#include "optlist.h"
|
||||
#include "damage.h"
|
||||
#include "common.h"
|
||||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
#include "combat.h"
|
||||
|
||||
int
|
||||
sect_damage(struct sctstr *sp, int dam, struct emp_qelem *list)
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "match.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -33,10 +33,8 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
#include "nat.h"
|
||||
|
||||
double
|
||||
tfact(natid cn, double mult)
|
||||
|
|
|
@ -35,17 +35,16 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "ship.h"
|
||||
#include "land.h"
|
||||
#include "plane.h"
|
||||
#include "sect.h"
|
||||
#include "nuke.h"
|
||||
#include "file.h"
|
||||
#include "common.h"
|
||||
#include "item.h"
|
||||
#include "land.h"
|
||||
#include "match.h"
|
||||
#include "nuke.h"
|
||||
#include "plane.h"
|
||||
#include "product.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
|
||||
/*
|
||||
* Return index of sector called NAME in dchr[], or M_NOTFOUND.
|
||||
|
|
|
@ -33,20 +33,18 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "file.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "file.h"
|
||||
#include "wantupd.h"
|
||||
#include "optlist.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include "prototypes.h"
|
||||
#include "wantupd.h"
|
||||
|
||||
void
|
||||
update_policy_check(void)
|
||||
|
|
|
@ -48,14 +48,10 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "file.h"
|
||||
#include "match.h"
|
||||
#include "nsc.h"
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "misc.h"
|
||||
#include "xy.h"
|
||||
#include "nat.h"
|
||||
#include "sect.h"
|
||||
#include "file.h"
|
||||
#include "common.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
#include "optlist.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
||||
/*
|
||||
* return pointer to a string containing the x,y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue