Skip to content

Commit 243d04e

Browse files
jmcjmc
jmc
authored and
jmc
committed
KNF and WARNS=3
1 parent 13e5f23 commit 243d04e

File tree

11 files changed

+236
-252
lines changed

11 files changed

+236
-252
lines changed

games/adventure/crc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $ */
1+
/* $NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
22

33
/*-
44
* Copyright (c) 1993
@@ -38,7 +38,7 @@
3838
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
3939
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
4040
#else
41-
__RCSID("$NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
41+
__RCSID("$NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -115,10 +115,9 @@ crc_start()
115115
crcval = step = 0;
116116
}
117117

118+
/* Process nr bytes at a time; ptr points to them */
118119
unsigned long
119-
crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
120-
const char *ptr;
121-
int nr;
120+
crc(const char *ptr, int nr)
122121
{
123122
int i;
124123
const char *p;

games/adventure/done.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: done.c,v 1.8 2003/08/07 09:36:50 agc Exp $ */
1+
/* $NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
3939
#if 0
4040
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
4141
#else
42-
__RCSID("$NetBSD: done.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
42+
__RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -51,7 +51,7 @@ __RCSID("$NetBSD: done.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
5151
#include "extern.h"
5252

5353
int
54-
score()
54+
score(void)
5555
{ /* sort of like 20000 */
5656
int scor, i;
5757
mxscor = scor = 0;
@@ -102,9 +102,10 @@ score()
102102
return (scor);
103103
}
104104

105+
/* entry=1 means goto 13000 */ /* game is over */
106+
/* entry=2 means goto 20000 */ /* 3=19000 */
105107
void
106-
done(entry) /* entry=1 means goto 13000 */ /* game is over */
107-
int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
108+
done(int entry)
108109
{
109110
int i, sc;
110111
if (entry == 1)
@@ -135,10 +136,9 @@ done(entry) /* entry=1 means goto 13000 */ /* game is over */
135136
exit(0);
136137
}
137138

138-
139+
/* label 90 */
139140
void
140-
die(entry) /* label 90 */
141-
int entry;
141+
die(int entry)
142142
{
143143
int i;
144144
if (entry != 99) {

games/adventure/hdr.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: hdr.h,v 1.10 2003/08/07 09:36:50 agc Exp $ */
1+
/* $NetBSD: hdr.h,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -83,11 +83,10 @@ extern struct hashtab { /* hash table for vocabulary */
8383
} voc[HTSIZE];
8484
#define SEED 1815622 /* "Encryption" seed */
8585

86-
struct text
87-
{
88-
char *seekadr;/* Msg start in virtual disk */
89-
int txtlen; /* length of msg starting here */
90-
};
86+
struct text {
87+
char *seekadr;/* Msg start in virtual disk */
88+
int txtlen; /* length of msg starting here */
89+
};
9190

9291
#define RTXSIZ 205
9392
extern struct text rtext[RTXSIZ]; /* random text messages */
@@ -107,11 +106,11 @@ extern struct text ltext[LOCSIZ]; /* long loc description */
107106
extern struct text stext[LOCSIZ]; /* short loc descriptions */
108107

109108
extern struct travlist { /* direcs & conditions of travel */
110-
struct travlist *next; /* ptr to next list entry */
111-
int conditions; /* m in writeup (newloc / 1000) */
112-
int tloc; /* n in writeup (newloc % 1000) */
113-
int tverb; /* the verb that takes you there */
114-
} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */
109+
struct travlist *next; /* ptr to next list entry */
110+
int conditions; /* m in writeup (newloc / 1000) */
111+
int tloc; /* n in writeup (newloc % 1000) */
112+
int tverb; /* the verb that takes you there */
113+
} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */
115114

116115
extern int atloc[LOCSIZ];
117116

@@ -122,7 +121,7 @@ extern int actspk[35]; /* rtext msg for verb <n> */
122121

123122
extern int cond[LOCSIZ]; /* various condition bits */
124123

125-
extern int setbit[16]; /* bit defn masks 1,2,4,... */
124+
extern int setbit[16]; /* bit defn masks 1,2,4,... */
126125

127126
extern int hntmax;
128127
extern int hints[20][5]; /* info on hints */

games/adventure/init.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: init.c,v 1.14 2003/08/07 09:36:50 agc Exp $ */
1+
/* $NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $ */
22

33
/*-
44
* Copyright (c) 1993
@@ -39,7 +39,7 @@
3939
#if 0
4040
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
4141
#else
42-
__RCSID("$NetBSD: init.c,v 1.14 2003/08/07 09:36:50 agc Exp $");
42+
__RCSID("$NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -57,8 +57,8 @@ __RCSID("$NetBSD: init.c,v 1.14 2003/08/07 09:36:50 agc Exp $");
5757

5858
int blklin = TRUE;
5959

60-
int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000,
61-
010000, 020000, 040000, 0100000};
60+
int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000,
61+
04000, 010000, 020000, 040000, 0100000};
6262

6363
int datfd; /* message file descriptor */
6464
volatile sig_atomic_t delhit;
@@ -125,17 +125,17 @@ int turns, lmwarn, iwest, knfloc, detail, /* various flags and
125125

126126
int demo, limit;
127127

128+
/* everything for 1st time run */
128129
void
129-
init() /* everything for 1st time run */
130+
init(void)
130131
{
131132
rdata(); /* read data from orig. file */
132133
linkdata();
133134
poof();
134135
}
135136

136-
char *
137-
decr(a, b, c, d, e)
138-
char a, b, c, d, e;
137+
char *
138+
decr(int a, int b, int c, int d, int e)
139139
{
140140
static char buf[6];
141141

@@ -149,7 +149,7 @@ decr(a, b, c, d, e)
149149
}
150150

151151
void
152-
linkdata()
152+
linkdata(void)
153153
{ /* secondary data manipulation */
154154
int i, j;
155155

@@ -273,19 +273,17 @@ linkdata()
273273
closng = panic = closed = scorng = FALSE;
274274
}
275275

276-
277-
276+
/* come here if he hits a del */
278277
void
279-
trapdel(n) /* come here if he hits a del */
280-
int n __attribute__((__unused__));
278+
trapdel(int n __attribute__((__unused__)))
281279
{
282280
delhit = 1; /* main checks, treats as QUIT */
283281
signal(SIGINT, trapdel);/* catch subsequent DELs */
284282
}
285283

286284

287285
void
288-
startup()
286+
startup(void)
289287
{
290288
demo = Start();
291289
srand((int) (time((time_t *) NULL))); /* random seed */

0 commit comments

Comments
 (0)