+/* $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
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;
if (f <= 0 && !testnl())
{
r = getcodpar("Up or down", Udtab);
- i = (int) r->value;
+ i = (long) r->value;
}
else
{