Skip to content

Commit bca097d

Browse files
jwisejwise
jwise
authored and
jwise
committed
First half of static-ization of local funcs.
1 parent 29e8291 commit bca097d

File tree

9 files changed

+69
-40
lines changed

9 files changed

+69
-40
lines changed

games/sail/assorted.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: assorted.c,v 1.10 2001/01/01 21:57:37 jwise Exp $ */
1+
/* $NetBSD: assorted.c,v 1.11 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)assorted.c 8.2 (Berkeley) 4/28/95";
4040
#else
41-
__RCSID("$NetBSD: assorted.c,v 1.10 2001/01/01 21:57:37 jwise Exp $");
41+
__RCSID("$NetBSD: assorted.c,v 1.11 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -47,6 +47,8 @@ __RCSID("$NetBSD: assorted.c,v 1.10 2001/01/01 21:57:37 jwise Exp $");
4747
#include <unistd.h>
4848
#include <err.h>
4949

50+
void table(int, int, int, struct ship *, struct ship *, int);
51+
void Cleansnag(struct ship *, struct ship *, int, int);
5052
static void strike (struct ship *, struct ship *);
5153

5254
void

games/sail/dr_1.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $ */
1+
/* $NetBSD: dr_1.c,v 1.13 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,13 +38,20 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $");
41+
__RCSID("$NetBSD: dr_1.c,v 1.13 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "driver.h"
4646
#include <stdlib.h>
4747

48+
void unfoul(void);
49+
void boardcomp(void);
50+
static int fightitout(struct ship *, struct ship *, int);
51+
void resolve(void);
52+
void compcombat(void);
53+
int next(void);
54+
4855
void
4956
unfoul(void)
5057
{
@@ -133,7 +140,7 @@ boardcomp(void)
133140
}
134141
}
135142

136-
int
143+
static int
137144
fightitout(struct ship *from, struct ship *to, int key)
138145
{
139146
struct ship *fromcap, *tocap;

games/sail/dr_2.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_2.c,v 1.13 2001/01/01 21:57:37 jwise Exp $ */
1+
/* $NetBSD: dr_2.c,v 1.14 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: dr_2.c,v 1.13 2001/01/01 21:57:37 jwise Exp $");
41+
__RCSID("$NetBSD: dr_2.c,v 1.14 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -47,6 +47,18 @@ __RCSID("$NetBSD: dr_2.c,v 1.13 2001/01/01 21:57:37 jwise Exp $");
4747

4848
#define couldwin(f,t) (f->specs->crew2 > t->specs->crew2 * 1.5)
4949

50+
void thinkofgrapples(void);
51+
void checkup(void);
52+
void prizecheck(void);
53+
static int str_end(const char *);
54+
void closeon(struct ship *, struct ship *, char *, int, int, int);
55+
static int score(char *, struct ship *, struct ship *, int);
56+
static void move_ship(const char *, struct ship *, unsigned char *, short *, short *, char *);
57+
static void try(char *, char *, int, int, int, int, int, struct ship *, struct ship *, int *, int);
58+
static void rmend(char *);
59+
60+
const int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
61+
5062
void
5163
thinkofgrapples(void)
5264
{
@@ -127,7 +139,7 @@ prizecheck(void)
127139
}
128140
}
129141

130-
int
142+
static int
131143
str_end(const char *str)
132144
{
133145
const char *p;
@@ -148,9 +160,7 @@ closeon(struct ship *from, struct ship *to, char *command, int ta, int ma, int a
148160
try(command, temp, ma, ta, af, ma, from->file->dir, from, to, &high, 0);
149161
}
150162

151-
const int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
152-
153-
int
163+
static int
154164
score(char *movement, struct ship *ship, struct ship *to, int onlytemp)
155165
{
156166
char drift;
@@ -181,7 +191,7 @@ score(char *movement, struct ship *ship, struct ship *to, int onlytemp)
181191
return total;
182192
}
183193

184-
void
194+
static void
185195
move_ship(const char *p, struct ship *ship, unsigned char *dir, short *row, short *col, char *drift)
186196
{
187197
int dist;
@@ -221,7 +231,7 @@ move_ship(const char *p, struct ship *ship, unsigned char *dir, short *row, shor
221231
*drift = 0;
222232
}
223233

224-
void
234+
static void
225235
try(char *command, char *temp, int ma, int ta, int af, int vma, int dir, struct ship *f, struct ship *t, int *high, int rakeme)
226236
{
227237
int new, n;
@@ -263,7 +273,7 @@ try(char *command, char *temp, int ma, int ta, int af, int vma, int dir, struct
263273
}
264274
}
265275

266-
void
276+
static void
267277
rmend(char *str)
268278
{
269279
char *p;

games/sail/dr_3.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_3.c,v 1.9 2001/01/01 21:57:37 jwise Exp $ */
1+
/* $NetBSD: dr_3.c,v 1.10 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,13 +38,23 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: dr_3.c,v 1.9 2001/01/01 21:57:37 jwise Exp $");
41+
__RCSID("$NetBSD: dr_3.c,v 1.10 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "driver.h"
4646
#include <stdlib.h>
4747

48+
void moveall(void);
49+
static int stillmoving(int);
50+
static int is_isolated(struct ship *);
51+
static int push(struct ship *, struct ship *);
52+
static void step(int, struct ship *, char *);
53+
void sendbp(struct ship *, struct ship *, int, int);
54+
int is_toughmelee(struct ship *, struct ship *, int, int);
55+
void reload(void);
56+
void checksails(void);
57+
4858
/* move all comp ships */
4959
void
5060
moveall(void)
@@ -183,7 +193,7 @@ moveall(void)
183193
}
184194
}
185195

