summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 08:21:41 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 08:21:41 +0000
commit4fa17c6f9afc7c76d0350d5d9e5996391aa18137 (patch)
treedf25abab941a9c4156963af474b6ba2a96023025
parent8916e2056e90ba2c157dfd2b98fb48837d565646 (diff)
downloadbsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.tar.gz
bsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.tar.zst
bsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.zip
sprinkle static
-rw-r--r--phantasia/fight.c33
-rw-r--r--phantasia/interplayer.c15
-rw-r--r--phantasia/io.c6
-rw-r--r--phantasia/main.c27
-rw-r--r--phantasia/misc.c8
-rw-r--r--phantasia/phantglobs.h27
-rw-r--r--pig/pig.c12
-rw-r--r--pom/pom.c24
-rw-r--r--ppt/ppt.c18
-rw-r--r--primes/primes.c15
-rw-r--r--quiz/quiz.c40
-rw-r--r--random/random.c8
-rw-r--r--robots/main.c8
-rw-r--r--robots/move.c14
-rw-r--r--robots/rnd_pos.c8
-rw-r--r--robots/robots.h9
-rw-r--r--robots/score.c11
17 files changed, 143 insertions, 140 deletions
diff --git a/phantasia/fight.c b/phantasia/fight.c
index d001dabe..ee4e15b1 100644
--- a/phantasia/fight.c
+++ b/phantasia/fight.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fight.c,v 1.11 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: fight.c,v 1.12 2009/08/12 08:21:41 dholland Exp $ */
/*
* fight.c Phantasia monster fighting routines
@@ -8,6 +8,17 @@
#undef bool
#include <curses.h>
+static void awardtreasure(void);
+static void callmonster(int);
+static void cancelmonster(void);
+static void cursedtreasure(void);
+static void hitmonster(double);
+static void monsthits(void);
+static int pickmonster(void);
+static void playerhits(void);
+static void scramblestats(void);
+static void throwspell(void);
+
void
encounter(int particular)
{
@@ -152,7 +163,7 @@ encounter(int particular)
clrtobot();
}
-int
+static int
pickmonster(void)
{
if (Player.p_specialtype == SC_VALAR)
@@ -192,7 +203,7 @@ pickmonster(void)
return ((int) ROLL(14.0, 25.0));
}
-void
+static void
playerhits(void)
{
double inflict; /* damage inflicted */
@@ -335,7 +346,7 @@ playerhits(void)
}
-void
+static void
monsthits(void)
{
double inflict; /* damage inflicted */
@@ -585,7 +596,7 @@ SPECIALHIT:
}
}
-void
+static void
cancelmonster(void)
{
Curmonster.m_energy = 0.0;
@@ -594,7 +605,7 @@ cancelmonster(void)
Curmonster.m_flock = 0.0;
}
-void
+static void
hitmonster(double inflict)
{
mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, inflict);
@@ -621,7 +632,7 @@ hitmonster(double inflict)
}
}
-void
+static void
throwspell(void)
{
double inflict; /* damage inflicted */
@@ -831,7 +842,7 @@ throwspell(void)
}
}
-void
+static void
callmonster(int which)
{
struct monster Othermonster; /* to find a name for mimics */
@@ -908,7 +919,7 @@ callmonster(int which)
Curmonster.m_melee = Curmonster.m_skirmish = 0.0;
}
-void
+static void
awardtreasure(void)
{
int whichtreasure; /* calculated treasure to grant */
@@ -1332,7 +1343,7 @@ awardtreasure(void)
}
}
-void
+static void
cursedtreasure(void)
{
if (Player.p_charms > 0) {
@@ -1349,7 +1360,7 @@ cursedtreasure(void)
}
}
-void
+static void
scramblestats(void)
{
double dbuf[6]; /* to put statistic in */
diff --git a/phantasia/interplayer.c b/phantasia/interplayer.c
index d47d32e0..3bb797d4 100644
--- a/phantasia/interplayer.c
+++ b/phantasia/interplayer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: interplayer.c,v 1.10 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: interplayer.c,v 1.11 2009/08/12 08:21:41 dholland Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
@@ -8,6 +8,11 @@
#undef bool
#include <curses.h>
+static long allocvoid(void);
+static void battleplayer(long);
+static void myturn(void);
+static void tampered(int, double, double);
+
void
checkbattle(void)
{
@@ -45,7 +50,7 @@ checkbattle(void)
}
}
-void
+static void
battleplayer(long foeplace)
{
double dtemp; /* for temporary calculations */
@@ -273,7 +278,7 @@ LEAVE:
death("Interterminal battle");
}
-void
+static void
myturn(void)
{
double dtemp; /* for temporary calculations */
@@ -384,7 +389,7 @@ checktampered(void)
tampered(Other.p_tampered, Other.p_1scratch, Other.p_2scratch);
}
-void
+static void
tampered(int what, double arg1, double arg2)
{
long loc; /* location in file of other players */
@@ -866,7 +871,7 @@ writevoid(struct energyvoid *vp, long loc)
fseek(Energyvoidfp, 0L, SEEK_SET);
}
-long
+static long
allocvoid(void)
{
long loc = 0L; /* location of new energy void */
diff --git a/phantasia/io.c b/phantasia/io.c
index 1f9d330f..239942ab 100644
--- a/phantasia/io.c
+++ b/phantasia/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.12 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: io.c,v 1.13 2009/08/12 08:21:41 dholland Exp $ */
/*
* io.c - input/output routines for Phantasia
@@ -9,6 +9,8 @@
#include <sys/cdefs.h>
#include <curses.h>
+static void catchalarm(int) __dead;
+
void
getstring(char *cp, int mx)
{
@@ -234,7 +236,7 @@ getanswer(const char *choices, phbool def)
return (*choices);
}
-void
+static void
catchalarm(int dummy __unused)
{
longjmp(Timeoenv, 1);
diff --git a/phantasia/main.c b/phantasia/main.c
index 57fe7557..7e480d0a 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.21 2009/05/26 00:30:16 dholland Exp $ */
+/* $NetBSD: main.c,v 1.22 2009/08/12 08:21:41 dholland Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -61,6 +61,15 @@
#undef bool
#include <curses.h>
+static void genchar(int);
+static void initialstate(void);
+static void neatstuff(void);
+static void playinit(void);
+static void procmain(void);
+static long recallplayer(void);
+static long rollnewplayer(void);
+static void titlelist(void);
+
int main(int, char **);
int
@@ -268,7 +277,7 @@ main(int argc, char **argv)
}
}
-void
+static void
initialstate(void)
{
struct stat sb;
@@ -325,7 +334,7 @@ initialstate(void)
srandom((unsigned) time(NULL)); /* prime random numbers */
}
-long
+static long
rollnewplayer(void)
{
int chartype; /* character type */
@@ -415,7 +424,7 @@ rollnewplayer(void)
return (allocrecord());
}
-void
+static void
procmain(void)
{
int ch; /* input */
@@ -625,7 +634,7 @@ procmain(void)
}
}
-void
+static void
titlelist(void)
{
FILE *fp; /* used for opening various files */
@@ -735,7 +744,7 @@ titlelist(void)
refresh();
}
-long
+static long
recallplayer(void)
{
long loc = 0L; /* location in player file */
@@ -794,7 +803,7 @@ recallplayer(void)
return (-1L);
}
-void
+static void
neatstuff(void)
{
double temp; /* for temporary calculations */
@@ -896,7 +905,7 @@ neatstuff(void)
}
}
-void
+static void
genchar(int type)
{
int subscript; /* used for subscripting into Stattable */
@@ -932,7 +941,7 @@ genchar(int type)
Player.p_experience = ROLL(600.0, 200.0);
}
-void
+static void
playinit(void)
{
/* catch/ingnore signals */
diff --git a/phantasia/misc.c b/phantasia/misc.c
index 881f4cc4..48909029 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.17 2009/05/25 23:14:33 dholland Exp $ */
+/* $NetBSD: misc.c,v 1.18 2009/08/12 08:21:41 dholland Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -9,7 +9,9 @@
#include <curses.h>
-void
+static double explevel(double);
+
+static void
movelevel(void)
{
const struct charstats *statptr; /* for pointing into Stattable */
@@ -682,7 +684,7 @@ writerecord(struct player *playerp, long place)
fflush(Playersfp);
}
-double
+static double
explevel(double experience)
{
if (experience < 1.1e7)
diff --git a/phantasia/phantglobs.h b/phantasia/phantglobs.h
index 82cf9c32..b151a4d8 100644
--- a/phantasia/phantglobs.h
+++ b/phantasia/phantglobs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: phantglobs.h,v 1.10 2009/05/25 22:35:01 dholland Exp $ */
+/* $NetBSD: phantglobs.h,v 1.11 2009/08/12 08:21:41 dholland Exp $ */
/*
* phantglobs.h - global declarations for Phantasia
@@ -66,20 +66,13 @@ const char *descrtype(struct player *, bool);
void activelist(void);
void adjuststats(void);
long allocrecord(void);
-long allocvoid(void);
void allstatslist(void);
void altercoordinates(double, double, int);
-void awardtreasure(void);
-void battleplayer(long);
-void callmonster(int);
-void cancelmonster(void);
-void catchalarm(int) __dead;
void changestats(bool);
void checkbattle(void);
void checktampered(void);
void cleanup(int);
void collecttaxes(double, double);
-void cursedtreasure(void);
void death(const char *);
void displaystats(void);
double distance(double, double, double, double);
@@ -88,41 +81,23 @@ double drandom(void);
void encounter(int);
void enterscore(void);
void error(const char *);
-double explevel(double);
long findname(const char *, struct player *);
void freerecord(struct player *, long);
-void genchar(int);
int getanswer(const char *, bool);
void getstring(char *, int);
-void hitmonster(double);
void ill_sig(int);
double infloat(void);
-void initialstate(void);
void initplayer(struct player *);
int inputoption(void);
void interrupt(void);
void leavegame(void);
-void monsthits(void);
void monstlist(void);
void more(int);
-void movelevel(void);
-void myturn(void);
-void neatstuff(void);
-int pickmonster(void);
-void playerhits(void);
-void playinit(void);
-void procmain(void);
void purgeoldplayers(void);
void readmessage(void);
void readrecord(struct player *, long);
-long recallplayer(void);
-long rollnewplayer(void);
void scorelist(void);
-void scramblestats(void);
-void tampered(int, double, double);
void throneroom(void);
-void throwspell(void);
-void titlelist(void);
void tradingpost(void);
void truncstring(char *);
void userlist(bool);
diff --git a/pig/pig.c b/pig/pig.c
index 8ccd8fc3..e716efa8 100644
--- a/pig/pig.c
+++ b/pig/pig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pig.c,v 1.13 2008/07/20 01:03:21 lukem Exp $ */
+/* $NetBSD: pig.c,v 1.14 2009/08/12 08:22:24 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\
#if 0
static char sccsid[] = "@(#)pig.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: pig.c,v 1.13 2008/07/20 01:03:21 lukem Exp $");
+__RCSID("$NetBSD: pig.c,v 1.14 2009/08/12 08:22:24 dholland Exp $");
#endif
#endif /* not lint */
@@ -53,8 +53,8 @@ __RCSID("$NetBSD: pig.c,v 1.13 2008/07/20 01:03:21 lukem Exp $");
#include <unistd.h>
int main(int, char *[]);
-void pigout(char *, int);
-void usage(void) __dead;
+static void pigout(char *, int);
+static void usage(void) __dead;
int
main(argc, argv)
@@ -90,7 +90,7 @@ main(argc, argv)
exit(0);
}
-void
+static void
pigout(buf, len)
char *buf;
int len;
@@ -131,7 +131,7 @@ pigout(buf, len)
(void)printf("%.*s%s", olen, buf + start, allupper ? "AY" : "ay");
}
-void
+static void
usage()
{
(void)fprintf(stderr, "usage: pig\n");
diff --git a/pom/pom.c b/pom/pom.c
index 85bba8cb..f4267d0c 100644
--- a/pom/pom.c
+++ b/pom/pom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pom.c,v 1.18 2009/07/26 03:05:52 dholland Exp $ */
+/* $NetBSD: pom.c,v 1.19 2009/08/12 08:23:20 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pom.c,v 1.18 2009/07/26 03:05:52 dholland Exp $");
+__RCSID("$NetBSD: pom.c,v 1.19 2009/08/12 08:23:20 dholland Exp $");
#endif
#endif /* not lint */
@@ -84,12 +84,12 @@ __RCSID("$NetBSD: pom.c,v 1.18 2009/07/26 03:05:52 dholland Exp $");
#define Pzero 36.340410 /* lunar mean long of perigee at EPOCH */
#define Nzero 318.510107 /* lunar mean long of node at EPOCH */
-void adj360(double *);
-double dtor(double);
int main(int, char *[]);
-double potm(double);
-time_t parsetime(char *);
-void badformat(void) __dead;
+static void adj360(double *);
+static double dtor(double);
+static double potm(double);
+static time_t parsetime(char *);
+static void badformat(void) __dead;
int
main(int argc, char *argv[])
@@ -148,7 +148,7 @@ main(int argc, char *argv[])
* potm --
* return phase of the moon
*/
-double
+static double
potm(double days)
{
double N, Msol, Ec, LambdaSol, l, Mm, Ev, Ac, A3, Mmprime;
@@ -184,7 +184,7 @@ potm(double days)
* dtor --
* convert degrees to radians
*/
-double
+static double
dtor(double deg)
{
return(deg * PI / 180);
@@ -194,7 +194,7 @@ dtor(double deg)
* adj360 --
* adjust value so 0 <= deg <= 360
*/
-void
+static void
adj360(double *deg)
{
for (;;)
@@ -207,7 +207,7 @@ adj360(double *deg)
}
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
-time_t
+static time_t
parsetime(char *p)
{
struct tm *lt;
@@ -268,7 +268,7 @@ parsetime(char *p)
return (tval);
}
-void
+static void
badformat(void)
{
warnx("illegal time format");
diff --git a/ppt/ppt.c b/ppt/ppt.c
index 194476db..098f3da9 100644
--- a/ppt/ppt.c
+++ b/ppt/ppt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ppt.c,v 1.17 2008/07/20 01:03:22 lukem Exp $ */
+/* $NetBSD: ppt.c,v 1.18 2009/08/12 08:24:20 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\
#if 0
static char sccsid[] = "@(#)ppt.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: ppt.c,v 1.17 2008/07/20 01:03:22 lukem Exp $");
+__RCSID("$NetBSD: ppt.c,v 1.18 2009/08/12 08:24:20 dholland Exp $");
#endif
#endif /* not lint */
@@ -51,12 +51,10 @@ __RCSID("$NetBSD: ppt.c,v 1.17 2008/07/20 01:03:22 lukem Exp $");
#define EDGE "___________"
- void usage(void);
- int main(int, char *[]);
-static void putppt(int);
- int getppt(const char *);
+static void putppt(int);
+static int getppt(const char *);
-void
+static void
usage(void)
{
extern char *__progname;
@@ -65,9 +63,7 @@ usage(void)
}
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
char *p, buf[132];
int c, start, neednl, dflag;
@@ -149,7 +145,7 @@ putppt(c)
(void) putchar('\n');
}
-int
+static int
getppt(const char *buf)
{
const char *p = strchr(buf, '.');
diff --git a/primes/primes.c b/primes/primes.c
index c1ff52cc..60b65904 100644
--- a/primes/primes.c
+++ b/primes/primes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: primes.c,v 1.16 2008/07/20 01:03:22 lukem Exp $ */
+/* $NetBSD: primes.c,v 1.17 2009/08/12 08:25:27 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)primes.c 8.5 (Berkeley) 5/10/95";
#else
-__RCSID("$NetBSD: primes.c,v 1.16 2008/07/20 01:03:22 lukem Exp $");
+__RCSID("$NetBSD: primes.c,v 1.17 2009/08/12 08:25:27 dholland Exp $");
#endif
#endif /* not lint */
@@ -84,7 +84,7 @@ __RCSID("$NetBSD: primes.c,v 1.16 2008/07/20 01:03:22 lukem Exp $");
*
* We make TABSIZE large to reduce the overhead of inner loop setup.
*/
-char table[TABSIZE]; /* Eratosthenes sieve of odd numbers */
+static char table[TABSIZE]; /* Eratosthenes sieve of odd numbers */
/*
* prime[i] is the (i-1)th prime.
@@ -103,12 +103,11 @@ extern const ubig *pr_limit; /* largest prime in the prime array */
extern const char pattern[];
extern const int pattern_size; /* length of pattern array */
-int dflag;
+static int dflag;
-int main(int, char *[]);
-void primes(ubig, ubig);
-ubig read_num_buf(void);
-void usage(void) __dead;
+static void primes(ubig, ubig);
+static ubig read_num_buf(void);
+static void usage(void) __dead;
int
main(int argc, char *argv[])
diff --git a/quiz/quiz.c b/quiz/quiz.c
index 545c7068..e6c90a69 100644
--- a/quiz/quiz.c
+++ b/quiz/quiz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: quiz.c,v 1.23 2008/07/20 01:03:22 lukem Exp $ */
+/* $NetBSD: quiz.c,v 1.24 2009/08/12 08:26:49 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\
#if 0
static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: quiz.c,v 1.23 2008/07/20 01:03:22 lukem Exp $");
+__RCSID("$NetBSD: quiz.c,v 1.24 2009/08/12 08:26:49 dholland Exp $");
#endif
#endif /* not lint */
@@ -64,16 +64,16 @@ static QE qlist;
static int catone, cattwo, tflag;
static u_int qsize;
-char *appdstr(char *, const char *, size_t);
-void downcase(char *);
-void get_cats(char *, char *);
-void get_file(const char *);
int main(int, char *[]);
-const char *next_cat(const char *);
-void quiz(void);
-void score(u_int, u_int, u_int);
-void show_index(void);
-void usage(void) __dead;
+static char *appdstr(char *, const char *, size_t);
+static void downcase(char *);
+static void get_cats(char *, char *);
+static void get_file(const char *);
+static const char *next_cat(const char *);
+static void quiz(void);
+static void score(u_int, u_int, u_int);
+static void show_index(void);
+static void usage(void) __dead;
int
main(argc, argv)
@@ -118,7 +118,7 @@ main(argc, argv)
exit(0);
}
-void
+static void
get_file(file)
const char *file;
{
@@ -158,7 +158,7 @@ get_file(file)
(void)fclose(fp);
}
-void
+static void
show_index()
{
QE *qp;
@@ -191,7 +191,7 @@ show_index()
(void)pclose(pf);
}
-void
+static void
get_cats(cat1, cat2)
char *cat1, *cat2;
{
@@ -224,7 +224,7 @@ get_cats(cat1, cat2)
errx(1, "invalid categories");
}
-void
+static void
quiz()
{
QE *qp;
@@ -307,7 +307,7 @@ quiz()
score(rights, wrongs, guesses);
}
-const char *
+static const char *
next_cat(s)
const char * s;
{
@@ -331,7 +331,7 @@ next_cat(s)
/* NOTREACHED */
}
-char *
+static char *
appdstr(s, tp, len)
char *s;
const char *tp;
@@ -358,7 +358,7 @@ appdstr(s, tp, len)
return (m);
}
-void
+static void
score(r, w, g)
u_int r, w, g;
{
@@ -368,7 +368,7 @@ score(r, w, g)
(void)printf(" score %d%%\n", (r + w + g) ? r * 100 / (r + w + g) : 0);
}
-void
+static void
downcase(p)
char *p;
{
@@ -379,7 +379,7 @@ downcase(p)
*p = tolower(ch);
}
-void
+static void
usage()
{
(void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
diff --git a/random/random.c b/random/random.c
index 1515ec71..c4bb50b1 100644
--- a/random/random.c
+++ b/random/random.c
@@ -1,4 +1,4 @@
-/* $NetBSD: random.c,v 1.13 2009/07/20 05:33:35 dholland Exp $ */
+/* $NetBSD: random.c,v 1.14 2009/08/12 08:27:24 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\
#if 0
static char sccsid[] = "@(#)random.c 8.6 (Berkeley) 6/1/94";
#else
-__RCSID("$NetBSD: random.c,v 1.13 2009/07/20 05:33:35 dholland Exp $");
+__RCSID("$NetBSD: random.c,v 1.14 2009/08/12 08:27:24 dholland Exp $");
#endif
#endif /* not lint */
@@ -57,7 +57,7 @@ __RCSID("$NetBSD: random.c,v 1.13 2009/07/20 05:33:35 dholland Exp $");
#include <unistd.h>
#include <limits.h>
-void usage(void) __dead;
+static void usage(void) __dead;
int
main(int argc, char *argv[])
@@ -143,7 +143,7 @@ main(int argc, char *argv[])
return 0;
}
-void
+static void
usage(void)
{
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;