diff options
author | dholland <dholland@NetBSD.org> | 2014-03-22 22:45:05 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2014-03-22 22:45:05 +0000 |
commit | 64808850222580f008163db7fd9e2267f505d35c (patch) | |
tree | 4d6341824811a87d5a56ef45703d26afd03bc006 /atc | |
parent | 767da0d3e196c89c429ed4f929a2442be58e2220 (diff) | |
download | bsdgames-darwin-64808850222580f008163db7fd9e2267f505d35c.tar.gz bsdgames-darwin-64808850222580f008163db7fd9e2267f505d35c.tar.zst bsdgames-darwin-64808850222580f008163db7fd9e2267f505d35c.zip |
use more suitable types
Diffstat (limited to 'atc')
-rw-r--r-- | atc/input.c | 8 | ||||
-rw-r--r-- | atc/struct.h | 8 | ||||
-rw-r--r-- | atc/update.c | 8 |
3 files changed, 13 insertions, 11 deletions
diff --git a/atc/input.c b/atc/input.c index 5be372c9..c0d1be32 100644 --- a/atc/input.c +++ b/atc/input.c @@ -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) { diff --git a/atc/struct.h b/atc/struct.h index 5ce9a2b3..ad5361dd 100644 --- a/atc/struct.h +++ b/atc/struct.h @@ -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. */ +#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 { diff --git a/atc/update.c b/atc/update.c index 59c6a24d..52cf5ff6 100644 --- a/atc/update.c +++ b/atc/update.c @@ -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; |