186-
int
196+
static int
187197
stillmoving(int k)
188198
{
189199
struct ship *sp;
@@ -194,7 +204,7 @@ stillmoving(int k)
194204
return 0;
195205
}
196206

197-
int
207+
static int
198208
is_isolated(struct ship *ship)
199209
{
200210
struct ship *sp;
@@ -206,7 +216,7 @@ is_isolated(struct ship *ship)
206216
return 1;
207217
}
208218

209-
int
219+
static int
210220
push(struct ship *from, struct ship *to)
211221
{
212222
int bs, sb;
@@ -220,7 +230,7 @@ push(struct ship *from, struct ship *to)
220230
return from < to;
221231
}
222232

223-
void
233+
static void
224234
step(int com, struct ship *sp, char *moved)
225235
{
226236
int dist;

games/sail/dr_4.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_4.c,v 1.9 2001/01/01 21:57:37 jwise Exp $ */
1+
/* $NetBSD: dr_4.c,v 1.10 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,13 +38,16 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_4.c 8.2 (Berkeley) 4/28/95";
4040
#else
41-
__RCSID("$NetBSD: dr_4.c,v 1.9 2001/01/01 21:57:37 jwise Exp $");
41+
__RCSID("$NetBSD: dr_4.c,v 1.10 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "extern.h"
4646
#include <stdlib.h>
4747

48+
void ungrap(struct ship *, struct ship *);
49+
void grap(struct ship *, struct ship *);
50+
4851
void
4952
ungrap(struct ship *from, struct ship *to)
5053
{

games/sail/dr_5.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_5.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
1+
/* $NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,12 +38,15 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_5.c 8.2 (Berkeley) 4/28/95";
4040
#else
41-
__RCSID("$NetBSD: dr_5.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
41+
__RCSID("$NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "extern.h"
4646

47+
void subtract(struct ship *, int, int *, struct ship *, int);
48+
int mensent(struct ship *, struct ship *, int *, struct ship **, int *, int);
49+
4750
void
4851
subtract(struct ship *from, int totalfrom, int *crewfrom, struct ship *fromcap, int pcfrom)
4952
{

games/sail/dr_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dr_main.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
1+
/* $NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,14 +38,16 @@
3838
#if 0
3939
static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94";
4040
#else
41-
__RCSID("$NetBSD: dr_main.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
41+
__RCSID("$NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "driver.h"
4646
#include <stdlib.h>
4747
#include <unistd.h>
4848

49+
int dr_main(void);
50+
4951
int
5052
dr_main(void)
5153
{

games/sail/extern.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.h,v 1.18 2001/01/01 21:57:38 jwise Exp $ */
1+
/* $NetBSD: extern.h,v 1.19 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -307,7 +307,6 @@ void Cleansnag (struct ship *, struct ship *, int, int);
307307
/* dr_1.c */
308308
void unfoul (void);
309309
void boardcomp (void);
310-
int fightitout (struct ship *, struct ship *, int);
311310
void resolve (void);
312311
void compcombat (void);
313312
int next (void);
@@ -316,20 +315,10 @@ int next (void);
316315
void thinkofgrapples (void);
317316
void checkup (void);
318317
void prizecheck (void);
319-
int str_end (const char *);
320318
void closeon (struct ship *, struct ship *, char *, int, int, int);
321-
int score (char *, struct ship *, struct ship *, int);
322-
void move_ship (const char *, struct ship *, unsigned char *, short *, short *, char *);
323-
void try (char *, char *, int, int, int, int, int, struct ship *,
324-
struct ship *, int *, int);
325-
void rmend (char *);
326319

327320
/* dr_3.c */
328321
void moveall (void);
329-
int stillmoving (int);
330-
int is_isolated (struct ship *);
331-
int push (struct ship *, struct ship *);
332-
void step (int, struct ship *, char *);
333322
void sendbp (struct ship *, struct ship *, int, int);
334323
int is_toughmelee (struct ship *, struct ship *, int, int);
335324
void reload (void);

games/sail/game.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: game.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
1+
/* $NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,12 +38,15 @@
3838
#if 0
3939
static char sccsid[] = "@(#)game.c 8.2 (Berkeley) 4/28/95";
4040
#else
41-
__RCSID("$NetBSD: game.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
41+
__RCSID("$NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
4242
#endif
4343
#endif /* not lint */
4444

4545
#include "extern.h"
4646

47+
int maxturns(struct ship *, char *);
48+
int maxmove(struct ship *, int, int);
49+
4750
int
4851
maxturns(struct ship *ship, char *af)
4952
{

0 commit comments

Comments
 (0)