Module Name:    src
Committed By:   dholland
Date:           Wed Aug 12 08:48:15 UTC 2009

Modified Files:
        src/games/snake/snake: snake.c

Log Message:
sprinkle static


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/games/snake/snake/snake.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/snake/snake/snake.c
diff -u src/games/snake/snake/snake.c:1.25 src/games/snake/snake/snake.c:1.26
--- src/games/snake/snake/snake.c:1.25	Fri Aug  8 16:10:47 2008
+++ src/games/snake/snake/snake.c	Wed Aug 12 08:48:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: snake.c,v 1.25 2008/08/08 16:10:47 drochner Exp $	*/
+/*	$NetBSD: snake.c,v 1.26 2009/08/12 08:48:15 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)snake.c	8.2 (Berkeley) 1/7/94";
 #else
-__RCSID("$NetBSD: snake.c,v 1.25 2008/08/08 16:10:47 drochner Exp $");
+__RCSID("$NetBSD: snake.c,v 1.26 2009/08/12 08:48:15 dholland Exp $");
 #endif
 #endif				/* not lint */
 
@@ -99,44 +99,43 @@
 #define pchar(point, c)	mvaddch((point)->line + 1, (point)->col + 1, (c))
 #define delay(t)	usleep(t * 50000);
 
-struct point you;
-struct point money;
-struct point finish;
-struct point snake[6];
-
-int     loot, penalty;
-int     moves;
-int     fast = 1;
-
-int rawscores;
-FILE *logfile;
-
-int	lcnt, ccnt;	/* user's idea of screen size */
-int	chunk;		/* amount of money given at a time */
-
-void		chase(struct point *, struct point *);
-int		chk(const struct point *);
-void		drawbox(void);
-void		flushi(void);
-void		home(void);
-void		length(int);
-void		logit(const char *);
+static struct point you;
+static struct point money;
+static struct point finish;
+static struct point snake[6];
+
+static int loot, penalty;
+static int moves;
+static int fast = 1;
+
+static int rawscores;
+static FILE *logfile;
+
+static int lcnt, ccnt;		/* user's idea of screen size */
+static int chunk;		/* amount of money given at a time */
+
+static void chase(struct point *, struct point *);
+static int chk(const struct point *);
+static void drawbox(void);
+static void flushi(void);
+static void length(int);
+static void logit(const char *);
+static void mainloop(void) __dead;
+static struct point *point(struct point *, int, int);
+static int post(int, int);
+static int pushsnake(void);
+static void setup(void);
+static void snap(void);
+static void snrand(struct point *);
+static void spacewarp(int);
+static void stop(int) __dead;
+static int stretch(const struct point *);
+static void surround(struct point *);
+static void suspend(void);
+static void win(const struct point *);
+static void winnings(int);
+
 int		main(int, char **);
-void		mainloop(void) __dead;
-struct point   *point(struct point *, int, int);
-int		post(int, int);
-int		pushsnake(void);
-void		right(const struct point *);
-void		setup(void);
-void		snap(void);
-void		snrand(struct point *);
-void		spacewarp(int);
-void		stop(int) __dead;
-int		stretch(const struct point *);
-void		surround(struct point *);
-void		suspend(void);
-void		win(const struct point *);
-void		winnings(int);
 
 int
 main(argc, argv)
@@ -247,7 +246,7 @@
 	return (0);
 }
 
-struct point *
+static struct point *
 point(ps, x, y)
 	struct point *ps;
 	int     x, y;
@@ -258,7 +257,7 @@
 }
 
 /* Main command loop */
-void
+static void
 mainloop()
 {
 	int     k;
@@ -447,7 +446,7 @@
 /*
  * setup the board
  */
-void
+static void
 setup()
 {
 	int     i;
@@ -464,7 +463,7 @@
 	refresh();
 }
 
-void
+static void
 drawbox()
 {
 	int i;
@@ -479,7 +478,7 @@
 	}
 }
 
-void
+static void
 snrand(sp)
 	struct point *sp;
 {
@@ -509,7 +508,7 @@
 	*sp = p;
 }
 
-int
+static int
 post(iscore, flag)
 	int     iscore, flag;
 {
@@ -584,24 +583,24 @@
  * overshooting.  This loses horribly at 9600 baud, but works nicely
  * if the terminal gets behind.
  */
-void
+static void
 flushi()
 {
 	tcflush(0, TCIFLUSH);
 }
 
-const int     mx[8] = {
+static const int mx[8] = {
 	0, 1, 1, 1, 0, -1, -1, -1
 };
-const int     my[8] = {
+static const int my[8] = {
 	-1, -1, 0, 1, 1, 1, 0, -1
 };
-const float   absv[8] = {
+static const float absv[8] = {
 	1, 1.4, 1, 1.4, 1, 1.4, 1, 1.4
 };
-int     oldw = 0;
+static int oldw = 0;
 
-void
+static void
 chase(np, sp)
 	struct point *sp, *np;
 {
@@ -663,7 +662,7 @@
 	point(np, sp->col + mx[w], sp->line + my[w]);
 }
 
-void
+static void
 spacewarp(w)
 	int     w;
 {
@@ -697,7 +696,7 @@
 	winnings(cashvalue);
 }
 
-void
+static void
 snap()
 {
 #if 0 /* This code doesn't really make sense.  */
@@ -744,7 +743,7 @@
 	refresh();
 }
 
-int
+static int
 stretch(ps)
 	const struct point *ps;
 {
@@ -792,7 +791,7 @@
 	return (0);
 }
 
-void
+static void
 surround(ps)
 	struct point *ps;
 {
@@ -836,7 +835,7 @@
 	delay(6);
 }
 
-void
+static void
 win(ps)
 	const struct point *ps;
 {
@@ -869,7 +868,7 @@
 	}
 }
 
-int
+static int
 pushsnake()
 {
 	int     i, bonus;
@@ -926,7 +925,7 @@
 	return (0);
 }
 
-int
+static int
 chk(sp)
 	const struct point *sp;
 {
@@ -964,7 +963,7 @@
 	return (0);
 }
 
-void
+static void
 winnings(won)
 	int     won;
 {
@@ -973,7 +972,7 @@
 	}
 }
 
-void
+static void
 stop(dummy)
 	int dummy __unused;
 {
@@ -983,7 +982,7 @@
 	exit(0);
 }
 
-void
+static void
 suspend()
 {
 	endwin();
@@ -992,14 +991,14 @@
 	winnings(cashvalue);
 }
 
-void
+static void
 length(num)
 	int     num;
 {
 	printf("You made %d moves.\n", num);
 }
 
-void
+static void
 logit(msg)
 	const char   *msg;
 {

Reply via email to