-Wall fixes.
This commit is contained in:
parent
0158772873
commit
8d8a5c1ed9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54379
@ -45,6 +45,7 @@ static const char rcsid[] =
|
||||
* endgame:
|
||||
* Do what's necessary at the end of the game
|
||||
*/
|
||||
void
|
||||
endgame()
|
||||
{
|
||||
char ch;
|
||||
@ -65,7 +66,7 @@ endgame()
|
||||
leaveok(stdscr, FALSE);
|
||||
refresh();
|
||||
if ((ch = readch()) == 'n')
|
||||
die();
|
||||
die(0);
|
||||
else if (ch == 'y')
|
||||
break;
|
||||
mvaddstr(MESGY + 2, MESGX, "Please type 'y' or 'n'");
|
||||
|
@ -46,6 +46,7 @@ static const char rcsid[] =
|
||||
* getguess:
|
||||
* Get another guess
|
||||
*/
|
||||
void
|
||||
getguess()
|
||||
{
|
||||
int i;
|
||||
@ -66,7 +67,7 @@ getguess()
|
||||
break;
|
||||
}
|
||||
else if (ch == CTRL('D'))
|
||||
die();
|
||||
die(0);
|
||||
else
|
||||
mvprintw(MESGY, MESGX, "Not a valid guess: '%s'",
|
||||
unctrl(ch));
|
||||
@ -90,9 +91,10 @@ getguess()
|
||||
* readch;
|
||||
* Read a character from the input
|
||||
*/
|
||||
char
|
||||
readch()
|
||||
{
|
||||
int cnt, r;
|
||||
int cnt;
|
||||
auto char ch;
|
||||
|
||||
cnt = 0;
|
||||
@ -100,7 +102,7 @@ readch()
|
||||
if (read(0, &ch, sizeof ch) <= 0)
|
||||
{
|
||||
if (++cnt > 100)
|
||||
die();
|
||||
die(0);
|
||||
}
|
||||
else if (ch == CTRL('L')) {
|
||||
wrefresh(curscr);
|
||||
|
@ -46,6 +46,7 @@ static const char rcsid[] =
|
||||
* getword:
|
||||
* Get a valid word out of the dictionary file
|
||||
*/
|
||||
void
|
||||
getword()
|
||||
{
|
||||
FILE *inf;
|
||||
|
@ -31,14 +31,17 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)hangman.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <curses.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <ctype.h>
|
||||
# include <signal.h>
|
||||
# include <unistd.h>
|
||||
# include "pathnames.h"
|
||||
|
||||
# define MINLEN 6
|
||||
@ -77,4 +80,13 @@ extern FILE *Dict;
|
||||
|
||||
extern off_t Dict_size;
|
||||
|
||||
void die();
|
||||
void die __P((int));
|
||||
void endgame __P((void));
|
||||
void getguess __P((void));
|
||||
void getword __P((void));
|
||||
void playgame __P((void));
|
||||
void prdata __P((void));
|
||||
void prman __P((void));
|
||||
void prword __P((void));
|
||||
char readch __P((void));
|
||||
void setup __P((void));
|
||||
|
@ -50,9 +50,9 @@ static const char rcsid[] =
|
||||
/*
|
||||
* This game written by Ken Arnold.
|
||||
*/
|
||||
int
|
||||
main()
|
||||
{
|
||||
void die();
|
||||
|
||||
/* revoke */
|
||||
setgid(getgid());
|
||||
@ -66,6 +66,7 @@ main()
|
||||
Average = (Average * (Wordnum - 1) + Errors) / Wordnum;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -73,7 +74,8 @@ main()
|
||||
* Die properly.
|
||||
*/
|
||||
void
|
||||
die()
|
||||
die(sig)
|
||||
int sig;
|
||||
{
|
||||
mvcur(0, COLS - 1, LINES - 1, 0);
|
||||
endwin();
|
||||
|
@ -45,6 +45,7 @@ static const char rcsid[] =
|
||||
* playgame:
|
||||
* play a game
|
||||
*/
|
||||
void
|
||||
playgame()
|
||||
{
|
||||
bool *bp;
|
||||
|
@ -45,6 +45,7 @@ static const char rcsid[] =
|
||||
* prdata:
|
||||
* Print out the current guesses
|
||||
*/
|
||||
void
|
||||
prdata()
|
||||
{
|
||||
bool *bp;
|
||||
|
@ -46,6 +46,7 @@ static const char rcsid[] =
|
||||
* Print out the man appropriately for the give number
|
||||
* of incorrect guesses.
|
||||
*/
|
||||
void
|
||||
prman()
|
||||
{
|
||||
int i;
|
||||
|
@ -45,6 +45,7 @@ static const char rcsid[] =
|
||||
* prword:
|
||||
* Print out the current state of the word
|
||||
*/
|
||||
void
|
||||
prword()
|
||||
{
|
||||
move(KNOWNY, KNOWNX + sizeof "Word: ");
|
||||
|
@ -46,6 +46,7 @@ static const char rcsid[] =
|
||||
* setup:
|
||||
* Set up the strings on the screen.
|
||||
*/
|
||||
void
|
||||
setup()
|
||||
{
|
||||
char **sp;
|
||||
|
Loading…
Reference in New Issue
Block a user