Module Name: src
Committed By: dholland
Date: Sat Mar 22 22:45:05 UTC 2014
Modified Files:
src/games/atc: input.c struct.h update.c
Log Message:
use more suitable types
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/games/atc/input.c
cvs rdiff -u -r1.8 -r1.9 src/games/atc/struct.h
cvs rdiff -u -r1.23 -r1.24 src/games/atc/update.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/atc/input.c
diff -u src/games/atc/input.c:1.25 src/games/atc/input.c:1.26
--- src/games/atc/input.c:1.25 Sat Mar 22 22:24:21 2014
+++ src/games/atc/input.c Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $ */
+/* $NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $");
#endif
#endif /* not lint */
@@ -393,7 +393,7 @@ setplane(int c)
if (pp == NULL)
return ("Unknown Plane");
(void)memcpy(&p, pp, sizeof (p));
- p.delayd = 0;
+ p.delayd = false;
return (NULL);
}
@@ -474,7 +474,7 @@ delayb(int ch)
ydiff = SGN(ydiff);
if (xdiff != displacement[p.dir].dx || ydiff != displacement[p.dir].dy)
return ("Beacon is not in flight path");
- p.delayd = 1;
+ p.delayd = true;
p.delayd_no = bn;
if (dest_type != T_NODEST) {
Index: src/games/atc/struct.h
diff -u src/games/atc/struct.h:1.8 src/games/atc/struct.h:1.9
--- src/games/atc/struct.h:1.8 Sat Mar 22 22:33:35 2014
+++ src/games/atc/struct.h Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: struct.h,v 1.8 2014/03/22 22:33:35 dholland Exp $ */
+/* $NetBSD: struct.h,v 1.9 2014/03/22 22:45:05 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -43,6 +43,8 @@
* For more info on this and all of my stuff, mail [email protected].
*/
+#include <stdbool.h>
+
typedef struct {
int x, y;
int dir; /* used only sometimes */
@@ -86,8 +88,8 @@ typedef struct plane {
int fuel;
int xpos;
int ypos;
- int delayd;
- int delayd_no;
+ bool delayd;
+ unsigned delayd_no;
} PLANE;
typedef struct {
Index: src/games/atc/update.c
diff -u src/games/atc/update.c:1.23 src/games/atc/update.c:1.24
--- src/games/atc/update.c:1.23 Sat Mar 22 22:24:21 2014
+++ src/games/atc/update.c Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: update.c,v 1.23 2014/03/22 22:24:21 dholland Exp $ */
+/* $NetBSD: update.c,v 1.24 2014/03/22 22:45:05 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: update.c,v 1.23 2014/03/22 22:24:21 dholland Exp $");
+__RCSID("$NetBSD: update.c,v 1.24 2014/03/22 22:45:05 dholland Exp $");
#endif
#endif /* not lint */
@@ -124,7 +124,7 @@ update(int dummy __unused)
if (pp->delayd && pp->xpos == sp->beacon[pp->delayd_no].x &&
pp->ypos == sp->beacon[pp->delayd_no].y) {
- pp->delayd = 0;
+ pp->delayd = false;
if (pp->status == S_UNMARKED)
pp->status = S_MARKED;
}
@@ -249,7 +249,7 @@ command(const PLANE *pp)
bp = strchr(buf, '\0');
bpsize = buf + sizeof(buf) - bp;
if (pp->delayd)
- (void)snprintf(bp, bpsize, " @ B%d", pp->delayd_no);
+ (void)snprintf(bp, bpsize, " @ B%u", pp->delayd_no);
bp = strchr(buf, '\0');
bpsize = buf + sizeof(buf) - bp;