]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/shield.c
Include string.h for memcpy().
[bsdgames-darwin.git] / trek / shield.c
index e6fadfea7e9f720ae7e99f0482b0b382fb3979e9..ed78e2d0ce56948cccd52bf7af429bc7e91a785f 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: shield.c,v 1.5 1997/10/12 21:25:17 christos 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
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-static char sccsid[] = "@(#)shield.c   5.5 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)shield.c   8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: shield.c,v 1.5 1997/10/12 21:25:17 christos Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
-# include      "getpar.h"
+#include <stdio.h>
+#include "trek.h"
+#include "getpar.h"
 
 /*
 **  SHIELD AND CLOAKING DEVICE CONTROL
@@ -57,29 +65,31 @@ static char sccsid[] = "@(#)shield.c        5.5 (Berkeley) 6/1/90";
 
 struct cvntab Udtab[] =
 {
-       "u",            "p",                    (int (*)())1,           0,
-       "d",            "own",                  0,              0,
-       0
+       { "u",          "p",            (cmdfun)1,      0 },
+       { "d",          "own",          (cmdfun)0,      0 },
+       { NULL,         NULL,           NULL,           0 }
 };
 
+void
 shield(f)
 int    f;
 {
-       register int            i;
-       char                    c;
-       struct cvntab           *r;
-       char                    s[100];
-       char                    *device, *dev2, *dev3;
-       int                     ind;
-       char                    *stat;
+       int             i;
+       struct cvntab   *r;
+       char            s[100];
+       char            *device, *dev2, *dev3;
+       int             ind;
+       char            *stat;
 
        if (f > 0 && (Ship.shldup || damaged(SRSCAN)))
                return;
        if (f < 0)
        {
                /* cloaking device */
-               if (Ship.ship == QUEENE)
-                       return (printf("Ye Faire Queene does not have the cloaking device.\n"));
+               if (Ship.ship == QUEENE) {
+                       printf("Ye Faire Queene does not have the cloaking device.\n");
+                       return;
+               }
                device = "Cloaking device";
                dev2 = "is";
                ind = CLOAK;
@@ -109,7 +119,7 @@ int f;
        if (f <= 0 && !testnl())
        {
                r = getcodpar("Up or down", Udtab);
-               i = (int) r->value;
+               i = (long) r->value;
        }
        else
        {