summaryrefslogtreecommitdiffstats
path: root/games/phantasia
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2016-01-06 14:28:09 +0000
committermestre <mestre@openbsd.org>2016-01-06 14:28:09 +0000
commit010ae45bb590c64a39c8a06666034df48999c5c6 (patch)
tree453e335c67666da4944249a8fee7cda422f7307b /games/phantasia
parentansify (diff)
downloadwireguard-openbsd-010ae45bb590c64a39c8a06666034df48999c5c6.tar.xz
wireguard-openbsd-010ae45bb590c64a39c8a06666034df48999c5c6.zip
Remove unnecessary header files from phantasia(6)
Lesson learnt: don't include an header sorted alphabetically just because. The external definition of variables was done on phantglobs.h but their declaration was on phantstruct.h and therefore the latter must be included before the former. It's easier to just include phantstruct.h inside phantglobs.h since it always need it. With help and OK from tb@
Diffstat (limited to 'games/phantasia')
-rw-r--r--games/phantasia/fight.c13
-rw-r--r--games/phantasia/gamesupport.c10
-rw-r--r--games/phantasia/include.h25
-rw-r--r--games/phantasia/interplayer.c13
-rw-r--r--games/phantasia/io.c16
-rw-r--r--games/phantasia/main.c17
-rw-r--r--games/phantasia/misc.c16
-rw-r--r--games/phantasia/phantglobs.c10
-rw-r--r--games/phantasia/phantglobs.h9
-rw-r--r--games/phantasia/phantstruct.h5
-rw-r--r--games/phantasia/setup.c19
11 files changed, 97 insertions, 56 deletions
diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c
index b68c4ad774b..0e094817ede 100644
--- a/games/phantasia/fight.c
+++ b/games/phantasia/fight.c
@@ -1,11 +1,20 @@
-/* $OpenBSD: fight.c,v 1.12 2016/01/06 09:39:51 tb Exp $ */
+/* $OpenBSD: fight.c,v 1.13 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: fight.c,v 1.2 1995/03/24 03:58:39 cgd Exp $ */
/*
* fight.c Phantasia monster fighting routines
*/
-#include "include.h"
+#include <curses.h>
+#include <math.h>
+#include <setjmp.h>
+#include <string.h>
+
+#include "macros.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
+
+static jmp_buf Fightenv; /* used to jump into fight routine */
/************************************************************************
/
diff --git a/games/phantasia/gamesupport.c b/games/phantasia/gamesupport.c
index c3cecc7ea50..9c1c86581a5 100644
--- a/games/phantasia/gamesupport.c
+++ b/games/phantasia/gamesupport.c
@@ -1,11 +1,17 @@
-/* $OpenBSD: gamesupport.c,v 1.8 2016/01/06 09:39:51 tb Exp $ */
+/* $OpenBSD: gamesupport.c,v 1.9 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: gamesupport.c,v 1.3 1995/04/24 12:24:28 cgd Exp $ */
/*
* gamesupport.c - auxiliary routines for support of Phantasia
*/
-#include "include.h"
+#include <curses.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "pathnames.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
/************************************************************************
/
diff --git a/games/phantasia/include.h b/games/phantasia/include.h
index ac369854e78..e69de29bb2d 100644
--- a/games/phantasia/include.h
+++ b/games/phantasia/include.h
@@ -1,25 +0,0 @@
-/* $OpenBSD: include.h,v 1.6 2016/01/03 14:38:17 mestre Exp $ */
-/* $NetBSD: include.h,v 1.3 1995/04/24 12:24:31 cgd Exp $ */
-
-/*
- * include.h - includes all important files for Phantasia
- */
-
-#include <ctype.h>
-#include <curses.h>
-#include <err.h>
-#include <errno.h>
-#include <limits.h>
-#include <math.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdint.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"
diff --git a/games/phantasia/interplayer.c b/games/phantasia/interplayer.c
index eb7b85c85e0..9cb21fa5285 100644
--- a/games/phantasia/interplayer.c
+++ b/games/phantasia/interplayer.c
@@ -1,11 +1,20 @@
-/* $OpenBSD: interplayer.c,v 1.7 2016/01/06 09:39:51 tb Exp $ */
+/* $OpenBSD: interplayer.c,v 1.8 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: interplayer.c,v 1.2 1995/03/24 03:58:47 cgd Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
*/
-#include "include.h"
+#include <curses.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+#include "pathnames.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
/************************************************************************
/
diff --git a/games/phantasia/io.c b/games/phantasia/io.c
index dcac231f197..bfffac0c4ba 100644
--- a/games/phantasia/io.c
+++ b/games/phantasia/io.c
@@ -1,11 +1,23 @@
-/* $OpenBSD: io.c,v 1.7 2016/01/06 09:39:51 tb Exp $ */
+/* $OpenBSD: io.c,v 1.8 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: io.c,v 1.2 1995/03/24 03:58:50 cgd Exp $ */
/*
* io.c - input/output routines for Phantasia
*/
-#include "include.h"
+#include <ctype.h>
+#include <curses.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
+
+static jmp_buf Timeoenv; /* used for timing out waiting for input */
/************************************************************************
/
diff --git a/games/phantasia/main.c b/games/phantasia/main.c
index cc963ccdca7..ef074181685 100644
--- a/games/phantasia/main.c
+++ b/games/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.18 2016/01/06 09:39:51 tb Exp $ */
+/* $OpenBSD: main.c,v 1.19 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: main.c,v 1.3 1995/04/24 12:24:37 cgd Exp $ */
/*
@@ -28,12 +28,21 @@
* AT&T is in no way connected with this game.
*/
-#include <sys/types.h>
-#include <limits.h>
+#include <curses.h>
+#include <err.h>
+#include <math.h>
#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef TERMIOS
#include <termios.h>
#endif
+#include <unistd.h>
+
+#include "macros.h"
+#include "pathnames.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
/*
* The program allocates as much file space as it needs to store characters,
@@ -59,8 +68,6 @@
* main.c Main routines for Phantasia
*/
-#include "include.h"
-
/***************************************************************************
/ FUNCTION NAME: main()
/
diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c
index 2e8ff3dc5e3..c34a28dbe8a 100644
--- a/games/phantasia/misc.c
+++ b/games/phantasia/misc.c
@@ -1,13 +1,23 @@
-/* $OpenBSD: misc.c,v 1.19 2016/01/06 09:43:26 tb Exp $ */
+/* $OpenBSD: misc.c,v 1.20 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: misc.c,v 1.2 1995/03/24 03:59:03 cgd Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
*/
+#include <curses.h>
#include <err.h>
-#include "include.h"
-
+#include <math.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+#include "pathnames.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
/************************************************************************
/
diff --git a/games/phantasia/phantglobs.c b/games/phantasia/phantglobs.c
index d29d2faa782..e0c0d734f82 100644
--- a/games/phantasia/phantglobs.c
+++ b/games/phantasia/phantglobs.c
@@ -1,11 +1,14 @@
-/* $OpenBSD: phantglobs.c,v 1.3 1998/11/29 19:57:01 pjanzen Exp $ */
+/* $OpenBSD: phantglobs.c,v 1.4 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: phantglobs.c,v 1.2 1995/03/24 03:59:33 cgd Exp $ */
/*
* phantglobs.c - globals for Phantasia
*/
-#include "include.h"
+#include <stdio.h>
+
+#include "phantdefs.h"
+#include "phantstruct.h"
double Circle; /* which circle player is in */
double Shield; /* force field thrown up in monster battle */
@@ -28,9 +31,6 @@ int Lines; /* line on screen counter for fight routines */
char Ch_Erase; /* backspace key */
char Ch_Kill; /* linekill key */
-jmp_buf Fightenv; /* used to jump into fight routine */
-jmp_buf Timeoenv; /* used for timing out waiting for input */
-
long Fileloc; /* location in file of player statistics */
const char *Login; /* pointer to login of player */
diff --git a/games/phantasia/phantglobs.h b/games/phantasia/phantglobs.h
index 63288f0445b..7b0fc5a0472 100644
--- a/games/phantasia/phantglobs.h
+++ b/games/phantasia/phantglobs.h
@@ -1,10 +1,14 @@
-/* $OpenBSD: phantglobs.h,v 1.6 2003/05/12 07:43:27 pjanzen Exp $ */
+/* $OpenBSD: phantglobs.h,v 1.7 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: phantglobs.h,v 1.3 1995/04/24 12:24:39 cgd Exp $ */
/*
* phantglobs.h - global declarations for Phantasia
*/
+#include <stdio.h>
+
+#include "phantstruct.h"
+
extern double Circle; /* which circle player is in */
extern double Shield; /* force field thrown up in monster battle */
@@ -26,9 +30,6 @@ extern int Lines; /* line on screen counter for fight routines */
extern char Ch_Erase; /* backspace key */
extern char Ch_Kill; /* linekill key */
-extern jmp_buf Fightenv; /* used to jump into fight routine */
-extern jmp_buf Timeoenv; /* used for timing out waiting for input */
-
extern long Fileloc; /* location in file of player statistics */
extern const char *Login; /* pointer to login of current player */
diff --git a/games/phantasia/phantstruct.h b/games/phantasia/phantstruct.h
index 5d8ca90b73d..5d38f425bc1 100644
--- a/games/phantasia/phantstruct.h
+++ b/games/phantasia/phantstruct.h
@@ -1,10 +1,13 @@
-/* $OpenBSD: phantstruct.h,v 1.4 2014/11/16 04:49:48 guenther Exp $ */
+/* $OpenBSD: phantstruct.h,v 1.5 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: phantstruct.h,v 1.2 1995/03/24 04:00:11 cgd Exp $ */
/*
* phantstruct.h - structure definitions for Phantasia
*/
+#include <limits.h>
+#include <stdbool.h>
+
struct player /* player statistics */
{
double p_experience; /* experience */
diff --git a/games/phantasia/setup.c b/games/phantasia/setup.c
index 576f608b1fb..540be398d1f 100644
--- a/games/phantasia/setup.c
+++ b/games/phantasia/setup.c
@@ -1,14 +1,23 @@
-/* $OpenBSD: setup.c,v 1.16 2016/01/06 10:28:38 tb Exp $ */
+/* $OpenBSD: setup.c,v 1.17 2016/01/06 14:28:09 mestre Exp $ */
/* $NetBSD: setup.c,v 1.4 1995/04/24 12:24:41 cgd Exp $ */
/*
* setup.c - set up all files for Phantasia
*/
-#include <sys/types.h>
#include <sys/stat.h>
-#include "include.h"
-#include <limits.h>
+
#include <fcntl.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+#include "pathnames.h"
+#include "phantdefs.h"
+#include "phantglobs.h"
__dead void Error(char *, char *);
@@ -122,7 +131,7 @@ main(int argc, char *argv[])
}
/* put holy grail info into energy void file */
- Enrgyvoid.ev_active = TRUE;
+ Enrgyvoid.ev_active = true;
Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6);
Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6);
snprintf(path, sizeof(path), "%s%s", prefix?prefix:"", _PATH_VOID);