Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/phantasia Dumping all system includes anything uses in...



details:   https://anonhg.NetBSD.org/src/rev/e0f6cf1b9708
branches:  trunk
changeset: 747064:e0f6cf1b9708
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Aug 31 08:27:16 2009 +0000

description:
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.

diffstat:

 games/phantasia/fight.c       |  13 +++++++++++--
 games/phantasia/gamesupport.c |  13 +++++++++++--
 games/phantasia/include.h     |  26 --------------------------
 games/phantasia/interplayer.c |  15 +++++++++++++--
 games/phantasia/io.c          |  20 +++++++++++++++++---
 games/phantasia/main.c        |  23 +++++++++++++++++------
 games/phantasia/misc.c        |  18 ++++++++++++++++--
 games/phantasia/phantglobs.c  |  10 ++++++++--
 games/phantasia/setup.c       |  19 ++++++++++++++++---
 9 files changed, 109 insertions(+), 48 deletions(-)

diffs (274 lines):

diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/fight.c
--- a/games/phantasia/fight.c   Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/fight.c   Mon Aug 31 08:27:16 2009 +0000
@@ -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>
 
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/gamesupport.c
--- a/games/phantasia/gamesupport.c     Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/gamesupport.c     Mon Aug 31 08:27:16 2009 +0000
@@ -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>
 
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/include.h
--- a/games/phantasia/include.h Mon Aug 31 07:45:24 2009 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -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"
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/interplayer.c
--- a/games/phantasia/interplayer.c     Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/interplayer.c     Mon Aug 31 08:27:16 2009 +0000
@@ -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>
 
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/io.c
--- a/games/phantasia/io.c      Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/io.c      Mon Aug 31 08:27:16 2009 +0000
@@ -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"
+#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 <sys/cdefs.h>
 #include <curses.h>
 
 static void catchalarm(int) __dead;
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/main.c
--- a/games/phantasia/main.c    Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/main.c    Mon Aug 31 08:27:16 2009 +0000
@@ -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/types.h>
 #include <sys/stat.h>
-#include <sys/types.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);
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/misc.c
--- a/games/phantasia/misc.c    Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/misc.c    Mon Aug 31 08:27:16 2009 +0000
@@ -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>
 
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/phantglobs.c
--- a/games/phantasia/phantglobs.c      Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/phantglobs.c      Mon Aug 31 08:27:16 2009 +0000
@@ -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      */
diff -r 28c114465ae6 -r e0f6cf1b9708 games/phantasia/setup.c
--- a/games/phantasia/setup.c   Mon Aug 31 07:45:24 2009 +0000
+++ b/games/phantasia/setup.c   Mon Aug 31 08:27:16 2009 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index