]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/capture.c
mention hex numbers
[bsdgames-darwin.git] / trek / capture.c
index b7fb0e7543defad829e085c1533c18559cab5fb3..48a70e815eff1ad2f44c9c9d8c27b76a68332893 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: capture.c,v 1.7 2007/12/15 19:44:44 perry Exp $        */
+/*     $NetBSD: capture.c,v 1.12 2009/08/12 08:54:54 dholland Exp $    */
 
 /*
  * Copyright (c) 1980, 1993
 #if 0
 static char sccsid[] = "@(#)capture.c  8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: capture.c,v 1.7 2007/12/15 19:44:44 perry Exp $");
+__RCSID("$NetBSD: capture.c,v 1.12 2009/08/12 08:54:54 dholland Exp $");
 #endif
 #endif /* not lint */
 
 #include <stdio.h>
 #include "trek.h"
 
+static struct kling *selectklingon(void);
+
 /*
 **  Ask a Klingon To Surrender
 **
@@ -57,16 +59,14 @@ __RCSID("$NetBSD: capture.c,v 1.7 2007/12/15 19:44:44 perry Exp $");
 
 /*ARGSUSED*/
 void
-capture(v)
-       int v __unused;
+capture(int v __unused)
 {
        int             i;
        struct kling    *k;
        double                  x;
 
        /* check for not cloaked */
-       if (Ship.cloaked)
-       {
+       if (Ship.cloaked) {
                printf("Ship-ship communications out when cloaked\n");
                return;
        }
@@ -75,8 +75,7 @@ capture(v)
                return;
        }
        /* find out if there are any at all */
-       if (Etc.nkling <= 0)
-       {
+       if (Etc.nkling <= 0) {
                printf("Uhura: Getting no response, sir\n");
                return;
        }
@@ -93,17 +92,17 @@ capture(v)
        x /= k->power * Etc.nkling;
        x *= Param.srndrprob;
        i = x;
-#      ifdef xTRACE
+#ifdef xTRACE
        if (Trace)
                printf("Prob = %d (%.4f)\n", i, x);
-#      endif
-       if (i > ranf(100))
-       {
+#endif
+       if (i > ranf(100)) {
                /* guess what, he surrendered!!! */
                printf("Klingon at %d,%d surrenders\n", k->x, k->y);
                i = ranf(Param.klingcrew);
                if ( i > 0 )
-                       printf("%d klingons commit suicide rather than be taken captive\n", Param.klingcrew - i);
+                       printf("%d klingons commit suicide rather than be "
+                              "taken captive\n", Param.klingcrew - i);
                if (i > Ship.brigfree)
                        i = Ship.brigfree;
                Ship.brigfree -= i;
@@ -124,7 +123,8 @@ capture(v)
 **     Cruddy, just takes one at random.  Should ask the captain.
 */
 
-struct kling   *selectklingon()
+static struct kling *
+selectklingon(void)
 {
        int             i;