Skip to content

Commit 690bee1

Browse files
committed
PR/3964: Eric Fischer: Remove dependencies to traditional cpp...
While I was there add WARNS?= too.
1 parent 006a85e commit 690bee1

File tree

12 files changed

+447
-212
lines changed

12 files changed

+447
-212
lines changed

games/adventure/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# $NetBSD: Makefile,v 1.4 1997/04/19 06:59:34 thorpej Exp $
1+
# $NetBSD: Makefile,v 1.5 1997/08/11 14:06:10 christos Exp $
22
# @(#)Makefile 8.1 (Berkeley) 6/12/93
33

4+
WARNS?= 1
45
PROG= adventure
56
SRCS= main.c init.c done.c save.c subr.c vocab.c wizard.c io.c data.c crc.c
67
MAN= adventure.6
7-
CFLAGS+=-traditional-cpp
88
HIDEGAME=hidegame
99
CLEANFILES+=setup data.c
1010

games/adventure/crc.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: crc.c,v 1.2 1995/03/21 12:04:59 cgd Exp $ */
1+
/* $NetBSD: crc.c,v 1.3 1997/08/11 14:06:11 christos Exp $ */
22

33
/*-
44
* Copyright (c) 1993
@@ -36,18 +36,19 @@
3636
* SUCH DAMAGE.
3737
*/
3838

39+
#include <sys/cdefs.h>
3940
#ifndef lint
4041
#if 0
4142
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
4243
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
4344
#else
44-
static char rcsid[] = "$NetBSD: crc.c,v 1.2 1995/03/21 12:04:59 cgd Exp $";
45+
__RCSID("$NetBSD: crc.c,v 1.3 1997/08/11 14:06:11 christos Exp $");
4546
#endif
4647
#endif /* not lint */
4748

48-
typedef unsigned long u_long;
49+
#include "extern.h"
4950

