From e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9 Mon Sep 17 00:00:00 2001 From: dholland Date: Wed, 12 Aug 2009 05:17:57 +0000 Subject: sprinkle static --- backgammon/backgammon/backlocal.h | 7 +------ backgammon/backgammon/extra.c | 8 +++++--- backgammon/backgammon/main.c | 8 ++++---- backgammon/backgammon/move.c | 20 ++++++++++++-------- 4 files changed, 22 insertions(+), 21 deletions(-) (limited to 'backgammon/backgammon') diff --git a/backgammon/backgammon/backlocal.h b/backgammon/backgammon/backlocal.h index 572eeab5..ae9a78b4 100644 --- a/backgammon/backgammon/backlocal.h +++ b/backgammon/backgammon/backlocal.h @@ -1,4 +1,4 @@ -/* $NetBSD: backlocal.h,v 1.3 2008/04/28 20:22:53 martin Exp $ */ +/* $NetBSD: backlocal.h,v 1.4 2009/08/12 05:17:57 dholland Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,11 +31,6 @@ void dble(void); int dblgood(void); -int eval(void); int freemen(int); -void movcmp(void); void move(int); -int movegood(void); -void pickmove(void); int trapped(int, int); -void trymove(int, int); diff --git a/backgammon/backgammon/extra.c b/backgammon/backgammon/extra.c index 4b932568..2297f337 100644 --- a/backgammon/backgammon/extra.c +++ b/backgammon/backgammon/extra.c @@ -1,4 +1,4 @@ -/* $NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $ */ +/* $NetBSD: extra.c,v 1.7 2009/08/12 05:17:57 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)extra.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $"); +__RCSID("$NetBSD: extra.c,v 1.7 2009/08/12 05:17:57 dholland Exp $"); #endif #endif /* not lint */ @@ -45,6 +45,8 @@ __RCSID("$NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $"); FILE *trace; #endif +static int eval(void); + /* * dble() * Have the current player double and ask opponent to accept. @@ -231,7 +233,7 @@ trapped(int n, int inc) return (ct / 5); } -int +static int eval(void) { int i, j; diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c index cd762296..a68c67ad 100644 --- a/backgammon/backgammon/main.c +++ b/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.26 2009/08/12 04:51:11 dholland Exp $ */ +/* $NetBSD: main.c,v 1.27 2009/08/12 05:17:57 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.26 2009/08/12 04:51:11 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.27 2009/08/12 05:17:57 dholland Exp $"); #endif #endif /* not lint */ @@ -54,14 +54,14 @@ extern const char *const instr[]; /* text of instructions */ extern const char *const message[]; /* update message */ extern short ospeed; /* tty output speed */ -const char *const helpm[] = { /* help message */ +static const char *const helpm[] = { /* help message */ "Enter a space or newline to roll, or", " R to reprint the board\tD to double", " S to save the game\tQ to quit", 0 }; -const char *const contin[] = { /* pause message */ +static const char *const contin[] = { /* pause message */ "(Type a newline to continue.)", "", 0 diff --git a/backgammon/backgammon/move.c b/backgammon/backgammon/move.c index 2ee0a34f..e04b71ed 100644 --- a/backgammon/backgammon/move.c +++ b/backgammon/backgammon/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.9 2005/07/01 01:12:39 jmc Exp $ */ +/* $NetBSD: move.c,v 1.10 2009/08/12 05:17:57 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.9 2005/07/01 01:12:39 jmc Exp $"); +__RCSID("$NetBSD: move.c,v 1.10 2009/08/12 05:17:57 dholland Exp $"); #endif #endif /* not lint */ @@ -55,8 +55,8 @@ struct BOARD { /* structure of game position */ struct BOARD *b_next; /* forward queue pointer */ }; -struct BOARD *freeq = 0; -struct BOARD *checkq = 0; +static struct BOARD *freeq = 0; +static struct BOARD *checkq = 0; /* these variables are values for the candidate move */ static int ch; /* chance of being hit */ @@ -90,6 +90,10 @@ static void boardcopy(struct BOARD *); static void makefree(struct BOARD *); static void mvcheck(struct BOARD *, struct BOARD *); static struct BOARD *nextfree(void); +static void trymove(int, int); +static void pickmove(void); +static void movcmp(void); +static int movegood(void); /* zero if first move */ @@ -183,7 +187,7 @@ move(int okay) /* mvnum == number of move (rel zero) */ /* swapped == see if swapped also tested */ -void +static void trymove(int mvnum, int swapped) { int pos; /* position on board */ @@ -361,7 +365,7 @@ nextfree(void) return (new); } -void +static void pickmove(void) { /* current game position */ @@ -402,7 +406,7 @@ boardcopy(struct BOARD *s) } } -void +static void movcmp(void) { int i; @@ -476,7 +480,7 @@ movcmp(void) #endif } -int +static int movegood(void) { int n; -- cgit v1.2.3-56-ge451