-/* $NetBSD: capture.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
+/* $NetBSD: capture.c,v 1.12 2009/08/12 08:54:54 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
* 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.
*
#if 0
static char sccsid[] = "@(#)capture.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: capture.c,v 1.5 1999/09/08 21:45:32 jsm 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
**
/*ARGSUSED*/
void
-capture(v)
- int v __attribute__((__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;
}
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;
}
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;
** Cruddy, just takes one at random. Should ask the captain.
*/
-struct kling *selectklingon()
+static struct kling *
+selectklingon(void)
{
int i;