summaryrefslogtreecommitdiffstats
path: root/hack/hack.track.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1997-10-19 16:56:41 +0000
committerchristos <christos@NetBSD.org>1997-10-19 16:56:41 +0000
commit84e7d0704483ce39bbdeacd5e676168db6fa664f (patch)
treef9ffeffa1a4342e749494bc3f5618552435839af /hack/hack.track.c
parentf73f1009084e75624e3bc00fef9cf4749de80dcc (diff)
downloadbsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.gz
bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.zst
bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.zip
WARNsify...
Diffstat (limited to 'hack/hack.track.c')
-rw-r--r--hack/hack.track.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/hack/hack.track.c b/hack/hack.track.c
index 1225d06c..f6abe297 100644
--- a/hack/hack.track.c
+++ b/hack/hack.track.c
@@ -1,43 +1,56 @@
+/* $NetBSD: hack.track.c,v 1.4 1997/10/19 16:59:11 christos Exp $ */
+
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char rcsid[] = "$NetBSD: hack.track.c,v 1.3 1995/03/23 08:31:42 cgd Exp $";
-#endif /* not lint */
+__RCSID("$NetBSD: hack.track.c,v 1.4 1997/10/19 16:59:11 christos Exp $");
+#endif /* not lint */
#include "hack.h"
+#include "extern.h"
#define UTSZ 50
-coord utrack[UTSZ];
-int utcnt = 0;
-int utpnt = 0;
+coord utrack[UTSZ];
+int utcnt = 0;
+int utpnt = 0;
-initrack(){
+void
+initrack()
+{
utcnt = utpnt = 0;
}
/* add to track */
-settrack(){
- if(utcnt < UTSZ) utcnt++;
- if(utpnt == UTSZ) utpnt = 0;
+void
+settrack()
+{
+ if (utcnt < UTSZ)
+ utcnt++;
+ if (utpnt == UTSZ)
+ utpnt = 0;
utrack[utpnt].x = u.ux;
utrack[utpnt].y = u.uy;
utpnt++;
}
-coord *
-gettrack(x,y) register x,y; {
-register int i,cnt,dist;
-coord tc;
+coord *
+gettrack(x, y)
+ int x, y;
+{
+ int i, cnt, dist;
+ coord tc;
cnt = utcnt;
- for(i = utpnt-1; cnt--; i--){
- if(i == -1) i = UTSZ-1;
+ for (i = utpnt - 1; cnt--; i--) {
+ if (i == -1)
+ i = UTSZ - 1;
tc = utrack[i];
- dist = (x-tc.x)*(x-tc.x) + (y-tc.y)*(y-tc.y);
- if(dist < 3)
- return(dist ? &(utrack[i]) : 0);
+ dist = (x - tc.x) * (x - tc.x) + (y - tc.y) * (y - tc.y);
+ if (dist < 3)
+ return (dist ? &(utrack[i]) : 0);
}
- return(0);
+ return (0);
}