catch up to huntd changes.

XXX: this needs to stop promiscuously sharing .h files.
This commit is contained in:
dholland 2014-03-29 20:52:13 +00:00
parent 8f371b472c
commit c6e948ac19
3 changed files with 38 additions and 37 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hunt.c,v 1.41 2011/09/01 07:18:50 plunky Exp $ */ /* $NetBSD: hunt.c,v 1.42 2014/03/29 20:52:13 dholland Exp $ */
/* /*
* Copyright (c) 1983-2003, Regents of the University of California. * Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hunt.c,v 1.41 2011/09/01 07:18:50 plunky Exp $"); __RCSID("$NetBSD: hunt.c,v 1.42 2014/03/29 20:52:13 dholland Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -55,9 +55,9 @@ __RCSID("$NetBSD: hunt.c,v 1.41 2011/09/01 07:18:50 plunky Exp $");
#define put_ch addch #define put_ch addch
#define put_str addstr #define put_str addstr
FLAG Last_player = FALSE; bool Last_player = false;
#ifdef MONITOR #ifdef MONITOR
FLAG Am_monitor = FALSE; bool Am_monitor = false;
#endif #endif
char Buf[BUFSIZ]; char Buf[BUFSIZ];
@ -66,9 +66,9 @@ char Buf[BUFSIZ];
#ifdef INTERNET #ifdef INTERNET
static char *Sock_host; static char *Sock_host;
static char *use_port; static char *use_port;
static FLAG Query_driver = FALSE; static bool Query_driver = false;
char *Send_message = NULL; char *Send_message = NULL;
static FLAG Show_scores = FALSE; static bool Show_scores = false;
#endif #endif
static SOCKET Daemon; static SOCKET Daemon;
@ -79,7 +79,7 @@ static SOCKET Daemon;
#endif #endif
char map_key[256]; /* what to map keys to */ char map_key[256]; /* what to map keys to */
FLAG no_beep; bool no_beep;
static char name[NAMELEN]; static char name[NAMELEN];
static char team = ' '; static char team = ' ';
@ -97,7 +97,7 @@ static void fincurs(void);
static void rmnl(char *); static void rmnl(char *);
static void sigterm(int) __dead; static void sigterm(int) __dead;
static void sigusr1(int) __dead; static void sigusr1(int) __dead;
static void find_driver(FLAG); static void find_driver(bool);
static void start_driver(void); static void start_driver(void);
static int broadcast_vec(int, struct sockaddr **); static int broadcast_vec(int, struct sockaddr **);
#ifdef INTERNET #ifdef INTERNET
@ -135,22 +135,22 @@ main(int ac, char **av)
warnx("The -o flag is reserved for future use."); warnx("The -o flag is reserved for future use.");
goto usage; goto usage;
#else #else
Otto_mode = TRUE; Otto_mode = true;
break; break;
#endif #endif
case 'm': case 'm':
#ifdef MONITOR #ifdef MONITOR
Am_monitor = TRUE; Am_monitor = true;
#else #else
warnx("The monitor was not compiled in."); warnx("The monitor was not compiled in.");
#endif #endif
break; break;
#ifdef INTERNET #ifdef INTERNET
case 'S': case 'S':
Show_scores = TRUE; Show_scores = true;
break; break;
case 'q': /* query whether hunt is running */ case 'q': /* query whether hunt is running */
Query_driver = TRUE; Query_driver = true;
break; break;
case 'w': case 'w':
Send_message = optarg; Send_message = optarg;
@ -245,7 +245,7 @@ main(int ac, char **av)
errx(0, "couldn't initialize screen"); errx(0, "couldn't initialize screen");
(void) noecho(); (void) noecho();
(void) cbreak(); (void) cbreak();
in_visual = TRUE; in_visual = true;
if (LINES < SCREEN_HEIGHT || COLS < SCREEN_WIDTH) if (LINES < SCREEN_HEIGHT || COLS < SCREEN_WIDTH)
leavex(1, "Need a larger window"); leavex(1, "Need a larger window");
clear_the_screen(); clear_the_screen();
@ -256,7 +256,7 @@ main(int ac, char **av)
for (;;) { for (;;) {
#ifdef INTERNET #ifdef INTERNET
find_driver(TRUE); find_driver(true);
if (Daemon.sin_port == 0) if (Daemon.sin_port == 0)
leavex(1, "Game not found, try again"); leavex(1, "Game not found, try again");
@ -376,7 +376,7 @@ list_drivers(void)
int test_socket; int test_socket;
socklen_t namelen; socklen_t namelen;
char local_name[MAXHOSTNAMELEN + 1]; char local_name[MAXHOSTNAMELEN + 1];
static int initial = TRUE; static bool initial = true;
static struct in_addr local_address; static struct in_addr local_address;
struct hostent *hp; struct hostent *hp;
static int brdc; static int brdc;
@ -505,7 +505,7 @@ get_response:
listv[listc].sin_port = htons(0); listv[listc].sin_port = htons(0);
(void) close(test_socket); (void) close(test_socket);
initial = FALSE; initial = false;
return listv; return listv;
} }
@ -517,7 +517,7 @@ test_one_host:
} }
static void static void
find_driver(FLAG do_startup) find_driver(bool do_startup)
{ {
SOCKET *hosts; SOCKET *hosts;
@ -563,7 +563,7 @@ find_driver(FLAG do_startup)
start_driver(); start_driver();
sleep(2); sleep(2);
find_driver(FALSE); find_driver(false);
} }
static void static void
@ -706,7 +706,7 @@ void
intr(int dummy __unused) intr(int dummy __unused)
{ {
int ch; int ch;
int explained; bool explained;
int y, x; int y, x;
(void) signal(SIGINT, SIG_IGN); (void) signal(SIGINT, SIG_IGN);
@ -715,7 +715,7 @@ intr(int dummy __unused)
put_str("Really quit? "); put_str("Really quit? ");
clear_eol(); clear_eol();
refresh(); refresh();
explained = FALSE; explained = false;
for (;;) { for (;;) {
ch = getchar(); ch = getchar();
if (isupper(ch)) if (isupper(ch))
@ -736,7 +736,7 @@ intr(int dummy __unused)
if (!explained) { if (!explained) {
put_str("(Yes or No) "); put_str("(Yes or No) ");
refresh(); refresh();
explained = TRUE; explained = true;
} }
beep(); beep();
refresh(); refresh();
@ -804,7 +804,7 @@ env_init(long enter_status)
envp = s + 1; envp = s + 1;
} }
else if (strncmp(envp, "nobeep,", s - envp + 1) == 0) { else if (strncmp(envp, "nobeep,", s - envp + 1) == 0) {
no_beep = TRUE; no_beep = true;
envp = s + 1; envp = s + 1;
} }
else if (strncmp(envp, "name=", s - envp + 1) == 0) { else if (strncmp(envp, "name=", s - envp + 1) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: otto.c,v 1.15 2009/07/04 07:10:23 dholland Exp $ */ /* $NetBSD: otto.c,v 1.16 2014/03/29 20:52:13 dholland Exp $ */
#ifdef OTTO #ifdef OTTO
/* /*
* Copyright (c) 1983-2003, Regents of the University of California. * Copyright (c) 1983-2003, Regents of the University of California.
@ -45,7 +45,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: otto.c,v 1.15 2009/07/04 07:10:23 dholland Exp $"); __RCSID("$NetBSD: otto.c,v 1.16 2014/03/29 20:52:13 dholland Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/time.h> #include <sys/time.h>
@ -140,7 +140,7 @@ STATIC struct itimerval pause_time = { { 0, 0 }, { 0, 55000 }};
STATIC void attack(int, struct item *); STATIC void attack(int, struct item *);
STATIC void duck(int); STATIC void duck(int);
STATIC void face_and_move_direction(int, int); STATIC void face_and_move_direction(int, int);
STATIC int go_for_ammo(char); STATIC bool go_for_ammo(char);
STATIC void ottolook(int, struct item *); STATIC void ottolook(int, struct item *);
STATIC void look_around(void); STATIC void look_around(void);
STATIC void nothing(int); STATIC void nothing(int);
@ -523,7 +523,7 @@ duck(int rel_dir)
* go for the closest mine if possible * go for the closest mine if possible
*/ */
STATIC int STATIC bool
go_for_ammo(char mine) go_for_ammo(char mine)
{ {
int i, rel_dir, dist; int i, rel_dir, dist;
@ -537,7 +537,7 @@ go_for_ammo(char mine)
} }
} }
if (rel_dir == -1) if (rel_dir == -1)
return FALSE; return false;
if (!(flbr[rel_dir].flags & ON_SIDE) if (!(flbr[rel_dir].flags & ON_SIDE)
|| flbr[rel_dir].distance > 1) { || flbr[rel_dir].distance > 1) {
@ -545,8 +545,8 @@ go_for_ammo(char mine)
dist = 4; dist = 4;
face_and_move_direction(rel_dir, dist); face_and_move_direction(rel_dir, dist);
} else } else
return FALSE; /* until it's done right */ return false; /* until it's done right */
return TRUE; return true;
} }
STATIC void STATIC void

