Skip to content

Commit 7a2ed76

Browse files
committed
sprinkle static
1 parent c62bf84 commit 7a2ed76

File tree

8 files changed

+112
-113
lines changed

8 files changed

+112
-113
lines changed

games/atc/extern.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.c,v 1.10 2008/01/31 05:19:44 dholland Exp $ */
1+
/* $NetBSD: extern.c,v 1.11 2009/08/12 04:48:03 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
4646
#if 0
4747
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
4848
#else
49-
__RCSID("$NetBSD: extern.c,v 1.10 2008/01/31 05:19:44 dholland Exp $");
49+
__RCSID("$NetBSD: extern.c,v 1.11 2009/08/12 04:48:03 dholland Exp $");
5050
#endif
5151
#endif /* not lint */
5252

@@ -63,7 +63,8 @@ const char *filename;
6363
FILE *filein, *fileout;
6464
#endif
6565

66-
C_SCREEN screen, *sp = &screen;
66+
static C_SCREEN screen;
67+
C_SCREEN *sp = &screen;
6768

6869
LIST air, ground;
6970

games/atc/extern.h

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: extern.h,v 1.15 2009/05/25 23:48:32 dholland Exp $ */
1+
/* $NetBSD: extern.h,v 1.16 2009/08/12 04:48:03 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -53,7 +53,7 @@ extern time_t start_time;
5353
extern FILE *filein, *fileout;
5454
#endif
5555

56-
extern C_SCREEN screen, *sp;
56+
extern C_SCREEN *sp;
5757

5858
extern LIST air, ground;
5959

@@ -64,78 +64,35 @@ extern DISPLACEMENT displacement[MAXDIR];
6464
int addplane(void);
6565
void append(LIST *, PLANE *);
6666
void check_adir(int, int, int);
67-
void check_edge(int, int);
68-
void check_edir(int, int, int);
69-
void check_line(int, int, int, int);
70-
void check_linepoint(int, int);
71-
void check_point(int, int);
72-
int checkdefs(void);
73-
int compar(const void *, const void *);
7467
void delete(LIST *, PLANE *);
75-
int dir_deg(int);
7668
int dir_no(int);
7769
void done_screen(void);
7870
void draw_all(void);
79-
void draw_line(WINDOW *, int, int, int, int, const char *);
8071
void erase_all(void);
8172
int getAChar(void);
8273
int getcommand(void);
83-
int gettoken(void);
8474
void init_gr(void);
8575
void ioaddstr(int, const char *);
8676
void ioclrtobot(void);
8777
void ioclrtoeol(int);
8878
void ioerror(int, int, const char *);
8979
void iomove(int);
90-
int list_games(void);
9180
int log_score(int);
9281
void log_score_quit(int) __dead;
9382
void loser(const PLANE *, const char *) __dead;
9483
int main(int, char *[]);
9584
char name(const PLANE *);
96-
int next_plane(void);
97-
void noise(void);
9885
int number(int);
9986
void open_score_file(void);
10087
void planewin(void);
101-
int pop(void);
102-
void push(int, int);
10388
void quit(int);
104-
int read_file(const char *);
10589
void redraw(void);
106-
void rezero(void);
10790
void setup_screen(const C_SCREEN *);
108-
int too_close(const PLANE *p1, const PLANE *p2, int);
10991
void update(int);
110-
int yyerror(const char *);
11192
int yylex(void);
11293
#ifndef YYEMPTY
11394
int yyparse(void);
11495
#endif
115-
const char *Left(int);
116-
const char *Right(int);
117-
const char *airport(int);
118-
const char *beacon(int);
119-
const char *benum(int);
120-
const char *circle(int);
121-
const char *climb(int);
12296
const char *command(const PLANE *);
123-
const char *default_game(void);
124-
const char *delayb(int);
125-
const char *descend(int);
126-
const char *ex_it(int);
12797
PLANE *findplane(int);
128-
const char *ignore(int);
129-
const char *left(int);
130-
const char *mark(int);
13198
PLANE *newplane(void);
132-
const char *okay_game(const char *);
133-
const char *rel_dir(int);
134-
const char *right(int);
135-
const char *setalt(int);
136-
const char *setplane(int);
137-
const char *setrelalt(int);
138-
const char *timestr(int);
139-
const char *to_dir(int);
140-
const char *turn(int);
141-
const char *unmark(int);

games/atc/grammar.y

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: grammar.y,v 1.9 2005/07/01 00:48:34 jmc Exp $ */
1+
/* $NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -64,12 +64,15 @@
6464
#if 0
6565
static char sccsid[] = "@(#)grammar.y 8.1 (Berkeley) 5/31/93";
6666
#else
67-
__RCSID("$NetBSD: grammar.y,v 1.9 2005/07/01 00:48:34 jmc Exp $");
67+
__RCSID("$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $");
6868
#endif
6969
#endif /* not lint */
7070

