summaryrefslogtreecommitdiffstats
path: root/adventure/vocab.c
diff options
context:
space:
mode:
authorjmc <jmc@NetBSD.org>2005-07-01 00:03:36 +0000
committerjmc <jmc@NetBSD.org>2005-07-01 00:03:36 +0000
commitdf8ac21ffab206d3f69612627f47e86356f11a4d (patch)
tree53c2a86c8829e3cccb6403422c6067a262f6e19c /adventure/vocab.c
parentf48342524980f49dfc1142b5a48b89ec593d7e11 (diff)
downloadbsdgames-darwin-df8ac21ffab206d3f69612627f47e86356f11a4d.tar.gz
bsdgames-darwin-df8ac21ffab206d3f69612627f47e86356f11a4d.tar.zst
bsdgames-darwin-df8ac21ffab206d3f69612627f47e86356f11a4d.zip
KNF and WARNS=3
Diffstat (limited to 'adventure/vocab.c')
-rw-r--r--adventure/vocab.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/adventure/vocab.c b/adventure/vocab.c
index 78939d3a..f1ee2b95 100644
--- a/adventure/vocab.c
+++ b/adventure/vocab.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vocab.c,v 1.11 2003/08/07 09:36:51 agc Exp $ */
+/* $NetBSD: vocab.c,v 1.12 2005/07/01 00:03:36 jmc 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.11 2003/08/07 09:36:51 agc Exp $");
+__RCSID("$NetBSD: vocab.c,v 1.12 2005/07/01 00:03:36 jmc Exp $");
#endif
#endif /* not lint */
@@ -52,15 +52,13 @@ __RCSID("$NetBSD: vocab.c,v 1.11 2003/08/07 09:36:51 agc Exp $");
#include "extern.h"
void
-dstroy(object)
- int object;
+dstroy(int object)
{
move(object, 0);
}
void
-juggle(object)
- int object;
+juggle(int object)
{
int i, j;
@@ -70,10 +68,8 @@ juggle(object)
move(object + 100, j);
}
-
void
-move(object, where)
- int object, where;
+move(int object, int where)
{
int from;
@@ -87,16 +83,14 @@ move(object, where)
}
int
-put(object, where, pval)
- int object, where, pval;
+put(int object, int where, int pval)
{
move(object, where);
return (-1 - pval);
}
void
-carry(object, where)
- int object, where;
+carry(int object, int where)
{
int temp;
@@ -116,8 +110,7 @@ carry(object, where)
void
-drop(object, where)
- int object, where;
+drop(int object, int where)
{
if (object > 100)
fixed[object - 100] = where;
@@ -132,12 +125,11 @@ drop(object, where)
atloc[where] = object;
}
+/* look up or store a word */
+/* -2 for store, -1 for user word, >=0 for canned lookup */
+/* used for storing only */
int
-vocab(word, type, value) /* look up or store a word */
- const char *word;
- int type; /* -2 for store, -1 for user word, >=0 for
- * canned lookup */
- int value; /* used for storing only */
+vocab(const char *word, int type, int value)
{
int adr;
const char *s;
@@ -145,7 +137,7 @@ vocab(word, type, value) /* look up or store a word */
int hash, i;
struct hashtab *h;
- for (hash = 0, s = word, i = 0; i < 5 && *s; i++) /* some kind of hash */
+ for (hash = 0, s = word, i = 0; i < 5 && *s; i++) /* some kind of hash*/
hash += *s++; /* add all chars in the word */
hash = (hash * 3719) & 077777; /* pulled that one out of a hat */
hash %= HTSIZE; /* put it into range of table */
@@ -197,9 +189,10 @@ exitloop2: /* hashed entry does not match */
}
}
+/* print hash table */
void
-prht()
-{ /* print hash table */
+prht(void)
+{
int i, j, l;
char *c;
struct hashtab *h;