View File

@ -1,4 +1,4 @@
/* $NetBSD: playit.c,v 1.16 2009/08/27 00:36:32 dholland Exp $ */ /* $NetBSD: playit.c,v 1.17 2014/03/29 20:52:13 dholland Exp $ */
/* /*
* Copyright (c) 1983-2003, Regents of the University of California. * Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: playit.c,v 1.16 2009/08/27 00:36:32 dholland Exp $"); __RCSID("$NetBSD: playit.c,v 1.17 2014/03/29 20:52:13 dholland Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/file.h> #include <sys/file.h>
@ -146,7 +146,7 @@ playit(void)
case ENDWIN: case ENDWIN:
refresh(); refresh();
if ((ch = GETCHR()) == LAST_PLAYER) if ((ch = GETCHR()) == LAST_PLAYER)
Last_player = TRUE; Last_player = true;
ch = EOF; ch = EOF;
goto out; goto out;
case BELL: case BELL:
@ -281,7 +281,8 @@ send_stuff(void)
int int
quit(int old_status) quit(int old_status)
{ {
int explain, ch; bool explain;
int ch;
if (Last_player) if (Last_player)
return Q_QUIT; return Q_QUIT;
@ -292,7 +293,7 @@ quit(int old_status)
move(HEIGHT, 0); move(HEIGHT, 0);
put_str("Re-enter game [ynwo]? "); put_str("Re-enter game [ynwo]? ");
clear_eol(); clear_eol();
explain = FALSE; explain = false;
for (;;) { for (;;) {
refresh(); refresh();
if (isupper(ch = getchar())) if (isupper(ch = getchar()))
@ -369,7 +370,7 @@ get_message:
beep(); beep();
if (!explain) { if (!explain) {
put_str("(Yes, No, Write message, or Options) "); put_str("(Yes, No, Write message, or Options) ");
explain = TRUE; explain = true;
} }
} }
@ -381,7 +382,7 @@ get_message:
#endif #endif
clear_eol(); clear_eol();
refresh(); refresh();
explain = FALSE; explain = false;
for (;;) { for (;;) {
if (isupper(ch = getchar())) if (isupper(ch = getchar()))
ch = tolower(ch); ch = tolower(ch);
@ -402,7 +403,7 @@ get_message:
#else #else
put_str("[SCQ] "); put_str("[SCQ] ");
#endif #endif
explain = TRUE; explain = true;
} }
refresh(); refresh();
} }