X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/57a75ab7b9a0f4999cae7c0fa5acb46f230f38f2..5572d7c395d19f949cb8a29c96791307e744681c:/sail/dr_3.c diff --git a/sail/dr_3.c b/sail/dr_3.c index a1e893b6..147c8fb1 100644 --- a/sail/dr_3.c +++ b/sail/dr_3.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_3.c,v 1.8 2000/11/30 22:02:20 jwise Exp $ */ +/* $NetBSD: dr_3.c,v 1.15 2003/08/07 09:37:42 agc Exp $ */ /* * Copyright (c) 1983, 1993 @@ -12,11 +12,7 @@ * 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. * @@ -38,15 +34,23 @@ #if 0 static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dr_3.c,v 1.8 2000/11/30 22:02:20 jwise Exp $"); +__RCSID("$NetBSD: dr_3.c,v 1.15 2003/08/07 09:37:42 agc Exp $"); #endif #endif /* not lint */ -#include "driver.h" #include +#include +#include "extern.h" +#include "driver.h" +static int stillmoving(int); +static int is_isolated(struct ship *); +static int push(struct ship *, struct ship *); +static void step(struct ship *, int, char *); + +/* move all comp ships */ void -moveall() /* move all comp ships */ +moveall(void) { struct ship *sp, *sq; int n; @@ -86,10 +90,10 @@ moveall() /* move all comp ships */ n = 0; foreachship(sp) { if (snagged(sp)) - (void) strcpy(sp->file->movebuf, "d"); + strcpy(sp->file->movebuf, "d"); else if (*sp->file->movebuf != 'd') - (void) strcat(sp->file->movebuf, "d"); + strcat(sp->file->movebuf, "d"); row[n] = sp->file->row; col[n] = sp->file->col; dir[n] = sp->file->dir; @@ -111,7 +115,7 @@ moveall() /* move all comp ships */ if (!sp->file->movebuf[k]) sp->file->movebuf[k+1] = '\0'; else if (sp->file->dir) - step(sp->file->movebuf[k], sp, &moved[n]); + step(sp, sp->file->movebuf[k], &moved[n]); n++; } /* @@ -182,9 +186,8 @@ moveall() /* move all comp ships */ } } -int -stillmoving(k) -int k; +static int +stillmoving(int k) { struct ship *sp; @@ -194,9 +197,8 @@ int k; return 0; } -int -is_isolated(ship) -struct ship *ship; +static int +is_isolated(struct ship *ship) { struct ship *sp; @@ -207,9 +209,8 @@ struct ship *ship; return 1; } -int -push(from, to) -struct ship *from, *to; +static int +push(struct ship *from, struct ship *to) { int bs, sb; @@ -222,11 +223,8 @@ struct ship *from, *to; return from < to; } -void -step(com, sp, moved) -char com; -struct ship *sp; -char *moved; +static void +step(struct ship *sp, int com, char *moved) { int dist; @@ -266,10 +264,7 @@ char *moved; } void -sendbp(from, to, sections, isdefense) -struct ship *from, *to; -int sections; -char isdefense; +sendbp(struct ship *from, struct ship *to, int sections, int isdefense) { int n; struct BP *bp; @@ -288,9 +283,7 @@ char isdefense; } int -is_toughmelee(ship, to, isdefense, count) -struct ship *ship, *to; -int isdefense, count; +is_toughmelee(struct ship *ship, struct ship *to, int isdefense, int count) { struct BP *bp; int obp = 0; @@ -321,7 +314,7 @@ int isdefense, count; } void -reload() +reload(void) { struct ship *sp; @@ -331,7 +324,7 @@ reload() } void -checksails() +checksails(void) { struct ship *sp; int rig, full;