summaryrefslogtreecommitdiffstats
path: root/adventure
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 04:28:27 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 04:28:27 +0000
commit63e571cca69e7558ecb2d0e2e654eff896c0ac62 (patch)
tree0141582e34f580554ecc15ffc8b4517ada70fc50 /adventure
parent2dc7494ef4aeb144d0da0b9bdbcfeba12073e5e3 (diff)
downloadbsdgames-darwin-63e571cca69e7558ecb2d0e2e654eff896c0ac62.tar.gz
bsdgames-darwin-63e571cca69e7558ecb2d0e2e654eff896c0ac62.tar.zst
bsdgames-darwin-63e571cca69e7558ecb2d0e2e654eff896c0ac62.zip
sprinkle static
Diffstat (limited to 'adventure')
-rw-r--r--adventure/crc.c10
-rw-r--r--adventure/extern.h22
-rw-r--r--adventure/hdr.h5
-rw-r--r--adventure/init.c13
-rw-r--r--adventure/io.c45
-rw-r--r--adventure/save.c10
-rw-r--r--adventure/subr.c26
-rw-r--r--adventure/vocab.c8
-rw-r--r--adventure/wizard.c10
9 files changed, 75 insertions, 74 deletions
diff --git a/adventure/crc.c b/adventure/crc.c
index d13bdd42..c43297a1 100644
--- a/adventure/crc.c
+++ b/adventure/crc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: crc.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1993
@@ -38,13 +38,13 @@
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
#else
-__RCSID("$NetBSD: crc.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: crc.c,v 1.10 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
#include "extern.h"
-const unsigned long crctab[] = {
+static const unsigned long crctab[] = {
0x7fffffff,
0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e,
@@ -106,8 +106,8 @@ const unsigned long crctab[] = {
* it.
*/
-unsigned long crcval;
-unsigned int step;
+static unsigned long crcval;
+static unsigned int step;
void
crc_start()
diff --git a/adventure/extern.h b/adventure/extern.h
index b9950b59..178017b9 100644
--- a/adventure/extern.h
+++ b/adventure/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.10 2004/01/27 20:30:28 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.11 2009/08/12 04:28:27 dholland Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -43,7 +43,6 @@ void die(int);
/* init.c */
void init(void);
char *decr(int, int, int, int, int);
-void linkdata(void);
void trapdel(int);
void startup(void);
@@ -51,19 +50,10 @@ void startup(void);
void getin(char **, char **);
int yes(int, int, int);
int yesm(int, int, int);
-int next(void);
void rdata(void);
-int rnum(void);
-void rdesc(int);
-void rtrav(void);
#ifdef DEBUG
void twrite(int);
#endif
-void rvoc(void);
-void rlocs(void);
-void rdflt(void);
-void rliq(void);
-void rhints(void);
void rspeak(int);
void mspeak(int);
struct text;
@@ -78,24 +68,17 @@ int restore(const char *);
int toting(int);
int here(int);
int at(int);
-int liq2(int);
int liq(void);
int liqloc(int);
-int bitset(int, int);
int forced(int);
int dark(void);
int pct(int);
int fdwarf(void);
int march(void);
-int mback(void);
-int specials(void);
-int trbridge(void);
-void badmove(void);
void bug(int) __attribute__((__noreturn__));
void checkhints(void);
int trsay(void);
int trtake(void);
-int dropper(void);
int trdrop(void);
int tropen(void);
int trkill(void);
@@ -119,12 +102,9 @@ int vocab(const char *, int, int);
#define weq(str1, str2) (!strncmp((str1), (str2), 5))
#define length(str) (strlen((str)) + 1)
-void prht(void);
-
/* wizard.c */
void datime(int *, int *);
void poof(void);
int Start(void);
-int wizard(void);
void ciao(void);
int ran(int);
diff --git a/adventure/hdr.h b/adventure/hdr.h
index 43dee3ec..ee6af9f1 100644
--- a/adventure/hdr.h
+++ b/adventure/hdr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hdr.h,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: hdr.h,v 1.12 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -56,7 +56,6 @@
#include <signal.h>
-extern int datfd; /* message file descriptor */
extern volatile sig_atomic_t delhit;
extern int yea;
extern char data_file[]; /* Virtual data file */
@@ -141,7 +140,7 @@ extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
- null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
+ null, entrnc, dprssn, /*enter, stream, pour,*/ say, lock, throw,
find, invent;
extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
diff --git a/adventure/init.c b/adventure/init.c
index 5269b96c..5a4ca15f 100644
--- a/adventure/init.c
+++ b/adventure/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.17 2007/12/15 19:44:38 perry Exp $ */
+/* $NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.17 2007/12/15 19:44:38 perry Exp $");
+__RCSID("$NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -55,12 +55,13 @@ __RCSID("$NetBSD: init.c,v 1.17 2007/12/15 19:44:38 perry Exp $");
#include "hdr.h"
#include "extern.h"
+static void linkdata(void);
+
int blklin = TRUE;
int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000,
04000, 010000, 020000, 040000, 0100000};
-int datfd; /* message file descriptor */
volatile sig_atomic_t delhit;
int yea;
@@ -111,9 +112,11 @@ int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
- null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
+ null, entrnc, dprssn, say, lock, throw,
find, invent;
+static int enter, /*stream,*/ pour;
+
int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
odloc[7], dflag, daltlc;
@@ -148,7 +151,7 @@ decr(int a, int b, int c, int d, int e)
return buf;
}
-void
+static void
linkdata(void)
{ /* secondary data manipulation */
int i, j;
diff --git a/adventure/io.c b/adventure/io.c
index 05984817..7382f5a9 100644
--- a/adventure/io.c
+++ b/adventure/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $ */
+/* $NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $");
+__RCSID("$NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -52,6 +52,15 @@ __RCSID("$NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $");
#include "hdr.h"
#include "extern.h"
+static int next(void);
+static void rdesc(int);
+static void rdflt(void);
+static void rhints(void);
+static void rliq(void);
+static void rlocs(void);
+static int rnum(void);
+static void rtrav(void);
+static void rvoc(void);
/* get command from user */
/* no prompt, usually */
@@ -159,15 +168,15 @@ yesm(int x, int y, int z)
}
/* FILE *inbuf,*outbuf; */
-char *inptr; /* Pointer into virtual disk */
+static char *inptr; /* Pointer into virtual disk */
-int outsw = 0; /* putting stuff to data file? */
+static int outsw = 0; /* putting stuff to data file? */
-const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
-const char *tape = iotape; /* pointer to encryption tape */
+static const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l";
+static const char *tape = iotape; /* pointer to encryption tape */
/* next virtual char, bump adr */
-int
+static int
next(void)
{
int ch;
@@ -182,7 +191,7 @@ next(void)
return (ch);
}
-char breakch; /* tell which char ended rnum */
+static char breakch; /* tell which char ended rnum */
/* "read" data from virtual file */
void
@@ -259,10 +268,10 @@ rdata(void)
}
}
-char nbf[12];
+static char nbf[12];
/* read initial location num */
-int
+static int
rnum(void)
{
char *s;
@@ -277,10 +286,10 @@ rnum(void)
return (atoi(nbf)); /* convert it to integer */
}
-char *seekhere;
+static char *seekhere;
/* read description-format msgs */
-void
+static void
rdesc(int sect)
{
int locc;
@@ -343,7 +352,7 @@ rdesc(int sect)
}
/* read travel table */
-void
+static void
rtrav(void)
{
int locc;
@@ -424,7 +433,7 @@ twrite(int loq)
#endif /* DEBUG */
/* read the vocabulary */
-void
+static void
rvoc(void)
{
char *s;
@@ -449,7 +458,7 @@ rvoc(void)
}
/* initial object locations */
-void
+static void
rlocs(void)
{
for (;;) {
@@ -464,7 +473,7 @@ rlocs(void)
}
/* default verb messages */
-void
+static void
rdflt(void)
{
for (;;) {
@@ -475,7 +484,7 @@ rdflt(void)
}
/* liquid assets &c: cond bits */
-void
+static void
rliq(void)
{
int bitnum;
@@ -493,7 +502,7 @@ rliq(void)
}
}
-void
+static void
rhints(void)
{
int hintnum, i;
diff --git a/adventure/save.c b/adventure/save.c
index 8e25c54b..4557ab35 100644
--- a/adventure/save.c
+++ b/adventure/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: save.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.9 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: save.c,v 1.10 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -54,7 +54,7 @@ struct savestruct {
int width;
};
-struct savestruct save_array[] =
+static const struct savestruct save_array[] =
{
{&abbnum, sizeof(abbnum)},
{&attack, sizeof(attack)},
@@ -126,7 +126,7 @@ int
save(const char *outfile)
{
FILE *out;
- struct savestruct *p;
+ const struct savestruct *p;
char *s;
long sum;
int i;
@@ -159,7 +159,7 @@ int
restore(const char *infile)
{
FILE *in;
- struct savestruct *p;
+ const struct savestruct *p;
char *s;
long sum, cksum = 0;
int i;
diff --git a/adventure/subr.c b/adventure/subr.c
index 4ce56561..bd4dea78 100644
--- a/adventure/subr.c
+++ b/adventure/subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr.c,v 1.11 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: subr.c,v 1.12 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subr.c,v 1.11 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: subr.c,v 1.12 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -50,6 +50,14 @@ __RCSID("$NetBSD: subr.c,v 1.11 2005/07/01 00:03:36 jmc Exp $");
#include "hdr.h"
#include "extern.h"
+static void badmove(void);
+static int bitset(int, int);
+static int dropper(void);
+static int liq2(int);
+static int mback(void);
+static int specials(void);
+static int trbridge(void);
+
/* Statement functions */
int
toting(int objj)
@@ -78,7 +86,7 @@ at(int objj)
return (FALSE);
}
-int
+static int
liq2(int pbotl)
{
return ((1 - pbotl) * water + (pbotl / 2) * (water + oil));
@@ -107,7 +115,7 @@ liqloc(int locc)
return (liq2(j * l + 1));
}
-int
+static int
bitset(int l, int n)
{
if (cond[l] & setbit[n])
@@ -373,7 +381,7 @@ l12: /* alternative to probability move */
}
/* 20 */
-int
+static int
mback(void)
{
struct travlist *tk2, *j;
@@ -411,7 +419,7 @@ mback(void)
}
/* 30000 */
-int
+static int
specials(void)
{
switch (newloc -= 300) {
@@ -433,7 +441,7 @@ specials(void)
}
/* 30300 */
-int
+static int
trbridge(void)
{
if (prop[troll] == 1) {
@@ -465,7 +473,7 @@ trbridge(void)
}
/* 20 */
-void
+static void
badmove(void)
{
spk = 12;
@@ -616,7 +624,7 @@ l9014: if ((obj == bird || obj == cage) && prop[bird] != 0)
}
/* 9021 */
-int
+static int
dropper(void)
{
k = liq();
diff --git a/adventure/vocab.c b/adventure/vocab.c
index 6d361e21..01beeeeb 100644
--- a/adventure/vocab.c
+++ b/adventure/vocab.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vocab.c,v 1.13 2006/03/18 23:35:51 christos Exp $ */
+/* $NetBSD: vocab.c,v 1.14 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: vocab.c,v 1.13 2006/03/18 23:35:51 christos Exp $");
+__RCSID("$NetBSD: vocab.c,v 1.14 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -189,8 +189,8 @@ exitloop2: /* hashed entry does not match */
}
}
-/* print hash table */
-void
+/* print hash table (for debugging) */
+static __unused void
prht(void)
{
int i, j, l;
diff --git a/adventure/wizard.c b/adventure/wizard.c
index a63aa069..c0819ffa 100644
--- a/adventure/wizard.c
+++ b/adventure/wizard.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wizard.c,v 1.12 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: wizard.c,v 1.13 2009/08/12 04:28:27 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: wizard.c,v 1.12 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: wizard.c,v 1.13 2009/08/12 04:28:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -52,6 +52,8 @@ __RCSID("$NetBSD: wizard.c,v 1.12 2005/07/01 00:03:36 jmc Exp $");
#include "hdr.h"
#include "extern.h"
+static int wizard(void);
+
void
datime(int *d, int *t)
{
@@ -71,7 +73,7 @@ datime(int *d, int *t)
} /* pretty painless */
-char magic[6];
+static char magic[6];
void
poof(void)
@@ -109,7 +111,7 @@ Start(void)
}
/* not as complex as advent/10 (for now) */
-int
+static int
wizard(void)
{
char *word, *x;