Skip to content

Commit c62bf84

Browse files
committed
sprinkle static
1 parent a630fd3 commit c62bf84

File tree

10 files changed

+102
-104
lines changed

10 files changed

+102
-104
lines changed

games/adventure/crc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
1+
/* $NetBSD: crc.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1993
@@ -38,13 +38,13 @@
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.9 2005/07/01 00:03:36 jmc Exp $");
41+
__RCSID("$NetBSD: crc.c,v 1.10 2009/08/12 04:28:27 dholland Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "extern.h"
4646

47-
const unsigned long crctab[] = {
47+
static const unsigned long crctab[] = {
4848
0x7fffffff,
4949
0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
5050
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e,
@@ -106,8 +106,8 @@ const unsigned long crctab[] = {
106106
* it.
107107
*/
108108

109-
unsigned long crcval;
110-
unsigned int step;
109+
static unsigned long crcval;
110+
static unsigned int step;
111111

112112
void
113113
crc_start()

games/adventure/extern.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.h,v 1.10 2004/01/27 20:30:28 jsm Exp $ */
1+
/* $NetBSD: extern.h,v 1.11 2009/08/12 04:28:27 dholland Exp $ */
22

33
/*
44
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -43,27 +43,17 @@ void die(int);
4343
/* init.c */
4444
void init(void);
4545
char *decr(int, int, int, int, int);
46-
void linkdata(void);
4746
void trapdel(int);
4847
void startup(void);
4948

5049
/* io.c */
5150
void getin(char **, char **);
5251
int yes(int, int, int);
5352
int yesm(int, int, int);
54-
int next(void);
5553
void rdata(void);
56-
int rnum(void);
57-
void rdesc(int);
58-
void rtrav(void);
5954
#ifdef DEBUG
6055
void twrite(int);
6156
#endif
62-
void rvoc(void);
63-
void rlocs(void);
64-
void rdflt(void);
65-
void rliq(void);
66-
void rhints(void);
6757
void rspeak(int);
6858
void mspeak(int);
6959
struct text;
@@ -78,24 +68,17 @@ int restore(const char *);
7868
int toting(int);
7969
int here(int);
8070
int at(int);
81-
int liq2(int);
8271
int liq(void);
8372
int liqloc(int);
84-
int bitset(int, int);
8573
int forced(int);
8674
int dark(void);
8775
int pct(int);
8876
int fdwarf(void);
8977
int march(void);
90-
int mback(void);
91-
int specials(void);
92-
int trbridge(void);
93-
void badmove(void);
9478
void bug(int) __attribute__((__noreturn__));
9579
void checkhints(void);
9680
int trsay(void);
9781
int trtake(void);
98-
int dropper(void);
9982
int trdrop(void);
10083
int tropen(void);
10184
int trkill(void);
@@ -119,12 +102,9 @@ int vocab(const char *, int, int);
119102
#define weq(str1, str2) (!strncmp((str1), (str2), 5))
120103
#define length(str) (strlen((str)) + 1)
121104

122-
void prht(void);
123-
124105
/* wizard.c */
125106
void datime(int *, int *);
126107
void poof(void);
127108
int Start(void);
128-
int wizard(void);
129109
void ciao(void);
130110
int ran(int);

games/adventure/hdr.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: hdr.h,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
1+
/* $NetBSD: hdr.h,v 1.12 2009/08/12 04:28:27 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -56,7 +56,6 @@
5656

5757
#include <signal.h>
5858

59-
extern int datfd; /* message file descriptor */
6059
extern volatile sig_atomic_t delhit;
6160
extern int yea;
6261
extern char data_file[]; /* Virtual data file */
@@ -141,7 +140,7 @@ extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
141140
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
142141
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
143142
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
144-
null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
143+
null, entrnc, dprssn, /*enter, stream, pour,*/ say, lock, throw,
145144
find, invent;
146145

147146
extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */

games/adventure/init.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: init.c,v 1.17 2007/12/15 19:44:38 perry Exp $ */
1+
/* $NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland 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.17 2007/12/15 19:44:38 perry Exp $");
42+
__RCSID("$NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -55,12 +55,13 @@ __RCSID("$NetBSD: init.c,v 1.17 2007/12/15 19:44:38 perry Exp $");
5555
#include "hdr.h"
5656
#include "extern.h"
5757

58+
static void linkdata(void);
59+
5860
int blklin = TRUE;
5961

6062
int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000,
6163
04000, 010000, 020000, 040000, 0100000};
6264

63-
int datfd; /* message file descriptor */
6465
volatile sig_atomic_t delhit;
6566
int yea;
6667

@@ -111,9 +112,11 @@ int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
111112
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
112113
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
113114
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
114-
null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
115+
null, entrnc, dprssn, say, lock, throw,
115116
find, invent;
116117