71-
int errors = 0;
72-
int line = 1;
71+
int line = 1;
72+
73+
static int errors = 0;
74+
75+
static int yyerror(const char *);
7376
%}
7477

7578
%%
@@ -284,15 +287,15 @@ Lline:
284287
;
285288
%%
286289

287-
void
290+
static void
288291
check_edge(int x, int y)
289292
{
290293
if (!(x == 0) && !(x == sp->width - 1) &&
291294
!(y == 0) && !(y == sp->height - 1))
292295
yyerror("edge value not on edge.");
293296
}
294297

295-
void
298+
static void
296299
check_point(int x, int y)
297300
{
298301
if (x < 1 || x >= sp->width - 1)
@@ -301,7 +304,7 @@ check_point(int x, int y)
301304
yyerror("Y value out of range.");
302305
}
303306

304-
void
307+
static void
305308
check_linepoint(int x, int y)
306309
{
307310
if (x < 0 || x >= sp->width)
@@ -310,7 +313,7 @@ check_linepoint(int x, int y)
310313
yyerror("Y value out of range.");
311314
}
312315

313-
void
316+
static void
314317
check_line(int px1, int py1, int px2, int py2)
315318
{
316319
int d1, d2;
@@ -325,7 +328,7 @@ check_line(int px1, int py1, int px2, int py2)
325328
yyerror("Bad line endpoints.");
326329
}
327330

328-
int
331+
static int
329332
yyerror(const char *s)
330333
{
331334
fprintf(stderr, "\"%s\": line %d: %s\n", filename, line, s);
@@ -334,7 +337,7 @@ yyerror(const char *s)
334337
return (errors);
335338
}
336339

337-
void
340+
static void
338341
check_edir(int x, int y, int dir)
339342
{
340343
int bad = 0;
@@ -366,7 +369,7 @@ check_edir(int x, int y, int dir)
366369
yyerror("Bad direction for entrance at exit.");
367370
}
368371

369-
int
372+
static int
370373
checkdefs(void)
371374
{
372375
int error = 0;

games/atc/graphics.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $ */
1+
/* $NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
4646
#if 0
4747
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
4848
#else
49-
__RCSID("$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $");
49+
__RCSID("$NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $");
5050
#endif
5151
#endif /* not lint */
5252

@@ -60,7 +60,9 @@ __RCSID("$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $");
6060
#define C_BEACON '*'
6161
#define C_CREDIT '*'
6262

63-
WINDOW *radar, *cleanradar, *credit, *input, *planes;
63+
static void draw_line(WINDOW *, int, int, int, int, const char *);
64+
65+
static WINDOW *radar, *cleanradar, *credit, *input, *planes;
6466

6567
int
6668
getAChar(void)
@@ -216,7 +218,7 @@ setup_screen(const C_SCREEN *scp)
216218
(void)fflush(stdout);
217219
}
218220

219-
void
221+
static void
220222
draw_line(WINDOW *w, int x, int y, int lx, int ly, const char *s)
221223
{
222224
int dx, dy;

0 commit comments

Comments
 (0)