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. --- larn/diag.c | 4 ++-- larn/global.c | 3 ++- larn/header.h | 4 ++-- larn/io.c | 13 +++++++------ larn/main.c | 4 +++- larn/monster.c | 3 ++- larn/scores.c | 8 +++++--- larn/signal.c | 4 +++- larn/tok.c | 3 ++- 9 files changed, 28 insertions(+), 18 deletions(-) (limited to 'larn') diff --git a/larn/diag.c b/larn/diag.c index bc4dda74..e9ca5953 100644 --- a/larn/diag.c +++ b/larn/diag.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: diag.c,v 1.5 1995/03/23 08:33:20 cgd Exp $"; +static char rcsid[] = "$NetBSD: diag.c,v 1.6 1995/04/24 12:23:49 cgd Exp $"; #endif /* not lint */ /* diag.c Larn is copyrighted 1986 by Noah Morgan. */ @@ -148,7 +148,7 @@ diagdrawscreen() /* to save the game in a file */ -static long int zzz=0; +static time_t zzz=0; savegame(fname) char *fname; { diff --git a/larn/global.c b/larn/global.c index 9be6c0d6..8e7049ea 100644 --- a/larn/global.c +++ b/larn/global.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: global.c,v 1.3 1995/03/23 08:33:26 cgd Exp $"; +static char rcsid[] = "$NetBSD: global.c,v 1.4 1995/04/24 12:23:52 cgd Exp $"; #endif /* not lint */ /* global.c Larn is copyrighted 1986 by Noah Morgan. @@ -23,6 +23,7 @@ static char rcsid[] = "$NetBSD: global.c,v 1.3 1995/03/23 08:33:26 cgd Exp $"; */ #include "header.h" +#include extern int score[],srcount,dropflag; extern int random;/* the random number seed */ extern short playerx,playery,lastnum; diff --git a/larn/header.h b/larn/header.h index 2dfec532..01b7487b 100644 --- a/larn/header.h +++ b/larn/header.h @@ -1,4 +1,4 @@ -/* $NetBSD: header.h,v 1.6 1995/04/22 07:34:05 cgd Exp $ */ +/* $NetBSD: header.h,v 1.7 1995/04/24 12:23:54 cgd Exp $ */ /* header.h Larn is copyrighted 1986 by Noah Morgan. */ @@ -355,7 +355,7 @@ extern struct _itm itm[]; char *fortune(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime(); char *tmcapcnv(),*tgetstr(),*tgoto(); -long paytaxes(),lgetc(),lrint(),time(); +long paytaxes(),lgetc(),lrint(); unsigned long readnum(); void *malloc(); diff --git a/larn/io.c b/larn/io.c index ded2ac2a..dc91b346 100644 --- a/larn/io.c +++ b/larn/io.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: io.c,v 1.3 1995/03/23 08:33:38 cgd Exp $"; +static char rcsid[] = "$NetBSD: io.c,v 1.4 1995/04/24 12:23:57 cgd Exp $"; #endif /* not lint */ /* io.c Larn is copyrighted 1986 by Noah Morgan. @@ -60,6 +60,7 @@ static char rcsid[] = "$NetBSD: io.c,v 1.3 1995/03/23 08:33:38 cgd Exp $"; */ #include "header.h" +#include #ifdef SYSV /* system III or system V */ #include @@ -851,15 +852,15 @@ lflush() #endif VT100 #ifndef VT100 -static int index=0; +static int vindex=0; /* * putchar(ch) Print one character in decoded output buffer. */ int putchar(c) int c; { - outbuf[index++] = c; - if (index >= BUFBIG) flush_buf(); + outbuf[vindex++] = c; + if (vindex >= BUFBIG) flush_buf(); } /* @@ -867,8 +868,8 @@ int c; */ flush_buf() { - if (index) write(lfd, outbuf, index); - index = 0; + if (vindex) write(lfd, outbuf, vindex); + vindex = 0; } /* diff --git a/larn/main.c b/larn/main.c index 35339177..fcacc3cd 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,11 +1,13 @@ #ifndef lint -static char rcsid[] = "$NetBSD: main.c,v 1.6 1995/04/22 07:34:07 cgd Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.7 1995/04/24 12:24:01 cgd Exp $"; #endif /* not lint */ /* main.c */ #include #include "header.h" #include +#include + static char copyright[]="\nLarn is copyrighted 1986 by Noah Morgan.\n"; int srcount=0; /* line counter for showstr() */ int dropflag=0; /* if 1 then don't lookforobject() next round */ diff --git a/larn/monster.c b/larn/monster.c index 1178bd66..68d60c23 100644 --- a/larn/monster.c +++ b/larn/monster.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: monster.c,v 1.3 1995/03/23 08:33:50 cgd Exp $"; +static char rcsid[] = "$NetBSD: monster.c,v 1.4 1995/04/24 12:24:05 cgd Exp $"; #endif /* not lint */ /* @@ -101,6 +101,7 @@ static char rcsid[] = "$NetBSD: monster.c,v 1.3 1995/03/23 08:33:50 cgd Exp $"; * */ #include "header.h" +#include struct isave /* used for altar reality */ { diff --git a/larn/scores.c b/larn/scores.c index cd9fd9e2..8a2fac26 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: scores.c,v 1.4 1995/03/23 08:34:15 cgd Exp $"; +static char rcsid[] = "$NetBSD: scores.c,v 1.5 1995/04/24 12:24:08 cgd Exp $"; #endif /* not lint */ /* scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -29,6 +29,7 @@ static char rcsid[] = "$NetBSD: scores.c,v 1.4 1995/03/23 08:34:15 cgd Exp $"; #include #include #include "header.h" +#include struct scofmt /* This is the structure for the scoreboard */ { @@ -55,7 +56,7 @@ struct wscofmt /* This is the structure for the winning scoreboard */ struct log_fmt /* 102 bytes struct for the log file */ { long score; /* the players score */ - long diedtime; /* time when game was over */ + time_t diedtime; /* time when game was over */ short cavelev; /* level in caves */ short diff; /* difficulty player played at */ #ifdef EXTRA @@ -472,7 +473,8 @@ died(x) { register int f,win; char ch,*mod; - long zzz,i; + time_t zzz; + long i; struct tms cputime; if (c[LIFEPROT]>0) /* if life protection */ { diff --git a/larn/signal.c b/larn/signal.c index e12b1314..93773147 100644 --- a/larn/signal.c +++ b/larn/signal.c @@ -1,9 +1,11 @@ #ifndef lint -static char rcsid[] = "$NetBSD: signal.c,v 1.3 1995/03/23 08:34:18 cgd Exp $"; +static char rcsid[] = "$NetBSD: signal.c,v 1.4 1995/04/24 12:24:12 cgd Exp $"; #endif /* not lint */ #include #include "header.h" /* "Larn is copyrighted 1986 by Noah Morgan.\n" */ +#include + #define BIT(a) (1<<((a)-1)) extern char savefilename[],wizard,predostuff,nosignal; static s2choose() /* text to be displayed if ^C during intro screen */ diff --git a/larn/tok.c b/larn/tok.c index 5b9e2610..32aca694 100644 --- a/larn/tok.c +++ b/larn/tok.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: tok.c,v 1.3 1995/03/23 08:34:23 cgd Exp $"; +static char rcsid[] = "$NetBSD: tok.c,v 1.4 1995/04/24 12:24:14 cgd Exp $"; #endif /* not lint */ /* tok.c Larn is copyrighted 1986 by Noah Morgan. */ @@ -11,6 +11,7 @@ static char rcsid[] = "$NetBSD: tok.c,v 1.3 1995/03/23 08:34:23 cgd Exp $"; #include #endif SYSV #include "header.h" +#include static char lastok=0; int yrepcount=0,dayplay=0; -- cgit v1.2.3