From a65a873e56c35780711e9f73872c4fe0254589b0 Mon Sep 17 00:00:00 2001 From: cgd Date: Mon, 24 Apr 1995 12:21:37 +0000 Subject: Various changes to make games compile w/o warnings on the alpha: Include appropriate includes, delete bogus function declarations, change sizes of variables and casts. --- phantasia/gamesupport.c | 6 +++--- phantasia/include.h | 3 ++- phantasia/macros.h | 4 +++- phantasia/main.c | 6 +++--- phantasia/phantglobs.h | 4 ++-- phantasia/setup.c | 6 +++--- 6 files changed, 16 insertions(+), 13 deletions(-) (limited to 'phantasia') diff --git a/phantasia/gamesupport.c b/phantasia/gamesupport.c index b1be5e4d..e4742b0f 100644 --- a/phantasia/gamesupport.c +++ b/phantasia/gamesupport.c @@ -1,4 +1,4 @@ -/* $NetBSD: gamesupport.c,v 1.2 1995/03/24 03:58:43 cgd Exp $ */ +/* $NetBSD: gamesupport.c,v 1.3 1995/04/24 12:24:28 cgd Exp $ */ /* * gamesupport.c - auxiliary routines for support of Phantasia @@ -63,7 +63,7 @@ int c; /* input */ int today; /* day of year of today */ int temp; /* temporary variable */ long loc; /* location in player file */ -long now; /* time now */ +time_t now; /* time now */ double dtemp; /* temporary variable */ bool *bptr; /* pointer to bool item to change */ double *dptr; /* pointer to double item to change */ @@ -626,7 +626,7 @@ purgeoldplayers() { int today; /* day of year for today */ int daysold; /* how many days since the character has been used */ -long ltime; /* time in seconds */ +time_t ltime; /* time in seconds */ long loc = 0L; /* location in file */ time(<ime); diff --git a/phantasia/include.h b/phantasia/include.h index c9b4f7c6..db661e38 100644 --- a/phantasia/include.h +++ b/phantasia/include.h @@ -1,4 +1,4 @@ -/* $NetBSD: include.h,v 1.2 1995/03/24 03:58:45 cgd Exp $ */ +/* $NetBSD: include.h,v 1.3 1995/04/24 12:24:31 cgd Exp $ */ /* * include.h - includes all important files for Phantasia @@ -11,6 +11,7 @@ #include #include #include +#include #include "macros.h" #include "phantdefs.h" diff --git a/phantasia/macros.h b/phantasia/macros.h index 6c46c868..39b003c3 100644 --- a/phantasia/macros.h +++ b/phantasia/macros.h @@ -1,4 +1,4 @@ -/* $NetBSD: macros.h,v 1.2 1995/03/24 03:58:52 cgd Exp $ */ +/* $NetBSD: macros.h,v 1.3 1995/04/24 12:24:34 cgd Exp $ */ /* * macros.h - macro definitions for Phantasia @@ -7,7 +7,9 @@ #define ROLL(BASE,INTERVAL) floor((BASE) + (INTERVAL) * drandom()) #define SGN(X) ((X) < 0 ? -1 : 1) #define CIRCLE(X, Y) floor(distance(X, 0.0, Y, 0.0) / 125.0 + 1) +#undef MAX #define MAX(A, B) ((A) > (B) ? (A) : (B)) +#undef MIN #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define ILLCMD() mvaddstr(5, 0, Illcmd) #define MAXMOVE() (Player.p_level * 1.5 + 1) diff --git a/phantasia/main.c b/phantasia/main.c index 2e01b692..a40dfb0c 100644 --- a/phantasia/main.c +++ b/phantasia/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.2 1995/03/24 03:58:54 cgd Exp $ */ +/* $NetBSD: main.c,v 1.3 1995/04/24 12:24:37 cgd Exp $ */ /* * Phantasia 3.3.2 -- Interterminal fantasy game @@ -102,7 +102,7 @@ char **argv; bool noheader = FALSE; /* set if don't want header */ bool headeronly = FALSE; /* set if only want header */ bool examine = FALSE; /* set if examine a character */ -long seconds; /* for time of day */ +time_t seconds; /* for time of day */ double dtemp; /* for temporary calculations */ initialstate(); /* init globals */ @@ -369,7 +369,7 @@ initialstate() error(_PATH_VOID); /*NOTREACHED*/ - srandom((unsigned) time((long *) NULL)); /* prime random numbers */ + srandom((unsigned) time(NULL)); /* prime random numbers */ } /* */ /************************************************************************ diff --git a/phantasia/phantglobs.h b/phantasia/phantglobs.h index eeec1305..cdbe43c4 100644 --- a/phantasia/phantglobs.h +++ b/phantasia/phantglobs.h @@ -1,4 +1,4 @@ -/* $NetBSD: phantglobs.h,v 1.2 1995/03/24 03:59:38 cgd Exp $ */ +/* $NetBSD: phantglobs.h,v 1.3 1995/04/24 12:24:39 cgd Exp $ */ /* * phantglobs.h - global declarations for Phantasia @@ -59,7 +59,7 @@ extern char Somebetter[]; extern char Nobetter[]; /* library functions and system calls */ -extern long time(); +/* extern long time(); */ extern char *getlogin(); extern char *getpass(); extern char *strchr(); diff --git a/phantasia/setup.c b/phantasia/setup.c index ee61b9c2..c9acd978 100644 --- a/phantasia/setup.c +++ b/phantasia/setup.c @@ -1,12 +1,12 @@ -/* $NetBSD: setup.c,v 1.3 1995/03/24 04:00:51 cgd Exp $ */ +/* $NetBSD: setup.c,v 1.4 1995/04/24 12:24:41 cgd Exp $ */ /* * setup.c - set up all files for Phantasia */ -#include "include.h" #include #include #include +#include "include.h" /* */ /************************************************************************ / @@ -77,7 +77,7 @@ main(argc, argv) argc -= optind; argv += optind; - srandom((unsigned) time((long *) NULL)); /* prime random numbers */ + srandom((unsigned) time(NULL)); /* prime random numbers */ umask(0117); /* only owner can read/write created files */ -- cgit v1.2.3-56-ge451