Module Name:    src
Committed By:   dholland
Date:           Wed Aug 12 04:48:03 UTC 2009

Modified Files:
        src/games/atc: extern.c extern.h grammar.y graphics.c input.c log.c
            main.c update.c

Log Message:
sprinkle static


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/atc/extern.c
cvs rdiff -u -r1.15 -r1.16 src/games/atc/extern.h src/games/atc/graphics.c
cvs rdiff -u -r1.9 -r1.10 src/games/atc/grammar.y
cvs rdiff -u -r1.23 -r1.24 src/games/atc/input.c
cvs rdiff -u -r1.20 -r1.21 src/games/atc/log.c src/games/atc/update.c
cvs rdiff -u -r1.19 -r1.20 src/games/atc/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/atc/extern.c
diff -u src/games/atc/extern.c:1.10 src/games/atc/extern.c:1.11
--- src/games/atc/extern.c:1.10	Thu Jan 31 05:19:44 2008
+++ src/games/atc/extern.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.c,v 1.10 2008/01/31 05:19:44 dholland Exp $	*/
+/*	$NetBSD: extern.c,v 1.11 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)extern.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: extern.c,v 1.10 2008/01/31 05:19:44 dholland Exp $");
+__RCSID("$NetBSD: extern.c,v 1.11 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -63,7 +63,8 @@
 FILE		*filein, *fileout;
 #endif
 
-C_SCREEN		screen, *sp = &screen;
+static C_SCREEN screen;
+C_SCREEN *sp = &screen;
 
 LIST		air, ground;
 

Index: src/games/atc/extern.h
diff -u src/games/atc/extern.h:1.15 src/games/atc/extern.h:1.16
--- src/games/atc/extern.h:1.15	Mon May 25 23:48:32 2009
+++ src/games/atc/extern.h	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.15 2009/05/25 23:48:32 dholland Exp $	*/
+/*	$NetBSD: extern.h,v 1.16 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -53,7 +53,7 @@
 extern FILE		*filein, *fileout;
 #endif 
 
-extern C_SCREEN		screen, *sp;
+extern C_SCREEN		*sp;
 
 extern LIST		air, ground;
 
@@ -64,78 +64,35 @@
 int		addplane(void);
 void		append(LIST *, PLANE *);
 void		check_adir(int, int, int);
-void		check_edge(int, int);
-void		check_edir(int, int, int);
-void		check_line(int, int, int, int);
-void		check_linepoint(int, int);
-void		check_point(int, int);
-int		checkdefs(void);
-int		compar(const void *, const void *);
 void		delete(LIST *, PLANE *);
-int		dir_deg(int);
 int		dir_no(int);
 void		done_screen(void);
 void		draw_all(void);
-void		draw_line(WINDOW *, int, int, int, int, const char *);
 void		erase_all(void);
 int		getAChar(void);
 int		getcommand(void);
-int		gettoken(void);
 void		init_gr(void);
 void		ioaddstr(int, const char *);
 void		ioclrtobot(void);
 void		ioclrtoeol(int);
 void		ioerror(int, int, const char *);
 void		iomove(int);
-int		list_games(void);
 int		log_score(int);
 void		log_score_quit(int) __dead;
 void		loser(const PLANE *, const char *) __dead;
 int		main(int, char *[]);
 char		name(const PLANE *);
-int		next_plane(void);
-void		noise(void);
 int		number(int);
 void		open_score_file(void);
 void		planewin(void);
-int		pop(void);
-void		push(int, int);
 void		quit(int);
-int		read_file(const char *);
 void		redraw(void);
-void		rezero(void);
 void		setup_screen(const C_SCREEN *);
-int		too_close(const PLANE *p1, const PLANE *p2, int);
 void		update(int);
-int		yyerror(const char *);
 int		yylex(void);
 #ifndef YYEMPTY
 int		yyparse(void);
 #endif
-const char     *Left(int);
-const char     *Right(int);
-const char     *airport(int);
-const char     *beacon(int);
-const char     *benum(int);
-const char     *circle(int);
-const char     *climb(int);
 const char     *command(const PLANE *);
-const char     *default_game(void);
-const char     *delayb(int);
-const char     *descend(int);
-const char     *ex_it(int);
 PLANE	       *findplane(int);
-const char     *ignore(int);
-const char     *left(int);
-const char     *mark(int);
 PLANE	       *newplane(void);
-const char     *okay_game(const char *);
-const char     *rel_dir(int);
-const char     *right(int);
-const char     *setalt(int);
-const char     *setplane(int);
-const char     *setrelalt(int);
-const char     *timestr(int);
-const char     *to_dir(int);
-const char     *turn(int);
-const char     *unmark(int);
Index: src/games/atc/graphics.c
diff -u src/games/atc/graphics.c:1.15 src/games/atc/graphics.c:1.16
--- src/games/atc/graphics.c:1.15	Fri Aug  8 16:10:47 2008
+++ src/games/atc/graphics.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $	*/
+/*	$NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)graphics.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $");
+__RCSID("$NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -60,7 +60,9 @@
 #define C_BEACON		'*'
 #define C_CREDIT		'*'
 
-WINDOW	*radar, *cleanradar, *credit, *input, *planes;
+static void draw_line(WINDOW *, int, int, int, int, const char *);
+
+static WINDOW *radar, *cleanradar, *credit, *input, *planes;
 
 int
 getAChar(void)
@@ -216,7 +218,7 @@
 	(void)fflush(stdout);
 }
 
-void
+static void
 draw_line(WINDOW *w, int x, int y, int lx, int ly, const char *s)
 {
 	int	dx, dy;

Index: src/games/atc/grammar.y
diff -u src/games/atc/grammar.y:1.9 src/games/atc/grammar.y:1.10
--- src/games/atc/grammar.y:1.9	Fri Jul  1 00:48:34 2005
+++ src/games/atc/grammar.y	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: grammar.y,v 1.9 2005/07/01 00:48:34 jmc Exp $	*/
+/*	$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -64,12 +64,15 @@
 #if 0
 static char sccsid[] = "@(#)grammar.y	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: grammar.y,v 1.9 2005/07/01 00:48:34 jmc Exp $");
+__RCSID("$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
-int	errors = 0;
-int	line = 1;
+int line = 1;
+
+static int errors = 0;
+
+static int yyerror(const char *);
 %}
 
 %%
@@ -284,7 +287,7 @@
 	;
 %%
 
-void
+static void
 check_edge(int x, int y)
 {
 	if (!(x == 0) && !(x == sp->width - 1) && 
@@ -292,7 +295,7 @@
 		yyerror("edge value not on edge.");
 }
 
-void
+static void
 check_point(int x, int y)
 {
 	if (x < 1 || x >= sp->width - 1)
@@ -301,7 +304,7 @@
 		yyerror("Y value out of range.");
 }
 
-void
+static void
 check_linepoint(int x, int y)
 {
 	if (x < 0 || x >= sp->width)
@@ -310,7 +313,7 @@
 		yyerror("Y value out of range.");
 }
 
-void
+static void
 check_line(int px1, int py1, int px2, int py2)
 {
 	int	d1, d2;
@@ -325,7 +328,7 @@
 		yyerror("Bad line endpoints.");
 }
 
-int
+static int
 yyerror(const char *s)
 {
 	fprintf(stderr, "\"%s\": line %d: %s\n", filename, line, s);
@@ -334,7 +337,7 @@
 	return (errors);
 }
 
-void
+static void
 check_edir(int x, int y, int dir)
 {
 	int	bad = 0;
@@ -366,7 +369,7 @@
 		yyerror("Bad direction for entrance at exit.");
 }
 
-int
+static int
 checkdefs(void)
 {
 	int	error = 0;

Index: src/games/atc/input.c
diff -u src/games/atc/input.c:1.23 src/games/atc/input.c:1.24
--- src/games/atc/input.c:1.23	Tue May 26 00:00:56 2009
+++ src/games/atc/input.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: input.c,v 1.23 2009/05/26 00:00:56 dholland Exp $	*/
+/*	$NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,13 +46,40 @@
 #if 0
 static char sccsid[] = "@(#)input.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: input.c,v 1.23 2009/05/26 00:00:56 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
 #include "include.h"
 #include "pathnames.h"
 
+static void rezero(void);
+static void noise(void);
+static int gettoken(void);
+static const char *setplane(int);
+static const char *turn(int);
+static const char *circle(int);
+static const char *left(int);
+static const char *right(int);
+static const char *Left(int);
+static const char *Right(int);
+static const char *delayb(int);
+static const char *beacon(int);
+static const char *ex_it(int);
+static const char *airport(int);
+static const char *climb(int);
+static const char *descend(int);
+static const char *setalt(int);
+static const char *setrelalt(int);
+static const char *benum(int);
+static const char *to_dir(int);
+static const char *rel_dir(int);
+static const char *mark(int);
+static const char *unmark(int);
+static const char *ignore(int);
+
+
+
 #define MAXRULES	6
 #define MAXDEPTH	15
 
@@ -93,7 +120,7 @@
 
 #define NUMSTATES	NUMELS(st)
 
-
+static
 RULE	state0[] = {	{ ALPHATOKEN,	1,	"%c:",		setplane},
 			{ RETTOKEN,	-1,	"",		NULL	},
 			{ HELPTOKEN,	12,	" [a-z]<ret>",	NULL	}},
@@ -160,7 +187,7 @@
 
 #define DEF_STATE(s)	{ NUMELS(s),	(s)	}
 
-STATE	st[] = {
+static STATE st[] = {
 	DEF_STATE(state0), DEF_STATE(state1), DEF_STATE(state2),
 	DEF_STATE(state3), DEF_STATE(state4), DEF_STATE(state5),
 	DEF_STATE(state6), DEF_STATE(state7), DEF_STATE(state8),
@@ -168,13 +195,13 @@
 	DEF_STATE(state12)
 };
 
-PLANE	p;
-STACK	stack[MAXDEPTH];
-int	level;
-int	tval;
-int	dest_type, dest_no, dir;
+static PLANE p;
+static STACK stack[MAXDEPTH];
+static int level;
+static int tval;
+static int dest_type, dest_no, dir;
 
-int
+static int
 pop(void)
 {
 	if (level == 0)
@@ -189,7 +216,7 @@
 	return (0);
 }
 
-void
+static void
 rezero(void)
 {
 	iomove(0);
@@ -202,7 +229,7 @@
 	(void)strcpy(T_STR, "");
 }
 
-void
+static void
 push(int ruleno, int ch)
 {
 	int	newstate, newpos;
@@ -286,14 +313,14 @@
 	return (0);
 }
 
-void
+static void
 noise(void)
 {
 	(void)putchar('\07');
 	(void)fflush(stdout);
 }
 
-int
+static int
 gettoken(void)
 {
 	while ((tval = getAChar()) == REDRAWTOKEN || tval == SHELLTOKEN)
@@ -357,7 +384,7 @@
 		return (tval);
 }
 
-const char *
+static const char *
 setplane(int c)
 {
 	PLANE	*pp;
@@ -371,7 +398,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 turn(int c __unused)
 {
 	if (p.altitude == 0)
@@ -380,7 +407,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 circle(int c __unused)
 {
 	if (p.altitude == 0)
@@ -390,7 +417,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 left(int c __unused)
 {
 	dir = D_LEFT;
@@ -401,7 +428,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 right(int c __unused)
 {
 	dir = D_RIGHT;
@@ -412,7 +439,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 Left(int c __unused)
 {
 	p.new_dir = p.dir - 2;
@@ -422,7 +449,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 Right(int c __unused)
 {
 	p.new_dir = p.dir + 2;
@@ -431,7 +458,7 @@
 	return (NULL);
 }
 
-const char *
+static const char *
 delayb(int c)
 {
 	int	xdiff, ydiff;
@@ -476,7 +503,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 beacon(int c __unused)
 {
 	dest_type = T_BEACON;
@@ -484,7 +511,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 ex_it(int c __unused)
 {
 	dest_type = T_EXIT;
@@ -492,7 +519,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 airport(int c __unused)
 {
 	dest_type = T_AIRPORT;
@@ -500,7 +527,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 climb(int c __unused)
 {
 	dir = D_UP;
@@ -508,14 +535,14 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 descend(int c __unused)
 {
 	dir = D_DOWN;
 	return (NULL);
 }
 
-const char *
+static const char *
 setalt(int c)
 {
 	int newalt = c - '0';
@@ -528,7 +555,7 @@
 	return (NULL);
 }
 
-const char *
+static const char *
 setrelalt(int c)
 {
 	int newalt;
@@ -559,7 +586,7 @@
 	return (NULL);
 }
 
-const char *
+static const char *
 benum(int c)
 {
 	dest_no = c -= '0';
@@ -589,14 +616,14 @@
 	return (NULL);
 }
 
-const char *
+static const char *
 to_dir(int c)
 {
 	p.new_dir = dir_no(c);
 	return (NULL);
 }
 
-const char *
+static const char *
 rel_dir(int c)
 {
 	int	angle;
@@ -620,7 +647,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 mark(int c __unused)
 {
 	if (p.altitude == 0)
@@ -632,7 +659,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 unmark(int c __unused)
 {
 	if (p.altitude == 0)
@@ -644,7 +671,7 @@
 }
 
 /* ARGSUSED */
