Dumping all system includes anything uses in one big header file is so 1986.

XXX: Removing unused declarations (thus, unused headers can trigger
XXX: it) sometimes causes gcc to generate substantially different
XXX: code. Dunno why but it looks rather like a gcc bug.
This commit is contained in:
dholland 2009-08-31 08:27:16 +00:00
parent a7c1bdeb22
commit e28fc9086c
9 changed files with 109 additions and 48 deletions

View File

@ -1,10 +1,19 @@
/* $NetBSD: fight.c,v 1.12 2009/08/12 08:21:41 dholland Exp $ */
/* $NetBSD: fight.c,v 1.13 2009/08/31 08:27:16 dholland Exp $ */
/*
* fight.c Phantasia monster fighting routines
*/
#include "include.h"
#include <math.h>
#include <setjmp.h>
#include <stdio.h>
#include <string.h>
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#undef bool
#include <curses.h>

View File

@ -1,10 +1,19 @@
/* $NetBSD: gamesupport.c,v 1.10 2009/05/25 23:08:45 dholland Exp $ */
/* $NetBSD: gamesupport.c,v 1.11 2009/08/31 08:27:16 dholland Exp $ */
/*
* gamesupport.c - auxiliary routines for support of Phantasia
*/
#include "include.h"
#include <setjmp.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"
#undef bool
#include <curses.h>

View File

@ -1,26 +0,0 @@
/* $NetBSD: include.h,v 1.6 2009/05/27 17:44:38 dholland Exp $ */
/*
* include.h - includes all important files for Phantasia
*/
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifndef __dead /* Not NetBSD */
#define __dead
#endif
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"

View File

@ -1,10 +1,21 @@
/* $NetBSD: interplayer.c,v 1.11 2009/08/12 08:21:41 dholland Exp $ */
/* $NetBSD: interplayer.c,v 1.12 2009/08/31 08:27:16 dholland Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
*/
#include "include.h"
#include <math.h>
#include <setjmp.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"
#undef bool
#include <curses.h>

View File

@ -1,12 +1,26 @@
/* $NetBSD: io.c,v 1.13 2009/08/12 08:21:41 dholland Exp $ */
/* $NetBSD: io.c,v 1.14 2009/08/31 08:27:16 dholland Exp $ */
/*
* io.c - input/output routines for Phantasia
*/
#include "include.h"
#undef bool
#include <sys/cdefs.h>
#include <ctype.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
//#include "pathnames.h"
#undef bool
#include <curses.h>
static void catchalarm(int) __dead;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.22 2009/08/12 08:21:41 dholland Exp $ */
/* $NetBSD: main.c,v 1.23 2009/08/31 08:27:16 dholland Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@ -27,10 +27,25 @@
* AT&T is in no way connected with this game.
*/
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
#include <math.h>
#include <pwd.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"
#undef bool
#include <curses.h>
/*
* The program allocates as much file space as it needs to store characters,
@ -57,10 +72,6 @@
* main.c Main routines for Phantasia
*/
#include "include.h"
#undef bool
#include <curses.h>
static void genchar(int);
static void initialstate(void);
static void neatstuff(void);

View File

@ -1,10 +1,24 @@
/* $NetBSD: misc.c,v 1.18 2009/08/12 08:21:41 dholland Exp $ */
/* $NetBSD: misc.c,v 1.19 2009/08/31 08:27:16 dholland Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
*/
#include "include.h"
#include <errno.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "macros.h"
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"
#undef bool
#include <curses.h>

View File

@ -1,10 +1,16 @@
/* $NetBSD: phantglobs.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */
/* $NetBSD: phantglobs.c,v 1.6 2009/08/31 08:27:16 dholland Exp $ */
/*
* phantglobs.c - globals for Phantasia
*/
#include "include.h"
#include <setjmp.h>
#include <stdio.h>
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
double Circle; /* which circle player is in */
double Shield; /* force field thrown up in monster battle */

View File

@ -1,4 +1,4 @@
/* $NetBSD: setup.c,v 1.20 2009/05/27 17:44:38 dholland Exp $ */
/* $NetBSD: setup.c,v 1.21 2009/08/31 08:27:16 dholland Exp $ */
/*
* setup.c - set up all files for Phantasia
@ -8,10 +8,23 @@
#include <sys/cdefs.h>
#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "include.h"
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifndef __dead /* Not NetBSD */
#define __dead
#endif
#include "phantdefs.h"
#include "phantstruct.h"
#include "phantglobs.h"
#include "pathnames.h"
int main(int, char *[]);
void Error(const char *, const char *) __dead;