summaryrefslogtreecommitdiff
path: root/games/battlestar/parse.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-09-13 01:30:35 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-09-13 01:30:35 +0000
commitb3888d9681fb2a06862951f70b6f5db8182b5ffe (patch)
tree876612919934f0fdcfa9d4e8cb8ffaac4936bd32 /games/battlestar/parse.c
parent59960cac708b617a25b3844645eb144553ea4562 (diff)
NetBSD merge, numerous patches from jsm28@cam.ac.uk, spelling fixes, and
correct gid revoke.
Diffstat (limited to 'games/battlestar/parse.c')
-rw-r--r--games/battlestar/parse.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/games/battlestar/parse.c b/games/battlestar/parse.c
index 12092b62601..3d39c239924 100644
--- a/games/battlestar/parse.c
+++ b/games/battlestar/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.4 1997/08/24 21:55:12 deraadt Exp $ */
+/* $OpenBSD: parse.c,v 1.5 1998/09/13 01:30:33 pjanzen Exp $ */
/* $NetBSD: parse.c,v 1.3 1995/03/21 15:07:48 cgd Exp $ */
/*
@@ -38,20 +38,16 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: parse.c,v 1.3 1995/03/21 15:07:48 cgd Exp $";
+static char rcsid[] = "$OpenBSD: parse.c,v 1.5 1998/09/13 01:30:33 pjanzen Exp $";
#endif
#endif /* not lint */
#include "extern.h"
-int hash __P((char *));
-void install __P((struct wlist *));
-struct wlist *lookup __P((char *));
-
void
wordinit()
{
- register struct wlist *w;
+ struct wlist *w;
for (w = wlist; w->string; w++)
install(w);
@@ -59,9 +55,9 @@ wordinit()
int
hash(s)
- register char *s;
+ char *s;
{
- register hashval = 0;
+ int hashval = 0;
while (*s) {
hashval += *s++;
@@ -73,9 +69,9 @@ hash(s)
struct wlist *
lookup(s)
- char *s;
+ char *s;
{
- register struct wlist *wp;
+ struct wlist *wp;
for (wp = hashtab[hash(s)]; wp != NULL; wp = wp->next)
if (*s == *wp->string && strcmp(s, wp->string) == 0)
@@ -85,9 +81,9 @@ lookup(s)
void
install(wp)
- register struct wlist *wp;
+ struct wlist *wp;
{
- int hashval;
+ int hashval;
if (lookup(wp->string) == NULL) {
hashval = hash(wp->string);
@@ -100,17 +96,17 @@ install(wp)
void
parse()
{
- register struct wlist *wp;
- register n;
+ struct wlist *wp;
+ int n;
- wordnumber = 0; /* for cypher */
+ wordnumber = 0; /* for cypher */
for (n = 0; n <= wordcount; n++) {
if ((wp = lookup(words[n])) == NULL) {
wordvalue[n] = -1;
wordtype[n] = -1;
} else {
- wordvalue[n] = wp -> value;
- wordtype[n] = wp -> article;
+ wordvalue[n] = wp->value;
+ wordtype[n] = wp->article;
}
}
}