-const char *
+static const char *
 ignore(int c __unused)
 {
 	if (p.altitude == 0)

Index: src/games/atc/log.c
diff -u src/games/atc/log.c:1.20 src/games/atc/log.c:1.21
--- src/games/atc/log.c:1.20	Tue May 26 00:00:56 2009
+++ src/games/atc/log.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.20 2009/05/26 00:00:56 dholland Exp $	*/
+/*	$NetBSD: log.c,v 1.21 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)log.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: log.c,v 1.20 2009/05/26 00:00:56 dholland Exp $");
+__RCSID("$NetBSD: log.c,v 1.21 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,7 +55,7 @@
 
 static FILE *score_fp;
 
-int
+static int
 compar(const void *va, const void *vb)
 {
 	const SCORE	*a, *b;
@@ -78,7 +78,7 @@
 #define MIN(t)		(((t) % SECAHOUR) / SECAMIN)
 #define SEC(t)		((t) % SECAMIN)
 
-const char *
+static const char *
 timestr(int t)
 {
 	static char	s[80];
Index: src/games/atc/update.c
diff -u src/games/atc/update.c:1.20 src/games/atc/update.c:1.21
--- src/games/atc/update.c:1.20	Tue May 26 00:00:56 2009
+++ src/games/atc/update.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: update.c,v 1.20 2009/05/26 00:00:56 dholland Exp $	*/
+/*	$NetBSD: update.c,v 1.21 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,12 +46,16 @@
 #if 0
 static char sccsid[] = "@(#)update.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: update.c,v 1.20 2009/05/26 00:00:56 dholland Exp $");
+__RCSID("$NetBSD: update.c,v 1.21 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
 #include "include.h"
 
+static int next_plane(void);
+static int too_close(const PLANE *p1, const PLANE *p2, int);
+static int dir_deg(int);
+
 /* ARGSUSED */
 void
 update(int dummy __unused)
@@ -274,7 +278,7 @@
 		return (-1);
 }
 
