From 4fa17c6f9afc7c76d0350d5d9e5996391aa18137 Mon Sep 17 00:00:00 2001 From: dholland Date: Wed, 12 Aug 2009 08:21:41 +0000 Subject: sprinkle static --- robots/main.c | 8 +++++--- robots/move.c | 14 +++++++++----- robots/rnd_pos.c | 8 +++++--- robots/robots.h | 9 +-------- robots/score.c | 11 +++++++---- 5 files changed, 27 insertions(+), 23 deletions(-) (limited to 'robots') diff --git a/robots/main.c b/robots/main.c index a57cd0dd..7a38b3d0 100644 --- a/robots/main.c +++ b/robots/main.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #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 @@ __RCSID("$NetBSD: main.c,v 1.31 2009/08/05 19:34:09 christos Exp $"); extern const char *Scorefile; extern int Max_per_uid; +static bool another(void); + int main(int argc, char **argv) { @@ -210,7 +212,7 @@ quit(int dummy __unused) * another: * See if another game is desired */ -bool +static bool another(void) { int y; diff --git a/robots/move.c b/robots/move.c index 443fdde3..3b13d1f8 100644 --- a/robots/move.c +++ b/robots/move.c @@ -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 @@ __RCSID("$NetBSD: move.c,v 1.15 2009/07/20 06:39:06 dholland Exp $"); #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 @@ ret: * 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 @@ must_telep(void) * do_move: * Execute a move */ -bool +static bool do_move(int dy, int dx) { static COORD newpos; @@ -280,7 +284,7 @@ do_move(int dy, int dx) * eaten: * Player would get eaten at this place */ -bool +static bool eaten(const COORD *pos) { int x, y; diff --git a/robots/rnd_pos.c b/robots/rnd_pos.c index 65baea60..5fe2cc04 100644 --- a/robots/rnd_pos.c +++ b/robots/rnd_pos.c @@ -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 @@ __RCSID("$NetBSD: rnd_pos.c,v 1.9 2009/07/20 06:43:18 dholland Exp $"); #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 @@ rnd_pos(void) return &pos; } -int +static int rnd(int range) { diff --git a/robots/robots.h b/robots/robots.h index 1da54fd4..9c4f41f0 100644 --- a/robots/robots.h +++ b/robots/robots.h @@ -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 @@ extern jmp_buf End_move; */ 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); diff --git a/robots/score.c b/robots/score.c index f23bdc42..5ae9083a 100644 --- a/robots/score.c +++ b/robots/score.c @@ -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 SCORE Top[MAXSCORES]; 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 @@ score(int score_wfd) lseek(inf, 0, SEEK_SET); } -void +static void set_name(SCORE *scp) { struct passwd *pp; @@ -204,7 +207,7 @@ set_name(SCORE *scp) * 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; -- cgit v1.2.3-56-ge451