X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/77e3814f0c0e3dea4d0032e25666f77e6f83bfff..e6838d71c5f48786e0e7ce3a0ff47d9b1f71abcf:/trek/computer.c diff --git a/trek/computer.c b/trek/computer.c index 178d29b7..cb08ae6d 100644 --- a/trek/computer.c +++ b/trek/computer.c @@ -1,6 +1,8 @@ +/* $NetBSD: computer.c,v 1.6 1999/07/21 13:19:10 hubertf Exp $ */ + /* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,13 +33,20 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char sccsid[] = "@(#)computer.c 4.8 (Berkeley) 6/1/90"; +#if 0 +static char sccsid[] = "@(#)computer.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: computer.c,v 1.6 1999/07/21 13:19:10 hubertf Exp $"); +#endif #endif /* not lint */ -# include "trek.h" -# include "getpar.h" -# include +#include +#include +#include "trek.h" +#include "getpar.h" + /* ** On-Board Computer ** @@ -86,38 +95,43 @@ static char sccsid[] = "@(#)computer.c 4.8 (Berkeley) 6/1/90"; struct cvntab Cputab[] = { - "ch", "art", (int (*)())1, 0, - "t", "rajectory", (int (*)())2, 0, - "c", "ourse", (int (*)())3, 0, - "m", "ove", (int (*)())3, 1, - "s", "core", (int (*)())4, 0, - "p", "heff", (int (*)())5, 0, - "w", "arpcost", (int (*)())6, 0, - "i", "mpcost", (int (*)())7, 0, - "d", "istresslist", (int (*)())8, 0, - 0 + { "ch", "art", (cmdfun)1, 0 }, + { "t", "rajectory", (cmdfun)2, 0 }, + { "c", "ourse", (cmdfun)3, 0 }, + { "m", "ove", (cmdfun)3, 1 }, + { "s", "core", (cmdfun)4, 0 }, + { "p", "heff", (cmdfun)5, 0 }, + { "w", "arpcost", (cmdfun)6, 0 }, + { "i", "mpcost", (cmdfun)7, 0 }, + { "d", "istresslist", (cmdfun)8, 0 }, + { NULL, NULL, NULL, 0 } }; -computer() +static int kalc __P((int, int, int, int, double *)); +static void prkalc __P((int, double)); + +/*ARGSUSED*/ +void +computer(v) + int v; { - int ix, iy; - register int i, j; - int numout; - int tqx, tqy; - struct cvntab *r; - int cost; - int course; - double dist, time; - double warpfact; - struct quad *q; - register struct event *e; + int ix, iy; + int i, j; + int tqx, tqy; + const struct cvntab *r; + int cost; + int course; + double dist, time; + double warpfact; + struct quad *q; + struct event *e; if (check_out(COMPUTER)) return; while (1) { r = getcodpar("\nRequest", Cputab); - switch ((int)r->value) + switch ((long)r->value) { case 1: /* star chart */ @@ -305,6 +319,7 @@ computer() ** sqx,sqy/ssx,ssy to tqx,tqy/tsx,tsy. */ +static int kalc(tqx, tqy, tsx, tsy, dist) int tqx; int tqy; @@ -315,7 +330,7 @@ double *dist; double dx, dy; double quadsize; double angle; - register int course; + int course; /* normalize to quadrant distances */ quadsize = NSECTS; @@ -334,7 +349,7 @@ double *dist; return (course); } - +static void prkalc(course, dist) int course; double dist;