+/* $NetBSD: parties.c,v 1.11 2003/08/07 09:37:43 agc Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 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: @(#)parties.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: parties.c,v 1.2 1993/08/01 18:51:42 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)parties.c 8.2 (Berkeley) 4/28/95";
+#else
+__RCSID("$NetBSD: parties.c,v 1.11 2003/08/07 09:37:43 agc Exp $");
+#endif
#endif /* not lint */
-#include "externs.h"
+#include <sys/types.h>
+#include "extern.h"
-meleeing(from, to)
-struct ship *from;
-register struct ship *to;
+int
+meleeing(struct ship *from, struct ship *to)
{
- register struct BP *p = from->file->OBP;
- register struct BP *q = p + NBP;
+ struct BP *p = from->file->OBP;
+ struct BP *q = p + NBP;
for (; p < q; p++)
if (p->turnsent && p->toship == to)
return 0;
}
-boarding(from, isdefense)
-register struct ship *from;
-char isdefense;
+int
+boarding(struct ship *from, int isdefense)
{
- register struct BP *p = isdefense ? from->file->DBP : from->file->OBP;
- register struct BP *q = p + NBP;
+ struct BP *p = isdefense ? from->file->DBP : from->file->OBP;
+ struct BP *q = p + NBP;
for (; p < q; p++)
if (p->turnsent)
return 0;
}
-unboard(ship, to, isdefense)
-register struct ship *ship, *to;
-register char isdefense;
+void
+unboard(struct ship *ship, struct ship *to, int isdefense)
{
- register struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP;
- register n;
+ struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP;
+ int n;
for (n = 0; n < NBP; p++, n++)
if (p->turnsent && (p->toship == to || isdefense || ship == to))
- Write(isdefense ? W_DBP : W_OBP, ship, 0, n, 0, 0, 0);
+ Write(isdefense ? W_DBP : W_OBP, ship, n, 0, 0, 0);
}