summaryrefslogtreecommitdiffstats
path: root/atc/update.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 02:07:01 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 02:07:01 +0000
commit872a50db510aae37e624f1b82db06f08023c5712 (patch)
treee5af9998b7c1daa1acf8046cd6ea941cbf25345b /atc/update.c
parent3c0c7a72c2f0803e801f2330c329aff2eee680d5 (diff)
downloadbsdgames-darwin-872a50db510aae37e624f1b82db06f08023c5712.tar.gz
bsdgames-darwin-872a50db510aae37e624f1b82db06f08023c5712.tar.zst
bsdgames-darwin-872a50db510aae37e624f1b82db06f08023c5712.zip
WARNSify
Diffstat (limited to 'atc/update.c')
-rw-r--r--atc/update.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/atc/update.c b/atc/update.c
index fd7c8a05..ef15c705 100644
--- a/atc/update.c
+++ b/atc/update.c
@@ -1,4 +1,4 @@
-/* $NetBSD: update.c,v 1.5 1997/01/13 06:50:27 tls Exp $ */
+/* $NetBSD: update.c,v 1.6 1997/10/10 02:07:34 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -45,20 +45,23 @@
* For more info on this and all of my stuff, mail edjames@berkeley.edu.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: update.c,v 1.5 1997/01/13 06:50:27 tls Exp $";
+__RCSID("$NetBSD: update.c,v 1.6 1997/10/10 02:07:34 lukem Exp $");
#endif
#endif not lint
#include "include.h"
-update()
+void
+update(dummy)
+ int dummy;
{
- int i, dir_diff, mask, unclean;
- PLANE *pp, *p1, *p2, *p;
+ int i, dir_diff, unclean;
+ PLANE *pp, *p1, *p2;
#ifdef SYSV
alarm(0);
@@ -224,7 +227,6 @@ command(pp)
PLANE *pp;
{
static char buf[50], *bp, *comm_start;
- char *index();
buf[0] = '\0';
bp = buf;
@@ -232,7 +234,7 @@ command(pp)
(pp->fuel < LOWFUEL) ? '*' : ' ',
(pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no);
- comm_start = bp = index(buf, '\0');
+ comm_start = bp = strchr(buf, '\0');
if (pp->altitude == 0)
(void)sprintf(bp, "Holding @ A%d", pp->orig_no);
else if (pp->new_dir >= MAXDIR || pp->new_dir < 0)
@@ -240,18 +242,18 @@ command(pp)
else if (pp->new_dir != pp->dir)
(void)sprintf(bp, "%d", dir_deg(pp->new_dir));
- bp = index(buf, '\0');
+ bp = strchr(buf, '\0');
if (pp->delayd)
(void)sprintf(bp, " @ B%d", pp->delayd_no);
- bp = index(buf, '\0');
+ bp = strchr(buf, '\0');
if (*comm_start == '\0' &&
(pp->status == S_UNMARKED || pp->status == S_IGNORED))
strcpy(bp, "---------");
return (buf);
}
-/* char */
+char
name(p)
PLANE *p;
{
@@ -261,7 +263,9 @@ name(p)
return ('a' + p->plane_no);
}
+int
number(l)
+ char l;
{
if (l < 'a' && l > 'z' && l < 'A' && l > 'Z')
return (-1);
@@ -271,6 +275,7 @@ number(l)
return (l - 'A');
}
+int
next_plane()
{
static int last_plane = -1;
@@ -299,6 +304,7 @@ next_plane()
return (last_plane);
}
+int
addplane()
{
PLANE p, *pp, *p1;
@@ -383,8 +389,10 @@ findplane(n)
return (NULL);
}
+int
too_close(p1, p2, dist)
PLANE *p1, *p2;
+ int dist;
{
if (ABS(p1->altitude - p2->altitude) <= dist &&
ABS(p1->xpos - p2->xpos) <= dist && ABS(p1->ypos - p2->ypos) <= dist)
@@ -393,7 +401,9 @@ too_close(p1, p2, dist)
return (0);
}
+int
dir_deg(d)
+ int d;
{
switch (d) {
case 0: return (0);