diff options
Diffstat (limited to 'boggle/boggle/bog.c')
-rw-r--r-- | boggle/boggle/bog.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c index 4e6c4c79..6c3b92e2 100644 --- a/boggle/boggle/bog.c +++ b/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $ */ +/* $NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $ */ /*- * Copyright (c) 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\ #if 0 static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $"); +__RCSID("$NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $"); #endif #endif /* not lint */ @@ -101,10 +101,12 @@ int wordpath[MAXWORDLEN + 1]; int wordlen; /* Length of last word returned by nextword() */ int usedbits; -char *pword[MAXPWORDS], pwords[MAXPSPACE], *pwordsp; +const char *pword[MAXPWORDS]; +char pwords[MAXPSPACE], *pwordsp; int npwords; -char *mword[MAXMWORDS], mwords[MAXMSPACE], *mwordsp; +const char *mword[MAXMWORDS]; +char mwords[MAXMSPACE], *mwordsp; int nmwords; int ngames = 0; @@ -415,10 +417,11 @@ timesup: ; */ int checkword(word, prev, path) - char *word; + const char *word; int prev, *path; { - char *p, *q; + const char *p; + char *q; int i, *lm; if (debug) { @@ -498,10 +501,10 @@ checkword(word, prev, path) */ int validword(word) - char *word; + const char *word; { int j; - char *q, *w; + const char *q, *w; j = word[0] - 'a'; if (dictseek(dictfp, dictindex[j].start, SEEK_SET) < 0) { @@ -534,7 +537,8 @@ validword(word) void checkdict() { - char *p, **pw, *w; + char *p, *w; + const char **pw; int i; int prevch, previndex, *pi, *qi, st; @@ -612,12 +616,12 @@ checkdict() */ void newgame(b) - char *b; + const char *b; { int i, p, q; - char *tmp; + const char *tmp; int *lm[26]; - static char *cubes[16] = { + static const char *cubes[16] = { "ednosw", "aaciot", "acelrs", "ehinps", "eefhiy", "elpstu", "acdemp", "gilruw", "egkluy", "ahmors", "abilty", "adenvz", @@ -684,7 +688,7 @@ int compar(p, q) const void *p, *q; { - return (strcmp(*(char **)p, *(char **)q)); + return (strcmp(*(const char *const *)p, *(const char *const *)q)); } void |