]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/play.c
speed limit 80
[bsdgames-darwin.git] / trek / play.c
index 25c4dcbca5cc1a12b0c2d1a245f209acbc6fa081..8564933002122d66b8ecca57a2b409c86913fda3 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: play.c,v 1.12 2009/08/12 08:54:54 dholland 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
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-/*static char sccsid[] = "from: @(#)play.c     5.6 (Berkeley) 6/26/90";*/
-static char rcsid[] = "$Id: play.c,v 1.2 1993/08/01 18:50:09 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)play.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: play.c,v 1.12 2009/08/12 08:54:54 dholland Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
-# include      "getpar.h"
-# include      <setjmp.h>
+#include <stdio.h>
+#include <setjmp.h>
+#include "trek.h"
+#include "getpar.h"
+
+static void myreset(int) __dead;
 
 /*
 **  INSTRUCTION READ AND MAIN PLAY LOOP
@@ -50,52 +55,50 @@ static char rcsid[] = "$Id: play.c,v 1.2 1993/08/01 18:50:09 mycroft Exp $";
 **     attack if the move was not free, and checkcond() to check up
 **     on how we are doing after the move.
 */
-extern int     abandon(), capture(), shield(), computer(), dcrept(),
-               destruct(), dock(), help(), impulse(), lrscan(),
-               warp(), dumpgame(), rest(), srscan(),
-               myreset(), torped(), visual(), setwarp(), undock(), phaser();
 
-struct cvntab  Comtab[] =
-{
-       "abandon",              "",                     abandon,        0,
-       "ca",                   "pture",                capture,        0,
-       "cl",                   "oak",                  shield, -1,
-       "c",                    "omputer",              computer,       0,
-       "da",                   "mages",                dcrept, 0,
-       "destruct",             "",                     destruct,       0,
-       "do",                   "ck",                   dock,           0,
-       "help",                 "",                     help,           0,
-       "i",                    "mpulse",               impulse,        0,
-       "l",                    "rscan",                lrscan, 0,
-       "m",                    "ove",                  warp,           0,
-       "p",                    "hasers",               phaser, 0,
-       "ram",                  "",                     warp,           1,
-       "dump",                 "",                     dumpgame,       0,
-       "r",                    "est",                  rest,           0,
-       "sh",                   "ield",                 shield, 0,
-       "s",                    "rscan",                srscan, 0,
-       "st",                   "atus",                 srscan, -1,
-       "terminate",            "",                     myreset,        0,
-       "t",                    "orpedo",               torped, 0,
-       "u",                    "ndock",                undock, 0,
-       "v",                    "isual",                visual, 0,
-       "w",                    "arp",                  setwarp,        0,
-       0
+extern jmp_buf env;
+
+static const struct cvntab Comtab[] = {
+       { "abandon",            "",             abandon,        0 },
+       { "ca",                 "pture",        capture,        0 },
+       { "cl",                 "oak",          shield,         -1 },
+       { "c",                  "omputer",      computer,       0 },
+       { "da",                 "mages",        dcrept,         0 },
+       { "destruct",           "",             destruct,       0 },
+       { "do",                 "ck",           dock,           0 },
+       { "help",               "",             help,           0 },
+       { "i",                  "mpulse",       impulse,        0 },
+       { "l",                  "rscan",        lrscan,         0 },
+       { "m",                  "ove",          dowarp,         0 },
+       { "p",                  "hasers",       phaser,         0 },
+       { "ram",                "",             dowarp,         1 },
+       { "dump",               "",             dumpgame,       0 },
+       { "r",                  "est",          rest,           0 },
+       { "sh",                 "ield",         shield,         0 },
+       { "s",                  "rscan",        srscan,         0 },
+       { "st",                 "atus",         srscan,         -1 },
+       { "terminate",          "",             myreset,        0 },
+       { "t",                  "orpedo",       torped,         0 },
+       { "u",                  "ndock",        undock,         0 },
+       { "v",                  "isual",        visual,         0 },
+       { "w",                  "arp",          setwarp,        0 },
+       { NULL,                 NULL,           NULL,           0 }
 };
 
-myreset()
+/*ARGSUSED*/
+static void
+myreset(int v __unused)
 {
-       extern jmp_buf env;
 
        longjmp(env, 1);
 }
 
-play()
+void
+play(void)
 {
-       struct cvntab           *r;
+       const struct cvntab             *r;
 
-       while (1)
-       {
+       while (1) {
                Move.free = 1;
                Move.time = 0.0;
                Move.shldchg = 0;