summaryrefslogtreecommitdiffstats
path: root/hangman/getword.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-11 01:16:26 +0000
committerlukem <lukem@NetBSD.org>1997-10-11 01:16:26 +0000
commita020fc98d8da9cac6990006871414e8654ac5c1d (patch)
tree541f25c2addb96a6859c8a6cb86709830680fa34 /hangman/getword.c
parentb4a56b0ad7d1689e935db1f0f29f6cdfb65961fd (diff)
downloadbsdgames-darwin-a020fc98d8da9cac6990006871414e8654ac5c1d.tar.gz
bsdgames-darwin-a020fc98d8da9cac6990006871414e8654ac5c1d.tar.zst
bsdgames-darwin-a020fc98d8da9cac6990006871414e8654ac5c1d.zip
WARNSify, KNFify
Diffstat (limited to 'hangman/getword.c')
-rw-r--r--hangman/getword.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/hangman/getword.c b/hangman/getword.c
index e858fabe..3539c140 100644
--- a/hangman/getword.c
+++ b/hangman/getword.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getword.c,v 1.4 1995/03/23 08:32:45 cgd Exp $ */
+/* $NetBSD: getword.c,v 1.5 1997/10/11 01:16:30 lukem Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -33,30 +33,31 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: getword.c,v 1.4 1995/03/23 08:32:45 cgd Exp $";
+__RCSID("$NetBSD: getword.c,v 1.5 1997/10/11 01:16:30 lukem Exp $");
#endif
#endif /* not lint */
#include "hangman.h"
-#include <stdlib.h>
/*
* getword:
* Get a valid word out of the dictionary file
*/
+void
getword()
{
- register FILE *inf;
- register char *wp, *gp;
- register long pos;
+ FILE *inf;
+ char *wp, *gp;
+ long pos;
inf = Dict;
for (;;) {
- pos = (double)rand() / (RAND_MAX + 1.0) * (double)Dict_size;
+ pos = (double) rand() / (RAND_MAX + 1.0) * (double) Dict_size;
fseek(inf, pos, 0);
if (fgets(Word, BUFSIZ, inf) == NULL)
continue;