Module Name: src
Committed By: dholland
Date: Wed Aug 12 08:30:55 UTC 2009
Modified Files:
src/games/robots: main.c move.c rnd_pos.c robots.h score.c
Log Message:
sprinkle static
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/games/robots/main.c
cvs rdiff -u -r1.15 -r1.16 src/games/robots/move.c
cvs rdiff -u -r1.9 -r1.10 src/games/robots/rnd_pos.c
cvs rdiff -u -r1.21 -r1.22 src/games/robots/robots.h
cvs rdiff -u -r1.22 -r1.23 src/games/robots/score.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/robots/main.c
diff -u src/games/robots/main.c:1.31 src/games/robots/main.c:1.32
--- src/games/robots/main.c:1.31 Wed Aug 5 19:34:09 2009
+++ src/games/robots/main.c Wed Aug 12 08:30:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.31 2009/08/05 19:34:09 christos Exp $ */
+/* $NetBSD: main.c,v 1.32 2009/08/12 08:30:55 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.31 2009/08/05 19:34:09 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.32 2009/08/12 08:30:55 dholland Exp $");
#endif
#endif /* not lint */
@@ -57,6 +57,8 @@
extern const char *Scorefile;
extern int Max_per_uid;
+static bool another(void);
+
int
main(int argc, char **argv)
{
@@ -210,7 +212,7 @@
* another:
* See if another game is desired
*/
-bool
+static bool
another(void)
{
int y;
Index: src/games/robots/move.c
diff -u src/games/robots/move.c:1.15 src/games/robots/move.c:1.16
--- src/games/robots/move.c:1.15 Mon Jul 20 06:39:06 2009
+++ src/games/robots/move.c Wed Aug 12 08:30:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.15 2009/07/20 06:39:06 dholland Exp $ */
+/* $NetBSD: move.c,v 1.16 2009/08/12 08:30:55 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.15 2009/07/20 06:39:06 dholland Exp $");
+__RCSID("$NetBSD: move.c,v 1.16 2009/08/12 08:30:55 dholland Exp $");
#endif
#endif /* not lint */
@@ -47,6 +47,10 @@
#define ESC '\033'
+static bool do_move(int, int);
+static bool eaten(const COORD *);
+static bool must_telep(void);
+
/*
* get_move:
* Get and execute a move from the player
@@ -212,7 +216,7 @@
* Must I teleport; i.e., is there anywhere I can move without
* being eaten?
*/
-bool
+static bool
must_telep(void)
{
int x, y;
@@ -244,7 +248,7 @@
* do_move:
* Execute a move
*/
-bool
+static bool
do_move(int dy, int dx)
{
static COORD newpos;
@@ -280,7 +284,7 @@
* eaten:
* Player would get eaten at this place
*/
-bool
+static bool
eaten(const COORD *pos)
{
int x, y;
Index: src/games/robots/rnd_pos.c
diff -u src/games/robots/rnd_pos.c:1.9 src/games/robots/rnd_pos.c:1.10
--- src/games/robots/rnd_pos.c:1.9 Mon Jul 20 06:43:18 2009
+++ src/games/robots/rnd_pos.c Wed Aug 12 08:30:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: rnd_pos.c,v 1.9 2009/07/20 06:43:18 dholland Exp $ */
+/* $NetBSD: rnd_pos.c,v 1.10 2009/08/12 08:30:55 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)rnd_pos.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: rnd_pos.c,v 1.9 2009/07/20 06:43:18 dholland Exp $");
+__RCSID("$NetBSD: rnd_pos.c,v 1.10 2009/08/12 08:30:55 dholland Exp $");
#endif
#endif /* not lint */
@@ -44,6 +44,8 @@
#define IS_SAME(p,y,x) ((p).y != -1 && (p).y == y && (p).x == x)
+static int rnd(int);
+
/*
* rnd_pos:
* Pick a random, unoccupied position
@@ -63,7 +65,7 @@
return &pos;
}
-int
+static int
rnd(int range)
{
Index: src/games/robots/robots.h
diff -u src/games/robots/robots.h:1.21 src/games/robots/robots.h:1.22
--- src/games/robots/robots.h:1.21 Mon Jul 20 06:39:06 2009
+++ src/games/robots/robots.h Wed Aug 12 08:30:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: robots.h,v 1.21 2009/07/20 06:39:06 dholland Exp $ */
+/* $NetBSD: robots.h,v 1.22 2009/08/12 08:30:55 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -110,26 +110,19 @@
*/
void add_score(int);
-bool another(void);
char automove(void);
-int cmp_sc(const void *, const void *);
-bool do_move(int, int);
-bool eaten(const COORD *);
void flush_in(void);
void get_move(void);
void init_field(void);
bool jumping(void);
void make_level(void);
void move_robots(int);
-bool must_telep(void);
void play_level(void);
int query(const char *);
void quit(int) __dead;
void reset_count(void);
-int rnd(int);
COORD *rnd_pos(void);
void score(int);
-void set_name(SCORE *);
void show_score(void);
int sign(int);
void telmsg(int);
Index: src/games/robots/score.c
diff -u src/games/robots/score.c:1.22 src/games/robots/score.c:1.23
--- src/games/robots/score.c:1.22 Mon Aug 3 06:04:12 2009
+++ src/games/robots/score.c Wed Aug 12 08:30:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.22 2009/08/03 06:04:12 dholland Exp $ */
+/* $NetBSD: score.c,v 1.23 2009/08/12 08:30:55 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.22 2009/08/03 06:04:12 dholland Exp $");
+__RCSID("$NetBSD: score.c,v 1.23 2009/08/12 08:30:55 dholland Exp $");
#endif
#endif /* not lint */
@@ -57,6 +57,9 @@
static uint32_t numscores, max_uid;
+static int cmp_sc(const void *, const void *);
+static void set_name(SCORE *);
+
/*
* read_score:
* Read the score file in MI format
@@ -189,7 +192,7 @@
lseek(inf, 0, SEEK_SET);
}
-void
+static void
set_name(SCORE *scp)
{
struct passwd *pp;
@@ -204,7 +207,7 @@
* cmp_sc:
* Compare two scores.
*/
-int
+static int
cmp_sc(const void *s1, const void *s2)
{
return ((const SCORE *)s2)->s_score - ((const SCORE *)s1)->s_score;