Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/atc use more suitable types
details: https://anonhg.NetBSD.org/src/rev/5a785a03821b
branches: trunk
changeset: 327981:5a785a03821b
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Mar 22 22:45:05 2014 +0000
description:
use more suitable types
diffstat:
games/atc/input.c | 8 ++++----
games/atc/struct.h | 8 +++++---
games/atc/update.c | 8 ++++----
3 files changed, 13 insertions(+), 11 deletions(-)
diffs (101 lines):
diff -r e0cdf573e2c4 -r 5a785a03821b games/atc/input.c
--- a/games/atc/input.c Sat Mar 22 22:33:35 2014 +0000
+++ b/games/atc/input.c Sat Mar 22 22:45:05 2014 +0000
@@ -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 @@
if (pp == NULL)
return ("Unknown Plane");
(void)memcpy(&p, pp, sizeof (p));
- p.delayd = 0;
+ p.delayd = false;
return (NULL);
}
@@ -474,7 +474,7 @@
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) {
diff -r e0cdf573e2c4 -r 5a785a03821b games/atc/struct.h
--- a/games/atc/struct.h Sat Mar 22 22:33:35 2014 +0000
+++ b/games/atc/struct.h Sat Mar 22 22:45:05 2014 +0000
@@ -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 edjames%berkeley.edu@localhost.
*/
+#include <stdbool.h>
+
typedef struct {
int x, y;
int dir; /* used only sometimes */
@@ -86,8 +88,8 @@
int fuel;
int xpos;
int ypos;
- int delayd;
- int delayd_no;
+ bool delayd;
+ unsigned delayd_no;
} PLANE;
typedef struct {
diff -r e0cdf573e2c4 -r 5a785a03821b games/atc/update.c
--- a/games/atc/update.c Sat Mar 22 22:33:35 2014 +0000
+++ b/games/atc/update.c Sat Mar 22 22:45:05 2014 +0000
@@ -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 @@
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 @@
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;
Home |
Main Index |
Thread Index |
Old Index