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/compkl.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/compkl.c')
-rw-r--r-- | trek/compkl.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/trek/compkl.c b/trek/compkl.c index 4aa0f056..d20ba984 100644 --- a/trek/compkl.c +++ b/trek/compkl.c @@ -1,4 +1,4 @@ -/* $NetBSD: compkl.c,v 1.3 1995/04/22 10:58:38 cgd Exp $ */ +/* $NetBSD: compkl.c,v 1.4 1997/10/12 21:24:33 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,15 +33,17 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)compkl.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: compkl.c,v 1.3 1995/04/22 10:58:38 cgd Exp $"; +__RCSID("$NetBSD: compkl.c,v 1.4 1997/10/12 21:24:33 christos Exp $"); #endif #endif /* not lint */ -# include "trek.h" +#include <math.h> +#include "trek.h" /* ** compute klingon distances @@ -54,12 +56,15 @@ static char rcsid[] = "$NetBSD: compkl.c,v 1.3 1995/04/22 10:58:38 cgd Exp $"; ** move. */ +static void sortkl __P((void)); + +void compkldist(f) int f; /* set if new quadrant */ { - register int i, dx, dy; - double d; - double temp; + int i, dx, dy; + double d; + double temp; if (Etc.nkling == 0) return; @@ -96,10 +101,11 @@ int f; /* set if new quadrant */ ** bubble sort on ascending distance */ +static void sortkl() { struct kling t; - register int f, i, m; + int f, i, m; m = Etc.nkling - 1; f = 1; @@ -109,9 +115,9 @@ sortkl() for (i = 0; i < m; i++) if (Etc.klingon[i].dist > Etc.klingon[i+1].dist) { - bmove(&Etc.klingon[i], &t, sizeof t); - bmove(&Etc.klingon[i+1], &Etc.klingon[i], sizeof t); - bmove(&t, &Etc.klingon[i+1], sizeof t); + t = Etc.klingon[i]; + Etc.klingon[i] = Etc.klingon[i+1]; + Etc.klingon[i+1] = t; f = 1; } } |