Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/hunt/hunt catch up to huntd changes.



details:   https://anonhg.NetBSD.org/src/rev/98a81bea1b5a
branches:  trunk
changeset: 328241:98a81bea1b5a
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Mar 29 20:52:13 2014 +0000

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

diffstat:

 games/hunt/hunt/hunt.c   |  44 ++++++++++++++++++++++----------------------
 games/hunt/hunt/otto.c   |  14 +++++++-------
 games/hunt/hunt/playit.c |  17 +++++++++--------
 3 files changed, 38 insertions(+), 37 deletions(-)

diffs (truncated from 306 to 300 lines):

diff -r 7e2d777de287 -r 98a81bea1b5a games/hunt/hunt/hunt.c
--- a/games/hunt/hunt/hunt.c    Sat Mar 29 20:44:20 2014 +0000
+++ b/games/hunt/hunt/hunt.c    Sat Mar 29 20:52:13 2014 +0000
@@ -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 @@
 #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 @@
 #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 @@
 #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 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 @@
                        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 @@
                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 @@
 
        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 @@
        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 @@
                listv[listc].sin_port = htons(0);
 
                (void) close(test_socket);
-               initial = FALSE;
+               initial = false;
                return listv;
        }
 
@@ -517,7 +517,7 @@
 }
 
 static void
-find_driver(FLAG do_startup)
+find_driver(bool do_startup)
 {
        SOCKET *hosts;
 
@@ -563,7 +563,7 @@
 
        start_driver();
        sleep(2);
-       find_driver(FALSE);
+       find_driver(false);
 }
 
 static void
@@ -706,7 +706,7 @@
 intr(int dummy __unused)
 {
        int ch;
-       int explained;
+       bool explained;
        int y, x;
 
        (void) signal(SIGINT, SIG_IGN);
@@ -715,7 +715,7 @@
        put_str("Really quit? ");
        clear_eol();
        refresh();
-       explained = FALSE;
+       explained = false;
        for (;;) {
                ch = getchar();
                if (isupper(ch))
@@ -736,7 +736,7 @@
                if (!explained) {
                        put_str("(Yes or No) ");
                        refresh();
-                       explained = TRUE;
+                       explained = true;
                }
                beep();
                refresh();
@@ -804,7 +804,7 @@
                                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) {
diff -r 7e2d777de287 -r 98a81bea1b5a games/hunt/hunt/otto.c
--- a/games/hunt/hunt/otto.c    Sat Mar 29 20:44:20 2014 +0000
+++ b/games/hunt/hunt/otto.c    Sat Mar 29 20:52:13 2014 +0000
@@ -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 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 @@
  * 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 @@
                }
        }
        if (rel_dir == -1)
-               return FALSE;
+               return false;
 
        if (!(flbr[rel_dir].flags & ON_SIDE)
        || flbr[rel_dir].distance > 1) {
@@ -545,8 +545,8 @@
                        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
diff -r 7e2d777de287 -r 98a81bea1b5a games/hunt/hunt/playit.c
--- a/games/hunt/hunt/playit.c  Sat Mar 29 20:44:20 2014 +0000
+++ b/games/hunt/hunt/playit.c  Sat Mar 29 20:52:13 2014 +0000
@@ -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 @@
                  case ENDWIN:
                        refresh();
                        if ((ch = GETCHR()) == LAST_PLAYER)
-                               Last_player = TRUE;
+                               Last_player = true;
                        ch = EOF;
                        goto out;
                  case BELL:
@@ -281,7 +281,8 @@
 int
 quit(int old_status)
 {
-       int explain, ch;
+       bool explain;
+       int ch;
 
        if (Last_player)
                return Q_QUIT;
@@ -292,7 +293,7 @@
        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 @@
                beep();
                if (!explain) {
                        put_str("(Yes, No, Write message, or Options) ");
-                       explain = TRUE;
+                       explain = true;
                }
        }
 
@@ -381,7 +382,7 @@
 #endif
        clear_eol();
        refresh();
-       explain = FALSE;
+       explain = false;
        for (;;) {
                if (isupper(ch = getchar()))
                        ch = tolower(ch);
@@ -402,7 +403,7 @@
 #else
                        put_str("[SCQ] ");



Home | Main Index | Thread Index | Old Index