Module Name:    src
Committed By:   dholland
Date:           Sat Mar 29 20:52:13 UTC 2014

Modified Files:
        src/games/hunt/hunt: hunt.c otto.c playit.c

Log Message:
catch up to huntd changes.
XXX: this needs to stop promiscuously sharing .h files.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/games/hunt/hunt/hunt.c
cvs rdiff -u -r1.15 -r1.16 src/games/hunt/hunt/otto.c
cvs rdiff -u -r1.16 -r1.17 src/games/hunt/hunt/playit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

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

Index: src/games/hunt/hunt/otto.c
diff -u src/games/hunt/hunt/otto.c:1.15 src/games/hunt/hunt/otto.c:1.16
--- src/games/hunt/hunt/otto.c:1.15	Sat Jul  4 07:10:23 2009
+++ src/games/hunt/hunt/otto.c	Sat Mar 29 20:52:13 2014
@@ -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
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
@@ -45,7 +45,7 @@
 
 #include <sys/cdefs.h>
 #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 */
 
 #include <sys/time.h>
@@ -140,7 +140,7 @@ STATIC struct itimerval	pause_time = { {
 STATIC void attack(int, struct item *);
 STATIC void duck(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 look_around(void);
 STATIC void nothing(int);
@@ -523,7 +523,7 @@ duck(int rel_dir)
  * go for the closest mine if possible
  */
 
-STATIC int
+STATIC bool
 go_for_ammo(char mine)
 {
 	int i, rel_dir, dist;
@@ -537,7 +537,7 @@ go_for_ammo(char mine)
 		}
 	}
 	if (rel_dir == -1)
-		return FALSE;
+		return false;
 
 	if (!(flbr[rel_dir].flags & ON_SIDE)
 	|| flbr[rel_dir].distance > 1) {
@@ -545,8 +545,8 @@ go_for_ammo(char mine)
 			dist = 4;
 		face_and_move_direction(rel_dir, dist);
 	} else
-		return FALSE;		/* until it's done right */
-	return TRUE;
+		return false;		/* until it's done right */
+	return true;
 }
 
 STATIC void

Index: src/games/hunt/hunt/playit.c
diff -u src/games/hunt/hunt/playit.c:1.16 src/games/hunt/hunt/playit.c:1.17
--- src/games/hunt/hunt/playit.c:1.16	Thu Aug 27 00:36:32 2009
+++ src/games/hunt/hunt/playit.c	Sat Mar 29 20:52:13 2014
@@ -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.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #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 */
 
 #include <sys/file.h>
@@ -146,7 +146,7 @@ playit(void)
 		  case ENDWIN:
 			refresh();
 			if ((ch = GETCHR()) == LAST_PLAYER)
-				Last_player = TRUE;
+				Last_player = true;
 			ch = EOF;
 			goto out;
 		  case BELL:
@@ -281,7 +281,8 @@ send_stuff(void)
 int
 quit(int old_status)
 {
-	int explain, ch;
+	bool explain;
+	int ch;
 
 	if (Last_player)
 		return Q_QUIT;
@@ -292,7 +293,7 @@ quit(int old_status)
 	move(HEIGHT, 0);
 	put_str("Re-enter game [ynwo]? ");
 	clear_eol();
-	explain = FALSE;
+	explain = false;
 	for (;;) {
 		refresh();
 		if (isupper(ch = getchar()))
@@ -369,7 +370,7 @@ get_message:
 		beep();
 		if (!explain) {
 			put_str("(Yes, No, Write message, or Options) ");
-			explain = TRUE;
+			explain = true;
 		}
 	}
 
@@ -381,7 +382,7 @@ get_message:
 #endif
 	clear_eol();
 	refresh();
-	explain = FALSE;
+	explain = false;
 	for (;;) {
 		if (isupper(ch = getchar()))
 			ch = tolower(ch);
@@ -402,7 +403,7 @@ get_message:
 #else
 			put_str("[SCQ] ");
 #endif
-			explain = TRUE;
+			explain = true;
 		}
 		refresh();
 	}

Reply via email to