-int
+static int
 next_plane(void)
 {
 	static int	last_plane = -1;
@@ -390,7 +394,7 @@
 	return (NULL);
 }
 
-int
+static int
 too_close(const PLANE *p1, const PLANE *p2, int dist)
 {
 	if (ABS(p1->altitude - p2->altitude) <= dist &&
@@ -401,7 +405,7 @@
 		return (0);
 }
 
-int
+static int
 dir_deg(int d)
 {
 	switch (d) {

Index: src/games/atc/main.c
diff -u src/games/atc/main.c:1.19 src/games/atc/main.c:1.20
--- src/games/atc/main.c:1.19	Sun Jul 20 01:03:20 2008
+++ src/games/atc/main.c	Wed Aug 12 04:48:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.19 2008/07/20 01:03:20 lukem Exp $	*/
+/*	$NetBSD: main.c,v 1.20 2009/08/12 04:48:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -51,7 +51,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.19 2008/07/20 01:03:20 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2009/08/12 04:48:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -60,6 +60,11 @@
 
 extern FILE	*yyin;
 
+static int read_file(const char *);
+static const char *default_game(void);
+static const char *okay_game(const char *);
+static int list_games(void);
+
 int
 main(int argc, char *argv[])
 {
@@ -204,7 +209,7 @@
 	}
 }
 
-int
+static int
 read_file(const char *s)
 {
 	int		retval;
@@ -224,7 +229,7 @@
 		return (0);
 }
 
-const char *
+static const char *
 default_game(void)
 {
 	FILE		*fp;
@@ -250,7 +255,7 @@
 	return (file);
 }
 
-const char *
+static const char *
 okay_game(const char *s)
 {
 	FILE		*fp;
@@ -285,7 +290,7 @@
 	return (ret);
 }
 
-int
+static int
 list_games(void)
 {
 	FILE		*fp;

Reply via email to