Module Name: src
Committed By: dholland
Date: Wed Aug 12 05:17:58 UTC 2009
Modified Files:
src/games/backgammon/backgammon: backlocal.h extra.c main.c move.c
src/games/backgammon/common_source: back.h board.c fancy.c one.c save.c
subs.c table.c
src/games/backgammon/teachgammon: data.c teach.c tutor.c tutor.h
Log Message:
sprinkle static
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/games/backgammon/backgammon/backlocal.h
cvs rdiff -u -r1.6 -r1.7 src/games/backgammon/backgammon/extra.c
cvs rdiff -u -r1.26 -r1.27 src/games/backgammon/backgammon/main.c
cvs rdiff -u -r1.9 -r1.10 src/games/backgammon/backgammon/move.c
cvs rdiff -u -r1.15 -r1.16 src/games/backgammon/common_source/back.h
cvs rdiff -u -r1.8 -r1.9 src/games/backgammon/common_source/board.c
cvs rdiff -u -r1.13 -r1.14 src/games/backgammon/common_source/fancy.c
cvs rdiff -u -r1.6 -r1.7 src/games/backgammon/common_source/one.c
cvs rdiff -u -r1.12 -r1.13 src/games/backgammon/common_source/save.c
cvs rdiff -u -r1.16 -r1.17 src/games/backgammon/common_source/subs.c
cvs rdiff -u -r1.9 -r1.10 src/games/backgammon/common_source/table.c
cvs rdiff -u -r1.7 -r1.8 src/games/backgammon/teachgammon/data.c \
src/games/backgammon/teachgammon/tutor.c
cvs rdiff -u -r1.19 -r1.20 src/games/backgammon/teachgammon/teach.c
cvs rdiff -u -r1.8 -r1.9 src/games/backgammon/teachgammon/tutor.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/backgammon/backgammon/backlocal.h
diff -u src/games/backgammon/backgammon/backlocal.h:1.3 src/games/backgammon/backgammon/backlocal.h:1.4
--- src/games/backgammon/backgammon/backlocal.h:1.3 Mon Apr 28 20:22:53 2008
+++ src/games/backgammon/backgammon/backlocal.h Wed Aug 12 05:17:57 2009
@@ -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);
Index: src/games/backgammon/backgammon/extra.c
diff -u src/games/backgammon/backgammon/extra.c:1.6 src/games/backgammon/backgammon/extra.c:1.7
--- src/games/backgammon/backgammon/extra.c:1.6 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/backgammon/extra.c Wed Aug 12 05:17:57 2009
@@ -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 @@
FILE *trace;
#endif
+static int eval(void);
+
/*
* dble()
* Have the current player double and ask opponent to accept.
@@ -231,7 +233,7 @@
return (ct / 5);
}
-int
+static int
eval(void)
{
int i, j;
Index: src/games/backgammon/backgammon/main.c
diff -u src/games/backgammon/backgammon/main.c:1.26 src/games/backgammon/backgammon/main.c:1.27
--- src/games/backgammon/backgammon/main.c:1.26 Wed Aug 12 04:51:11 2009
+++ src/games/backgammon/backgammon/main.c Wed Aug 12 05:17:57 2009
@@ -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 @@
#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 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
Index: src/games/backgammon/backgammon/move.c
diff -u src/games/backgammon/backgammon/move.c:1.9 src/games/backgammon/backgammon/move.c:1.10
--- src/games/backgammon/backgammon/move.c:1.9 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/backgammon/move.c Wed Aug 12 05:17:57 2009
@@ -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 *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 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 @@
/* 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 @@
return (new);
}
-void
+static void
pickmove(void)
{
/* current game position */
@@ -402,7 +406,7 @@
}
}
-void
+static void
movcmp(void)
{
int i;
@@ -476,7 +480,7 @@
#endif
}
-int
+static int
movegood(void)
{
int n;
Index: src/games/backgammon/common_source/back.h
diff -u src/games/backgammon/common_source/back.h:1.15 src/games/backgammon/common_source/back.h:1.16
--- src/games/backgammon/common_source/back.h:1.15 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/common_source/back.h Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: back.h,v 1.15 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: back.h,v 1.16 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -131,22 +131,17 @@
int addbuf(int);
void backone(int);
-void bsect(int, int, int, int);
void buflush(void);
int canhit(int, int);
-int checkd(int);
int checkmove(int);
void clear(void);
void clend(void);
void cline(void);
int count(void);
void curmove(int, int);
-int dotable(int, int);
void errexit(const char *) __attribute__((__noreturn__));
void fancyc(int);
void fboard(void);
-void fixcol(int, int, int, int, int);
-void fixpos(int, int, int, int, int);
void fixtty(struct termios *);
void getarg(char ***);
int getcaps(const char *);
@@ -154,17 +149,14 @@
void getout(int) __attribute__((__noreturn__));
void gwrite(void);
void init(void);
-int last(void);
int main(int, char *[]);
int makmove(int);
int movallow(void);
void movback(int);
void moverr(int);
int movokay(int);
-void newline(void);
void newpos(void);
void nexturn(void);
-void norec(const char *) __attribute__((__noreturn__));
void odds(int, int, int);
void proll(void);
int quit(void);
@@ -172,11 +164,9 @@
void recover(const char *);
void refresh(void);
void roll(void);
-int rsetbrd(void);
void save(int);
int text(const char *const *);
void wrboard(void);
-void wrbsub(void);
void wrhit(int);
void wrint(int);
void writec(int);
Index: src/games/backgammon/common_source/board.c
diff -u src/games/backgammon/common_source/board.c:1.8 src/games/backgammon/common_source/board.c:1.9
--- src/games/backgammon/common_source/board.c:1.8 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/common_source/board.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: board.c,v 1.8 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: board.c,v 1.9 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: board.c,v 1.8 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: board.c,v 1.9 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -43,6 +43,8 @@
static int i, j, k;
static char ln[60];
+static void wrbsub(void);
+
void
wrboard(void)
{
@@ -160,7 +162,7 @@
fixtty(&raw);
}
-void
+static void
wrbsub(void)
{
int m;
Index: src/games/backgammon/common_source/fancy.c
diff -u src/games/backgammon/common_source/fancy.c:1.13 src/games/backgammon/common_source/fancy.c:1.14
--- src/games/backgammon/common_source/fancy.c:1.13 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/common_source/fancy.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fancy.c,v 1.13 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,12 +34,24 @@
#if 0
static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fancy.c,v 1.13 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
+static void bsect(int, int, int, int);
+static void fixpos(int, int, int, int, int);
+static void fixcol(int, int, int, int, int);
+static void newline(void);
+
+/*
+ * These need to be declared so they come out as commons, because
+ * termcap might or might not define some of them. Our termcap defines
+ * PC, BC, and UP only. This is gross.
+ *
+ * XXX: rewrite this crap using curses.
+ */
char PC; /* padding character */
char *BC; /* backspace sequence */
char *CD; /* clear to end of screen sequence */
@@ -52,33 +64,33 @@
char *ND; /* forward cursor sequence */
char *UP; /* up cursor sequence */
-int lHO; /* length of HO */
-int lBC; /* length of BC */
-int lND; /* length of ND */
-int lUP; /* length of UP */
-int CO; /* number of columns */
-int LI; /* number of lines */
-int *linect; /* array of lengths of lines on screen (the
+static int lHO; /* length of HO */
+static int lBC; /* length of BC */
+static int lND; /* length of ND */
+static int lUP; /* length of UP */
+static int CO; /* number of columns */
+static int LI; /* number of lines */
+static int *linect; /* array of lengths of lines on screen (the
* actual screen is not stored) */
/* two letter codes */
-char tcap[] = "bccdceclcmhomcmlndup";
+static char tcap[] = "bccdceclcmhomcmlndup";
/* corresponding strings */
-char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
+static char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
int buffnum; /* pointer to output buffer */
-char tbuf[1024]; /* buffer for decoded termcap entries */
+static char tbuf[1024]; /* buffer for decoded termcap entries */
-int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0};
+static int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0};
-int oldr;
-int oldw;
+static int oldr;
+static int oldw;
/* "real" cursor positions, so it knows when to reposition. These are -1 if
* curr and curc are accurate */
-int realr;
-int realc;
+static int realr;
+static int realc;
void
fboard(void)
@@ -187,7 +199,7 @@
* to see if the position is a player's home, since those are printed
* differently.
*/
-void
+static void
bsect(int b, int rpos, int cpos, int cnext)
{
int j; /* index */
@@ -294,7 +306,7 @@
buflush();
}
-void
+static void
fixpos(int cur, int new, int r, int c, int inc)
{
int o, n, nv;
@@ -380,7 +392,7 @@
fixcol(r + inc * new, c + 1, abs(cur + new), ' ', inc);
}
-void
+static void
fixcol(int r, int c, int l, int ch, int inc)
{
int i;
@@ -683,7 +695,7 @@
}
}
-void
+static void
newline(void)
{
cline();
Index: src/games/backgammon/common_source/one.c
diff -u src/games/backgammon/common_source/one.c:1.6 src/games/backgammon/common_source/one.c:1.7
--- src/games/backgammon/common_source/one.c:1.6 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/common_source/one.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: one.c,v 1.6 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: one.c,v 1.7 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,12 +34,15 @@
#if 0
static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: one.c,v 1.6 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: one.c,v 1.7 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
+static int checkd(int);
+static int last(void);
+
int
makmove(int i)
{
@@ -115,7 +118,7 @@
}
-int
+static int
checkd(int d)
{
if (d0 != d)
@@ -123,7 +126,7 @@
return (0);
}
-int
+static int
last(void)
{
int i;
Index: src/games/backgammon/common_source/save.c
diff -u src/games/backgammon/common_source/save.c:1.12 src/games/backgammon/common_source/save.c:1.13
--- src/games/backgammon/common_source/save.c:1.12 Sat Mar 18 23:25:30 2006
+++ src/games/backgammon/common_source/save.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.12 2006/03/18 23:25:30 christos Exp $ */
+/* $NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.12 2006/03/18 23:25:30 christos Exp $");
+__RCSID("$NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -53,6 +53,8 @@
static const char rec[] = "\" to recover your game.\n\n";
static const char cantrec[] = "Can't recover file: ";
+static void norec(const char *) __attribute__((__noreturn__));
+
void
save(int n)
{
@@ -164,7 +166,7 @@
rflag = 1;
}
-void
+static void
norec(const char *s)
{
const char *c;
Index: src/games/backgammon/common_source/subs.c
diff -u src/games/backgammon/common_source/subs.c:1.16 src/games/backgammon/common_source/subs.c:1.17
--- src/games/backgammon/common_source/subs.c:1.16 Sat Dec 15 19:44:39 2007
+++ src/games/backgammon/common_source/subs.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: subs.c,v 1.16 2007/12/15 19:44:39 perry Exp $ */
+/* $NetBSD: subs.c,v 1.17 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,20 +34,20 @@
#if 0
static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subs.c,v 1.16 2007/12/15 19:44:39 perry Exp $");
+__RCSID("$NetBSD: subs.c,v 1.17 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
int buffnum;
-char outbuff[BUFSIZ];
+static char outbuff[BUFSIZ];
static const char plred[] = "Player is red, computer is white.";
static const char plwhite[] = "Player is white, computer is red.";
static const char nocomp[] = "(No computer play.)";
-const char *const descr[] = {
+static const char *const descr[] = {
"Usage: backgammon [-] [n r w b pr pw pb t3a]\n",
"\t-\tgets this list\n\tn\tdon't ask for rules or instructions",
"\tr\tplayer is red (implies n)\n\tw\tplayer is white (implies n)",
Index: src/games/backgammon/common_source/table.c
diff -u src/games/backgammon/common_source/table.c:1.9 src/games/backgammon/common_source/table.c:1.10
--- src/games/backgammon/common_source/table.c:1.9 Sat Mar 18 23:23:33 2006
+++ src/games/backgammon/common_source/table.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $ */
+/* $NetBSD: table.c,v 1.10 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,13 +34,13 @@
#if 0
static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $");
+__RCSID("$NetBSD: table.c,v 1.10 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
-const char *const help2[] = {
+static const char *const help2[] = {
" Enter moves as <s>-<f> or <s>/<r> where <s> is the starting",
"position, <f> is the finishing position, and <r> is the roll.",
"Remember, each die roll must be moved separately.",
@@ -77,6 +77,9 @@
{'\n', 0, -1}, {'.', 0, 0}
};
+static int dotable(int, int);
+static int rsetbrd(void);
+
int
checkmove(int ist)
{
@@ -194,7 +197,7 @@
goto dochar;
}
-int
+static int
dotable(int c, int i)
{
int a;
@@ -288,7 +291,7 @@
return (-5);
}
-int
+static int
rsetbrd(void)
{
int i, j, n;
Index: src/games/backgammon/teachgammon/data.c
diff -u src/games/backgammon/teachgammon/data.c:1.7 src/games/backgammon/teachgammon/data.c:1.8
--- src/games/backgammon/teachgammon/data.c:1.7 Thu Jan 1 15:59:09 2004
+++ src/games/backgammon/teachgammon/data.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $ */
+/* $NetBSD: data.c,v 1.8 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $");
+__RCSID("$NetBSD: data.c,v 1.8 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -42,7 +42,7 @@
int maxmoves = 23;
-const char *const text0[] = {
+static const char *const text0[] = {
"To start the game, I roll a 3, and you roll a 1. This means",
"that I get to start first. I move 8-5,6-5 since this makes a",
"new point and helps to trap your back men on 1. You should be",
@@ -50,7 +50,7 @@
0
};
-const char *const text1[] = {
+static const char *const text1[] = {
"Now you shall see a move using doubles. I just rolled double",
"5's. I will move two men from position 13 to position 3. The",
"notation for this is 13-8,13-8,8-3,8-3. You will also roll dou-",
@@ -58,7 +58,7 @@
0
};
-const char *const text2[] = {
+static const char *const text2[] = {
"Excellent! As you can see, you are beginning to develop a wall",
"which is trapping my men on position 24. Also, moving your back",
"men forward not only improves your board position safely, but it",
@@ -71,7 +71,7 @@
0
};
-const char *const text3[] = {
+static const char *const text3[] = {
"As you can see, although you left a man open, it is a rela-",
"tively safe move to an advantageous position, which might help",
"you make a point later. Only two rolls (4 5 or 5 4) will allow",
@@ -80,13 +80,13 @@
0
};
-const char *const text4[] = {
+static const char *const text4[] = {
"You're pretty lucky yourself, you know. I follow by rolling 2 3",
"and moving 25-22,24-22, forming a new point.",
0
};
-const char *const text5[] = {
+static const char *const text5[] = {
"Not a spectacular move, but a safe one. I follow by rolling 6 1.",
"I decide to use this roll to move 22-16,16-15. It leaves me with",
"one man still open, but the blot is farther back on the board, and",
@@ -94,7 +94,7 @@
0
};
-const char *const text6[] = {
+static const char *const text6[] = {
"By moving your two men from 17 to 20, you lessen my chance of",
"getting my man off the board. In fact, the odds are 5 to 4",
"against me getting off. I roll with the odds and helplessly",
@@ -102,7 +102,7 @@
0
};
-const char *const text7[] = {
+static const char *const text7[] = {
"Note that the blot on 7 cannot be hit unless I get off the bar",
"and have a 1 or a 6 left over, and doing so will leave two of",
"my men open. Also, the blot on 16 cannot be hit at all! With",
@@ -110,27 +110,27 @@
0
};
-const char *const text8[] = {
+static const char *const text8[] = {
"See, you did not get hit and, you got to 'cover up' your open men.",
"Quite an accomplishment. Finally, I get off the bar by rolling",
"6 2 and moving 25-23,23-17.",
0
};
-const char *const text9[] = {
+static const char *const text9[] = {
"My venture off the bar did not last long. However, I got lucky",
"and rolled double 1's, allowing me to move 25-24,24-23,15-14,15-14.",
0
};
-const char *const text10[] = {
+static const char *const text10[] = {
"You are improving your position greatly and safely, and are well",
"on the way to winning the game. I roll a 6 2 and squeak past",
"your back man. Now the game becomes a race to the finish.",
0
};
-const char *const text11[] = {
+static const char *const text11[] = {
"Now that it is merely a race, you are trying to get as many men",
"as possible into the inner table, so you can start removing them.",
"I roll a 3 4 and move my two men farthest back to position 11",
@@ -138,20 +138,20 @@
0
};
-const char *const text12[] = {
+static const char *const text12[] = {
"The race is still on, and you have seem to be doing all right.",
"I roll 6 1 and move 14-8,13-12.",
0
};
-const char *const text13[] = {
+static const char *const text13[] = {
"Notice that you get to remove men the instant you have all of",
"them at your inner table, even if it is the middle of a turn.",
"I roll 1 2 and move 13-11,12-11.",
0
};
-const char *const text14[] = {
+static const char *const text14[] = {
"Although you could have removed a man, this move illustrates two",
"points: 1) You never have to remove men, and 2) You should try",
"to spread out your men on your inner table. Since you have one",
@@ -160,25 +160,25 @@
0
};
-const char *const text15[] = {
+static const char *const text15[] = {
"This time you were able to remove men. I roll 3 4 and move",
"11-7,11-8. The race continues.",
0
};
-const char *const text16[] = {
+static const char *const text16[] = {
"More holes are opening up in your inner table, but you are",
"still very much ahead. If we were doubling, you would have",
"doubled long ago. I roll 2 6 and move 8-6,11-5.",
0
};
-const char *const text17[] = {
+static const char *const text17[] = {
"It pays to spread out your men. I roll 3 5 and move 7-4,8-3.",
0
};
-const char *const text18[] = {
+static const char *const text18[] = {
"You can only remove some men, but you spread out more and",
"more, in order to be able to remove men more efficiently.",
"I roll double 3's, which help, but not that much. I move",
@@ -186,30 +186,30 @@
0
};
-const char *const text19[] = {
+static const char *const text19[] = {
"I roll 1 4 and move 5-4,4-0.",
0
};
-const char *const text20[] = {
+static const char *const text20[] = {
"You are now nicely spread out to win a game. I roll 5 6 and",
"move 5-0,6-0.",
0
};
-const char *const text21[] = {
+static const char *const text21[] = {
"Any minute now. Just a few short steps from victory. I roll",
"2 4 and move 6-4,4-0.",
0
};
-const char *const text22[] = {
+static const char *const text22[] = {
"It looks pretty hopeless for me, but I play on, rolling 1 3 and",
"moving 4-3,3-0.",
0
};
-const char *const text23[] = {
+static const char *const text23[] = {
"Congratulations! You just won a game of backgammon against the",
"computer! You will now be able to play a game, but remember,",
"when you start playing, that doubling will be enabled, which",
Index: src/games/backgammon/teachgammon/tutor.c
diff -u src/games/backgammon/teachgammon/tutor.c:1.7 src/games/backgammon/teachgammon/tutor.c:1.8
--- src/games/backgammon/teachgammon/tutor.c:1.7 Fri Jul 1 01:12:39 2005
+++ src/games/backgammon/teachgammon/tutor.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tutor.c,v 1.7 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: tutor.c,v 1.8 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tutor.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: tutor.c,v 1.7 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: tutor.c,v 1.8 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -44,6 +44,9 @@
static const char better[] =
"That is a legal move, but there is a better one.\n";
+static int brdeq(const int *, const int *);
+static void clrest(void);
+
void
tutor(void)
{
@@ -129,7 +132,7 @@
leave();
}
-void
+static void
clrest(void)
{
int r, c, j;
@@ -143,7 +146,7 @@
curmove(r, c);
}
-int
+static int
brdeq(const int *b1, const int *b2)
{
const int *e;
Index: src/games/backgammon/teachgammon/teach.c
diff -u src/games/backgammon/teachgammon/teach.c:1.19 src/games/backgammon/teachgammon/teach.c:1.20
--- src/games/backgammon/teachgammon/teach.c:1.19 Sun Jul 20 01:03:20 2008
+++ src/games/backgammon/teachgammon/teach.c Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.19 2008/07/20 01:03:20 lukem Exp $ */
+/* $NetBSD: teach.c,v 1.20 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,14 +39,14 @@
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.19 2008/07/20 01:03:20 lukem Exp $");
+__RCSID("$NetBSD: teach.c,v 1.20 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
#include "tutor.h"
-const char *const helpm[] = {
+static const char *const helpm[] = {
"\nEnter a space or newline to roll, or",
" b to display the board",
" d to double",
@@ -54,7 +54,7 @@
0
};
-const char *const contin[] = {
+static const char *const contin[] = {
"",
0
};
Index: src/games/backgammon/teachgammon/tutor.h
diff -u src/games/backgammon/teachgammon/tutor.h:1.8 src/games/backgammon/teachgammon/tutor.h:1.9
--- src/games/backgammon/teachgammon/tutor.h:1.8 Tue Jan 27 20:30:28 2004
+++ src/games/backgammon/teachgammon/tutor.h Wed Aug 12 05:17:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tutor.h,v 1.8 2004/01/27 20:30:28 jsm Exp $ */
+/* $NetBSD: tutor.h,v 1.9 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -62,7 +62,5 @@
extern const struct situatn test[];
-int brdeq(const int *, const int *);
-void clrest(void);
void leave(void) __attribute__((__noreturn__));
void tutor(void) __attribute__((__noreturn__));