diff options
author | christos <christos@NetBSD.org> | 1997-10-12 21:24:24 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 1997-10-12 21:24:24 +0000 |
commit | 634cb6ceab3191623a3daed5e953821e3f37a4cb (patch) | |
tree | 2bb707d4d2f4e28a241cac2e70f7392be0acb329 /trek/help.c | |
parent | a77b3f8edc13dc6efdbcf80e336689cfa1de08ab (diff) | |
download | bsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.tar.gz bsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.tar.zst bsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.zip |
Warnsify and remove local implementations of libc functions.
Diffstat (limited to 'trek/help.c')
-rw-r--r-- | trek/help.c | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/trek/help.c b/trek/help.c index f718070e..bedafcfd 100644 --- a/trek/help.c +++ b/trek/help.c @@ -1,4 +1,4 @@ -/* $NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $ */ +/* $NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,15 +33,19 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $"; +__RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $"); #endif #endif /* not lint */ -# include "trek.h" +#include <stdio.h> +#include <math.h> +#include <unistd.h> +#include "trek.h" /* ** call starbase for help @@ -66,22 +70,31 @@ static char rcsid[] = "$NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $"; char *Cntvect[3] = {"first", "second", "third"}; -help() +/*ARGSUSED*/ +void +help(v) + int v; { - register int i; - double dist, x; - register int dx, dy; - int j, l; + int i; + double dist, x; + int dx = 0, dy = 0; + int j, l = 0; /* check to see if calling for help is reasonable ... */ - if (Ship.cond == DOCKED) - return (printf("Uhura: But Captain, we're already docked\n")); + if (Ship.cond == DOCKED) { + printf("Uhura: But Captain, we're already docked\n"); + return; + } /* or possible */ - if (damaged(SSRADIO)) - return (out(SSRADIO)); - if (Now.bases <= 0) - return (printf("Uhura: I'm not getting any response from starbase\n")); + if (damaged(SSRADIO)) { + out(SSRADIO); + return; + } + if (Now.bases <= 0) { + printf("Uhura: I'm not getting any response from starbase\n"); + return; + } /* tut tut, there goes the score */ Game.helps += 1; @@ -149,7 +162,7 @@ help() Ship.sectx = dx; Ship.secty = dy; Sect[dx][dy] = Ship.ship; - dock(); + dock(0); compkldist(0); return; } |