Sun Mar 30 05:53:12 2014 UTC ()
Use bool (not int) for a boolean return type.


(dholland)
diff -r1.22 -r1.23 src/games/hunt/huntd/answer.c
diff -r1.30 -r1.31 src/games/hunt/huntd/hunt.h

cvs diff -r1.22 -r1.23 src/games/hunt/huntd/answer.c (expand / switch to unified diff)

--- src/games/hunt/huntd/answer.c 2014/03/30 05:30:28 1.22
+++ src/games/hunt/huntd/answer.c 2014/03/30 05:53:12 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: answer.c,v 1.22 2014/03/30 05:30:28 dholland Exp $ */ 1/* $NetBSD: answer.c,v 1.23 2014/03/30 05:53:12 dholland Exp $ */
2/* 2/*
3 * Copyright (c) 1983-2003, Regents of the University of California. 3 * Copyright (c) 1983-2003, Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
5 *  5 *
6 * Redistribution and use in source and binary forms, with or without  6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are  7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 *  9 *
10 * + Redistributions of source code must retain the above copyright  10 * + Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * + Redistributions in binary form must reproduce the above copyright  12 * + Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the  13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -22,49 +22,49 @@ @@ -22,49 +22,49 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A  22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34#ifndef lint 34#ifndef lint
35__RCSID("$NetBSD: answer.c,v 1.22 2014/03/30 05:30:28 dholland Exp $"); 35__RCSID("$NetBSD: answer.c,v 1.23 2014/03/30 05:53:12 dholland Exp $");
36#endif /* not lint */ 36#endif /* not lint */
37 37
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/socket.h> 39#include <sys/socket.h>
40#include <netinet/in.h> 40#include <netinet/in.h>
41#include <ctype.h> 41#include <ctype.h>
42#include <errno.h> 42#include <errno.h>
43#include <fcntl.h> 43#include <fcntl.h>
44#include <stdlib.h> 44#include <stdlib.h>
45#include <unistd.h> 45#include <unistd.h>
46#include <assert.h> 46#include <assert.h>
47#include "hunt.h" 47#include "hunt.h"
48 48
49#define SCOREDECAY 15 49#define SCOREDECAY 15
50 50
51static char Ttyname[WIRE_NAMELEN]; 51static char Ttyname[WIRE_NAMELEN];
52 52
53static IDENT *get_ident(uint32_t, uint32_t, const char *, char); 53static IDENT *get_ident(uint32_t, uint32_t, const char *, char);
54static void stmonitor(PLAYER *); 54static void stmonitor(PLAYER *);
55static void stplayer(PLAYER *, int); 55static void stplayer(PLAYER *, int);
56 56
57int 57bool
58answer(void) 58answer(void)
59{ 59{
60 PLAYER *pp; 60 PLAYER *pp;
61 int newsock; 61 int newsock;
62 static uint32_t mode; 62 static uint32_t mode;
63 static char name[WIRE_NAMELEN]; 63 static char name[WIRE_NAMELEN];
64 static char team; 64 static char team;
65 static int32_t enter_status; 65 static int32_t enter_status;
66 static socklen_t socklen; 66 static socklen_t socklen;
67 static uint32_t machine; 67 static uint32_t machine;
68 static uint32_t uid; 68 static uint32_t uid;
69 static struct sockaddr_storage newaddr; 69 static struct sockaddr_storage newaddr;
70 char *cp1, *cp2; 70 char *cp1, *cp2;

cvs diff -r1.30 -r1.31 src/games/hunt/huntd/hunt.h (expand / switch to unified diff)

--- src/games/hunt/huntd/hunt.h 2014/03/30 05:30:28 1.30
+++ src/games/hunt/huntd/hunt.h 2014/03/30 05:53:12 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hunt.h,v 1.30 2014/03/30 05:30:28 dholland Exp $ */ 1/* $NetBSD: hunt.h,v 1.31 2014/03/30 05:53:12 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1983-2003, Regents of the University of California. 4 * Copyright (c) 1983-2003, Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 *  6 *
7 * Redistribution and use in source and binary forms, with or without  7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are  8 * modification, are permitted provided that the following conditions are
9 * met: 9 * met:
10 *  10 *
11 * + Redistributions of source code must retain the above copyright  11 * + Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * + Redistributions in binary form must reproduce the above copyright  13 * + Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the  14 * notice, this list of conditions and the following disclaimer in the
@@ -150,27 +150,27 @@ extern PLAYER Player[MAXPL], *End_player @@ -150,27 +150,27 @@ extern PLAYER Player[MAXPL], *End_player
150#ifdef BOOTS 150#ifdef BOOTS
151extern PLAYER Boot[NBOOTS]; 151extern PLAYER Boot[NBOOTS];
152#endif 152#endif
153 153
154#ifdef MONITOR 154#ifdef MONITOR
155extern PLAYER Monitor[MAXMON], *End_monitor; 155extern PLAYER Monitor[MAXMON], *End_monitor;
156#endif 156#endif
157 157
158/* 158/*
159 * function types 159 * function types
160 */ 160 */
161 161
162/* in answer.c */ 162/* in answer.c */
163int answer(void); 163bool answer(void);
164int rand_dir(void); 164int rand_dir(void);
165 165
166/* in draw.c */ 166/* in draw.c */
167void drawmaze(PLAYER *); 167void drawmaze(PLAYER *);
168void look(PLAYER *); 168void look(PLAYER *);
169void check(PLAYER *, int, int); 169void check(PLAYER *, int, int);
170void showstat(PLAYER *); 170void showstat(PLAYER *);
171void drawplayer(PLAYER *, bool); 171void drawplayer(PLAYER *, bool);
172void message(PLAYER *, const char *); 172void message(PLAYER *, const char *);
173 173
174/* in driver.c */ 174/* in driver.c */
175void checkdam(PLAYER *, PLAYER *, IDENT *, int, char); 175void checkdam(PLAYER *, PLAYER *, IDENT *, int, char);
176int rand_num(int); 176int rand_num(int);