118+
static int enter, /*stream,*/ pour;
119+
117120
int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
118121
odloc[7], dflag, daltlc;
119122

@@ -148,7 +151,7 @@ decr(int a, int b, int c, int d, int e)
148151
return buf;
149152
}
150153

151-
void
154+
static void
152155
linkdata(void)
153156
{ /* secondary data manipulation */
154157
int i, j;

games/adventure/io.c

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $ */
1+
/* $NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
3939
#if 0
4040
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
4141
#else
42-
__RCSID("$NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $");
42+
__RCSID("$NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -52,6 +52,15 @@ __RCSID("$NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $");
5252
#include "hdr.h"
5353
#include "extern.h"
5454

55+
static int next(void);
56+
static void rdesc(int);
57+
static void rdflt(void);
58+
static void rhints(void);
59+
static void rliq(void);
60+
static void rlocs(void);
61+
static int rnum(void);
62+
static void rtrav(void);
63+
static void rvoc(void);
5564

5665
/* get command from user */
5766
/* no prompt, usually */
@@ -159,15 +168,15 @@ yesm(int x, int y, int z)
159168
}
160169
/* FILE *inbuf,*outbuf; */
161170

162-
char *inptr; /* Pointer into virtual disk */
171+
static char *inptr; /* Pointer into virtual disk */
163172

164-
int outsw = 0; /* putting stuff to data file? */
173+
static int outsw = 0; /* putting stuff to data file? */
165174

166-
const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
167-
const char *tape = iotape; /* pointer to encryption tape */
175+
static const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
176+
static const char *tape = iotape; /* pointer to encryption tape */
168177

169178
/* next virtual char, bump adr */
170-
int
179+
static int
171180
next(void)
172181
{
173182
int ch;
@@ -182,7 +191,7 @@ next(void)
182191
return (ch);
183192
}
184193

185-
char breakch; /* tell which char ended rnum */
194+
static char breakch; /* tell which char ended rnum */
186195

187196
/* "read" data from virtual file */
188197
void
@@ -259,10 +268,10 @@ rdata(void)
259268
}
260269
}
261270

262-
char nbf[12];
271+
static char nbf[12];
263272

264273
/* read initial location num */
265-
int
274+
static int
266275
rnum(void)
267276
{
268277
char *s;
@@ -277,10 +286,10 @@ rnum(void)
277286
return (atoi(nbf)); /* convert it to integer */
278287
}
279288

280-
char *seekhere;
289+
static char *seekhere;
281290

282291
/* read description-format msgs */
283-
void
292+
static void
284293
rdesc(int sect)
285294
{
286295
int locc;
@@ -343,7 +352,7 @@ rdesc(int sect)
343352
}
344353

345354
/* read travel table */
346-
void
355+
static void
347356
rtrav(void)
348357
{
349358
int locc;
@@ -424,7 +433,7 @@ twrite(int loq)
424433
#endif /* DEBUG */
425434

426435
/* read the vocabulary */
427-
void
436+
static void
428437
rvoc(void)
429438
{
430439
char *s;
@@ -449,7 +458,7 @@ rvoc(void)
449458
}
450459

451460
/* initial object locations */
452-
void
461+
static void
453462
rlocs(void)
454463
{
455464
for (;;) {
@@ -464,7 +473,7 @@ rlocs(void)
464473
}
465474

466475
/* default verb messages */
467-
void
476+
static void
468477
rdflt(void)
469478
{
470479
for (;;) {
@@ -475,7 +484,7 @@ rdflt(void)
475484
}
476485

477486
/* liquid assets &c: cond bits */
478-
void
487+
static void
479488
rliq(void)
480489
{
481490
int bitnum;
@@ -493,7 +502,7 @@ rliq(void)
493502
}
494503
}
495504

496-
void
505+
static void
497506
rhints(void)
498507
{
499508
int hintnum, i;

games/adventure/save.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: save.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
1+
/* $NetBSD: save.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */
22

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

@@ -54,7 +54,7 @@ struct savestruct {
5454
int width;
5555
};
5656

57-
struct savestruct save_array[] =
57+
static const struct savestruct save_array[] =
5858
{
5959
{&abbnum, sizeof(abbnum)},
6060
{&attack, sizeof(attack)},
@@ -126,7 +126,7 @@ int
126126
save(const char *outfile)
127127
{
128128
FILE *out;
129-
struct savestruct *p;
129+
const struct savestruct *p;
130130
char *s;
131131
long sum;
132132
int i;
@@ -159,7 +159,7 @@ int
159159
restore(const char *infile)
160160
{
161161
FILE *in;
162-
struct savestruct *p;
162+
const struct savestruct *p;
163163
char *s;
164164
long sum, cksum = 0;
165165
int i;

0 commit comments

Comments
 (0)