50-
u_long crctab[] = {
51+
unsigned long crctab[] = {
5152
0x7fffffff,
5253
0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
5354
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e,
@@ -110,15 +111,16 @@ u_long crctab[] = {
110111
* it.
111112
*/
112113

113-
u_long crcval;
114+
unsigned long crcval;
114115
int step;
115116

117+
void
116118
crc_start()
117119
{
118120
crcval = step = 0;
119121
}
120122

121-
u_long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
123+
unsigned long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
122124
char *ptr;
123125
int nr;
124126
{

games/adventure/done.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: done.c,v 1.2 1995/03/21 12:05:01 cgd Exp $ */
1+
/* $NetBSD: done.c,v 1.3 1997/08/11 14:06:12 christos Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -38,18 +38,22 @@
3838
* SUCH DAMAGE.
3939
*/
4040

41+
#include <sys/cdefs.h>
4142
#ifndef lint
4243
#if 0
4344
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
4445
#else
45-
static char rcsid[] = "$NetBSD: done.c,v 1.2 1995/03/21 12:05:01 cgd Exp $";
46+
__RCSID("$NetBSD: done.c,v 1.3 1997/08/11 14:06:12 christos Exp $");
4647
#endif
4748
#endif /* not lint */
4849

4950
/* Re-coding of advent in C: termination routines */
5051

52+
#include <stdio.h>
5153
#include "hdr.h"
54+
#include "extern.h"
5255

56+
int
5357
score() /* sort of like 20000 */
5458
{ register int scor,i;
5559
mxscor=scor=0;
@@ -86,6 +90,7 @@ score() /* sort of like 20000 */
8690
return(scor);
8791
}
8892

93+
void
8994
done(entry) /* entry=1 means goto 13000 */ /* game is over */
9095
int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
9196
{ register int i,sc;
@@ -114,6 +119,7 @@ int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
114119
}
115120

116121

122+
int
117123
die(entry) /* label 90 */
118124
int entry;
119125
{ register int i;

games/adventure/extern.h

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/* $NetBSD: extern.h,v 1.1 1997/08/11 14:06:13 christos Exp $ */
2+
3+
/*
4+
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions
8+
* are met:
9+
* 1. Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
* 3. All advertising materials mentioning features or use of this software
15+
* must display the following acknowledgement:
16+
* This product includes software developed by Christos Zoulas.
17+
* 4. The name of the author may not be used to endorse or promote products
18+
* derived from this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
32+
/* crc.c */
33+
void crc_start __P((void));
34+
unsigned long crc __P((char *, int));
35+
36+
/* done.c */
37+
int score __P((void));
38+
void done __P((int));
39+
int die __P((int));
40+
41+
/* init.c */
42+
void init __P((char *));
43+
char *decr __P((int, int, int, int, int));
44+
void linkdata __P((void));
45+
void trapdel __P((int));
46+
void startup __P((void));
47+
48+
/* io.c */
49+
void getin __P((char **, char **));
50+
int confirm __P((char *));
51+
int yes __P((int, int, int));
52+
int yesm __P((int, int, int));
53+
int next __P((void));
54+
void rdata __P((void));
55+
int rnum __P((void));
56+
void rdesc __P((int));
57+
void rtrav __P((void));
58+
int twrite __P((int));
59+
void rvoc __P((void));
60+
void rlocs __P((void));
61+
void rdflt __P((void));
62+
void rliq __P((void));
63+
void rhints __P((void));
64+
void rspeak __P((int));
65+
void mspeak __P((int));
66+
struct text;
67+
void speak __P((struct text *));
68+
void pspeak __P((int, int));
69+
70+
/* main.c */
71+
int main __P((int, char **));
72+
73+
/* save.c */
74+
int save __P((char *));
75+
int restore __P((char *));
76+
77+
/* setup.c */
78+
int main __P((int, char *[]));
79+
void fatal __P((char *, int));
80+
81+
/* subr.c */
82+
int toting __P((int));
83+
int here __P((int));
84+
int at __P((int));
85+
int liq2 __P((int));
86+
int liq __P((int));
87+
int liqloc __P((int));
88+
int bitset __P((int, int));
89+
int forced __P((int));
90+
int dark __P((int));
91+
int pct __P((int));
92+
int fdwarf __P((void));
93+
int march __P((void));
94+
int mback __P((void));
95+
int specials __P((void));
96+
int trbridge __P((void));
97+
int badmove __P((void));
98+
int bug __P((int)) __attribute__((__noreturn__));
99+
int checkhints __P((void));
100+
int trsay __P((void));
101+
int trtake __P((void));
102+
int dropper __P((void));
103+
int trdrop __P((void));
104+
int tropen __P((void));
105+
int trkill __P((void));
106+
int trtoss __P((void));
107+
int trfeed __P((void));
108+
int trfill __P((void));
109+
int closing __P((void));
110+
int caveclose __P((void));
111+
112+
/* vocab.c */
113+
void dstroy __P((int));
114+
void juggle __P((int));
115+
void move __P((int, int));
116+
int put __P((int, int, int));
117+
void carry __P((int, int));
118+
void drop __P((int, int));
119+
int vocab __P((char *, int, int));
120+
void copystr __P((char *, char *));
121+
int weq __P((char *, char *));
122+
int length __P((char *));
123+
void prht __P((void));
124+
125+
/* wizard.c */
126+
void datime __P((int *, int *));
127+
void poof __P((void));
128+
int Start __P((int));
129+
int wizard __P((void));
130+
void ciao __P((char *));
131+
int ran __P((int));

games/adventure/hdr.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: hdr.h,v 1.2 1995/03/21 12:05:02 cgd Exp $ */
1+
/* $NetBSD: hdr.h,v 1.3 1997/08/11 14:06:14 christos Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -86,7 +86,7 @@ struct hashtab /* hash table for vocabulary */
8686
struct text
8787
#ifdef OLDSTUFF
8888
{ int seekadr; /* DATFILE must be < 2**16 */
89-
#endif OLDSTUFF
89+
#endif /* OLDSTUFF */
9090
{ char *seekadr; /* Msg start in virtual disk */
9191
int txtlen; /* length of msg starting here */
9292
};
@@ -130,7 +130,7 @@ int hntmax;
130130
int hints[20][5]; /* info on hints */
131131
int hinted[20],hintlc[20];
132132

133-
int place[101], prop[101],link[201];
133+
int place[101], prop[101],links[201];
134134
int abb[LOCSIZ];
135135

136136
int maxtrs,tally,tally2; /* treasure values */
@@ -158,9 +158,4 @@ int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */
158158

159159
int demo,newloc,limit;
160160

161-
char *malloc();
162-
char *decr();
163-
unsigned long crc();
164-
165-
/* We need to get a little tricky to avoid strings */
166-
#define DECR(a,b,c,d,e) decr('a'+'+','b'+'-','c'+'#','d'+'&','e'+'%')
161+
#define DECR(a,b,c,d,e) decr(a+'+',b+'-',c+'#',d+'&',e+'%')

0 commit comments

Comments
 (0)