diff options
author | dholland <dholland@NetBSD.org> | 2009-08-12 08:04:05 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-08-12 08:04:05 +0000 |
commit | 8916e2056e90ba2c157dfd2b98fb48837d565646 (patch) | |
tree | f7b2cd85d32a6cdf7e2f0343e90fc0b8880d6d11 | |
parent | c10b9a8ce82ad7b4b287ccc5b5b576ab961aa488 (diff) | |
download | bsdgames-darwin-8916e2056e90ba2c157dfd2b98fb48837d565646.tar.gz bsdgames-darwin-8916e2056e90ba2c157dfd2b98fb48837d565646.tar.zst bsdgames-darwin-8916e2056e90ba2c157dfd2b98fb48837d565646.zip |
sprinkle static
-rw-r--r-- | larn/bill.c | 6 | ||||
-rw-r--r-- | larn/display.c | 11 | ||||
-rw-r--r-- | larn/extern.h | 68 | ||||
-rw-r--r-- | larn/fortune.c | 6 | ||||
-rw-r--r-- | larn/help.c | 7 | ||||
-rw-r--r-- | larn/io.c | 8 | ||||
-rw-r--r-- | larn/main.c | 64 | ||||
-rw-r--r-- | larn/monster.c | 43 | ||||
-rw-r--r-- | larn/movem.c | 14 | ||||
-rw-r--r-- | larn/object.c | 50 | ||||
-rw-r--r-- | larn/scores.c | 32 | ||||
-rw-r--r-- | larn/store.c | 32 | ||||
-rw-r--r-- | mille/extern.c | 14 | ||||
-rw-r--r-- | mille/mille.h | 8 | ||||
-rw-r--r-- | mille/move.c | 17 | ||||
-rw-r--r-- | mille/print.c | 11 | ||||
-rw-r--r-- | monop/misc.c | 8 | ||||
-rw-r--r-- | monop/monop.c | 24 | ||||
-rw-r--r-- | monop/monop.h | 11 | ||||
-rw-r--r-- | morse/morse.c | 12 | ||||
-rw-r--r-- | number/number.c | 16 |
21 files changed, 234 insertions, 228 deletions
diff --git a/larn/bill.c b/larn/bill.c index 0740558c..59d33db7 100644 --- a/larn/bill.c +++ b/larn/bill.c @@ -1,4 +1,4 @@ -/* $NetBSD: bill.c,v 1.9 2008/02/03 03:49:15 dholland Exp $ */ +/* $NetBSD: bill.c,v 1.10 2009/08/12 08:04:05 dholland Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)bill.c 5.2 (Berkeley) 5/28/91"; #else -__RCSID("$NetBSD: bill.c,v 1.9 2008/02/03 03:49:15 dholland Exp $"); +__RCSID("$NetBSD: bill.c,v 1.10 2009/08/12 08:04:05 dholland Exp $"); #endif #endif /* not lint */ @@ -50,7 +50,7 @@ __RCSID("$NetBSD: bill.c,v 1.9 2008/02/03 03:49:15 dholland Exp $"); /* bill.c Larn is copyrighted 1986 by Noah Morgan. */ -const char *mail[] = { +static const char *mail[] = { "From: the LRS (Larn Revenue Service)\n", "~s undeclared income\n", "\n We have heard you survived the caverns of Larn. Let me be the", diff --git a/larn/display.c b/larn/display.c index 05744824..e6f54b02 100644 --- a/larn/display.c +++ b/larn/display.c @@ -1,9 +1,9 @@ -/* $NetBSD: display.c,v 1.8 2008/02/03 19:20:41 dholland Exp $ */ +/* $NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $ */ /* display.c Larn is copyrighted 1986 by Noah Morgan. */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: display.c,v 1.8 2008/02/03 19:20:41 dholland Exp $"); +__RCSID("$NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include "header.h" @@ -19,7 +19,7 @@ static void seepage(void); static int minx, maxx, miny, maxy, k, m; static char bot1f = 0, bot2f = 0, bot3f = 0; -char always = 0; +static char always = 0; /* bottomline() @@ -241,7 +241,7 @@ botsub(int idx, const char *str) * If entire lines are being drawn, then they will be cleared first. */ /* for limited screen drawing */ -int d_xmin = 0, d_xmax = MAXX, d_ymin = 0, d_ymax = MAXY; +static int d_xmin = 0, d_xmax = MAXX, d_ymin = 0, d_ymax = MAXY; void draws(xmin, xmax, ymin, ymax) @@ -280,7 +280,8 @@ draws(xmin, xmax, ymin, ymax) subroutine to redraw the whole screen as the player knows it */ -u_char screen[MAXX][MAXY], d_flag; /* template for the screen */ +u_char screen[MAXX][MAXY]; /* template for the screen */ +static u_char d_flag; void drawscreen() { diff --git a/larn/extern.h b/larn/extern.h index 5f527eb3..d65b57ff 100644 --- a/larn/extern.h +++ b/larn/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.12 2008/02/19 06:05:26 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.13 2009/08/12 08:04:05 dholland Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -113,7 +113,6 @@ int rund(int); /* help.c */ void help(void); void welcome(void); -void retcont(void); /* io.c */ void setupvt100(void); @@ -150,29 +149,9 @@ void beep(void); /* main.c */ int main(int, char **); -void showstr(void); void qshowstr(void); -void t_setup(int); -void t_endup(int); -void showwear(void); -void showwield(void); -void showread(void); -void showeat(void); -void showquaff(void); -void show1(int, const char *[]); void show3(int); -void randmonst(void); -void parse(void); void parse2(void); -void run(int); -void wield(void); -void ydhi(int); -void ycwi(int); -void wear(void); -void dropobj(void); -void readscr(void); -void eatcookie(void); -void quaff(void); unsigned long readnum(long); void szero(char *); @@ -180,20 +159,9 @@ void szero(char *); void createmonster(int); void createitem(int, int); void cast(void); -void speldamage(int); -void loseint(void); -int isconfuse(void); -int nospell(int, int); -int fullhit(int); -void direct(int, int, const char *, int); void godirect(int, int, const char *, int, int); -void ifblind(int, int); -void tdirect(int); -void omnidirect(int, int, const char *); int vxy(int *, int *); -void dirpoly(int); void hitmonster(int, int); -int hitm(int, int, int); void hitplayer(int, int); void dropgold(int); void something(int); @@ -202,8 +170,6 @@ void checkloss(int); int annihilate(void); int newsphere(int, int, int, int); int rmsphere(int, int); -void sphboom(int, int); -void genmonst(void); /* moreobj.c */ void oaltar(void); @@ -215,34 +181,17 @@ void fntchange(int); /* movem.c */ void movemonst(void); -void movemt(int, int); -void mmove(int, int, int, int); -void movsphere(void); /* nap.c */ void nap(int); /* object.c */ void lookforobject(void); -void finditem(int); -void ostairs(int); void oteleport(int); -void opotion(int); void quaffpotion(int); -void oscroll(int); void adjusttime(long); void read_scroll(int); -void oorb(void); -void opit(void); -void obottomless(void); -void oelevator(int); -void ostatue(void); -void omirror(void); -void obook(void); void readbook(int); -void ocookie(void); -void ogold(int); -void ohome(void); void iopts(void); void ignore(void); @@ -254,21 +203,12 @@ void savelevel(void); void getlevel(void); /* scores.c */ -int readboard(void); -int writeboard(void); int makeboard(void); int hashewon(void); long paytaxes(long); -int winshou(void); -int shou(int); void showscores(void); void showallscores(void); -int sortboard(void); -void newscore(long, char *, int, int); -void new1sub(long, int, char *, long); -void new2sub(long, int, char *, int); void died(int); -void diedsub(int); void diedlog(void); int getplid(char *); @@ -276,18 +216,12 @@ int getplid(char *); void sigsetup(void); /* store.c */ -void dnd_2hed(void); -void dnd_hed(void); void dndstore(void); -void sch_hed(void); void oschool(void); void obank(void); void obank2(void); void ointerest(void); -void obanksub(void); -void appraise(int); void otradepost(void); -void cnsitm(void); void olrs(void); /* tok.c */ diff --git a/larn/fortune.c b/larn/fortune.c index 84cca6bd..4eb7f67b 100644 --- a/larn/fortune.c +++ b/larn/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.6 2008/01/28 05:38:53 dholland Exp $ */ +/* $NetBSD: fortune.c,v 1.7 2009/08/12 08:04:05 dholland Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)fortune.c 5.5 (Berkeley) 6/10/91"; #else -__RCSID("$NetBSD: fortune.c,v 1.6 2008/01/28 05:38:53 dholland Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.7 2009/08/12 08:04:05 dholland Exp $"); #endif #endif /* not lint */ @@ -48,7 +48,7 @@ __RCSID("$NetBSD: fortune.c,v 1.6 2008/01/28 05:38:53 dholland Exp $"); * function to return a random fortune from the fortune file */ -const char *flines[] = { +static const char *flines[] = { "gem value = gem * 2 ^ perfection", "sitting down can have unexpected results", "don't pry into the affairs of others", diff --git a/larn/help.c b/larn/help.c index 05e7656b..76827a5a 100644 --- a/larn/help.c +++ b/larn/help.c @@ -1,9 +1,9 @@ -/* $NetBSD: help.c,v 1.7 2008/02/03 21:24:58 dholland Exp $ */ +/* $NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $ */ /* help.c Larn is copyrighted 1986 by Noah Morgan. */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: help.c,v 1.7 2008/02/03 21:24:58 dholland Exp $"); +__RCSID("$NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include <unistd.h> @@ -11,6 +11,7 @@ __RCSID("$NetBSD: help.c,v 1.7 2008/02/03 21:24:58 dholland Exp $"); #include "header.h" #include "extern.h" +static void retcont(void); static int openhelp(void); /* @@ -98,7 +99,7 @@ welcome() /* * function to say press return to continue and reset scroll when done */ -void +static void retcont() { cursor(1, 24); @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.23 2008/02/03 21:24:58 dholland Exp $ */ +/* $NetBSD: io.c,v 1.24 2009/08/12 08:04:05 dholland Exp $ */ /* * io.c Larn is copyrighted 1986 by Noah Morgan. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: io.c,v 1.23 2008/02/03 21:24:58 dholland Exp $"); +__RCSID("$NetBSD: io.c,v 1.24 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include "header.h" @@ -650,8 +650,8 @@ cursors() * obvious meanings. */ -struct tinfo *info; -char *CM, *CE, *CD, *CL, *SO, *SE, *AL, *DL; /* Termcap capabilities */ +static struct tinfo *info; +static char *CM, *CE, *CD, *CL, *SO, *SE, *AL, *DL; /* Termcap capabilities */ static char *outbuf = 0; /* translated output buffer */ /* diff --git a/larn/main.c b/larn/main.c index 241c9199..b74d1fac 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,9 +1,9 @@ -/* $NetBSD: main.c,v 1.23 2008/02/03 21:24:58 dholland Exp $ */ +/* $NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $ */ /* main.c */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: main.c,v 1.23 2008/02/03 21:24:58 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -15,6 +15,26 @@ __RCSID("$NetBSD: main.c,v 1.23 2008/02/03 21:24:58 dholland Exp $"); #include "header.h" #include "extern.h" +static void showstr(void); +static void t_setup(int); +static void t_endup(int); +static void showwear(void); +static void showwield(void); +static void showread(void); +static void showeat(void); +static void showquaff(void); +static void show1(int, const char *[]); +static void randmonst(void); +static void parse(void); +static void run(int); +static void wield(void); +static void ydhi(int); +static void ycwi(int); +static void wear(void); +static void dropobj(void); +static void readscr(void); +static void eatcookie(void); +static void quaff(void); static int whatitem(const char *); static char copyright[] = "\nLarn is copyrighted 1986 by Noah Morgan.\n"; @@ -309,7 +329,7 @@ main(argc, argv) show character's inventory */ -void +static void showstr() { int i, number; @@ -348,7 +368,7 @@ qshowstr() /* * subroutine to clear screen depending on # lines to display */ -void +static void t_setup(count) int count; { @@ -364,7 +384,7 @@ t_setup(count) /* * subroutine to restore normal display screen depending on t_setup() */ -void +static void t_endup(count) int count; { @@ -379,7 +399,7 @@ t_endup(count) /* function to show the things player is wearing only */ -void +static void showwear() { int i, j, sigsav, count; @@ -428,7 +448,7 @@ showwear() /* function to show the things player can wield only */ -void +static void showwield() { int i, j, sigsav, count; @@ -486,7 +506,7 @@ showwield() /* * function to show the things player can read only */ -void +static void showread() { int i, j, sigsav, count; @@ -518,7 +538,7 @@ showread() /* * function to show the things player can eat only */ -void +static void showeat() { int i, j, sigsav, count; @@ -548,7 +568,7 @@ showeat() /* function to show the things player can quaff only */ -void +static void showquaff() { int i, j, sigsav, count; @@ -575,7 +595,7 @@ showquaff() t_endup(count); } -void +static void show1(idx, str2) int idx; const char *str2[]; @@ -632,7 +652,7 @@ show3(int indx) /* subroutine to randomly create monsters if needed */ -void +static void randmonst() { if (c[TIMESTOP]) @@ -650,7 +670,7 @@ randmonst() get and execute a command */ -void +static void parse() { int i, j, k, flag; @@ -969,7 +989,7 @@ parse2() regen(); } -void +static void run(dir) int dir; { @@ -994,7 +1014,7 @@ run(dir) /* function to wield a weapon */ -void +static void wield() { int i; @@ -1032,14 +1052,14 @@ wield() /* common routine to say you don't have an item */ -void +static void ydhi(x) int x; { cursors(); lprintf("\nYou don't have item %c!", x); } -void +static void ycwi(x) int x; { @@ -1050,7 +1070,7 @@ ycwi(x) /* function to wear armor */ -void +static void wear() { int i; @@ -1102,7 +1122,7 @@ wear() /* function to drop an object */ -void +static void dropobj() { int i; @@ -1166,7 +1186,7 @@ dropobj() /* * readscr() Subroutine to read a scroll one is carrying */ -void +static void readscr() { int i; @@ -1201,7 +1221,7 @@ readscr() /* * subroutine to eat a cookie one is carrying */ -void +static void eatcookie(void) { const char *p; @@ -1239,7 +1259,7 @@ eatcookie(void) /* * subroutine to quaff a potion one is carrying */ -void +static void quaff() { int i; diff --git a/larn/monster.c b/larn/monster.c index a4f6bbce..46f7af53 100644 --- a/larn/monster.c +++ b/larn/monster.c @@ -1,4 +1,4 @@ -/* $NetBSD: monster.c,v 1.16 2008/02/03 21:24:58 dholland Exp $ */ +/* $NetBSD: monster.c,v 1.17 2009/08/12 08:04:05 dholland Exp $ */ /* * monster.c Larn is copyrighted 1986 by Noah Morgan. @@ -100,7 +100,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: monster.c,v 1.16 2008/02/03 21:24:58 dholland Exp $"); +__RCSID("$NetBSD: monster.c,v 1.17 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include <string.h> @@ -116,9 +116,22 @@ struct isave { /* used for altar reality */ }; static int cgood(int, int, int, int); +static void speldamage(int); +static void loseint(void); +static int isconfuse(void); +static int nospell(int, int); +static int fullhit(int); +static void direct(int, int, const char *, int); +static void ifblind(int, int); +static void tdirect(int); +static void omnidirect(int, int, const char *); static int dirsub(int *, int *); +static void dirpoly(int); +static int hitm(int, int, int); static void dropsomething(int); static int spattack(int, int, int); +static void sphboom(int, int); +static void genmonst(void); /* * createmonster(monstno) Function to create a monster next to the player @@ -274,7 +287,7 @@ over: lprcat(aborted); * Enter with the spell number, returns no value. * Please insure that there are 2 spaces before all messages here */ -void +static void speldamage(int x) { int i, j, clev; @@ -639,7 +652,7 @@ speldamage(int x) * * No arguments and no return value */ -void +static void loseint() { if (--c[INTELLIGENCE] < 3) @@ -652,7 +665,7 @@ loseint() * This routine prints out a message saying "You can't aim your magic!" * returns 0 if not confused, non-zero (time remaining confused) if confused */ -int +static int isconfuse() { if (c[CONFUSE]) { @@ -670,7 +683,7 @@ isconfuse() * otherwise returns 0 * Enter with the spell number in x, and the monster number in monst. */ -int +static int nospell(x, monst) int x, monst; { @@ -692,7 +705,7 @@ nospell(x, monst) * Function to return hp damage to monster due to a number of full hits * Enter with the number of full hits being done */ -int +static int fullhit(xx) int xx; { @@ -715,7 +728,7 @@ fullhit(xx) * lprintf format string in str, and lprintf's argument in arg. * Returns no value. */ -void +static void direct(spnum, dam, str, arg) int spnum, dam, arg; const char *str; @@ -901,7 +914,7 @@ godirect(spnum, dam, str, delay, cshow) * Enter with the coordinates (x,y) of the monster * Returns no value. */ -void +static void ifblind(int x, int y) { const char *p; @@ -925,7 +938,7 @@ ifblind(int x, int y) * Enter with the spell number that wants to teleport away * Returns no value. */ -void +static void tdirect(spnum) int spnum; { @@ -960,7 +973,7 @@ tdirect(spnum) * and the lprintf string to identify the spell in str. * Returns no value. */ -void +static void omnidirect(int spnum, int dam, const char *str) { int x, y, m; @@ -1068,7 +1081,7 @@ vxy(x, y) * Enter with the spell number in spmun. * Returns no value. */ -void +static void dirpoly(spnum) int spnum; { @@ -1154,7 +1167,7 @@ hitmonster(x, y) * This routine is used to specifically damage a monster at a location (x,y) * Called by hitmonster(x,y) */ -int +static int hitm(x, y, amt) int x, y; int amt; @@ -1867,7 +1880,7 @@ rmsphere(x, y) * * Enter with the coordinates of the blast, Returns no value */ -void +static void sphboom(x, y) int x, y; { @@ -1895,7 +1908,7 @@ sphboom(x, y) * * This is done by setting a flag in the monster[] structure */ -void +static void genmonst() { int i, j; diff --git a/larn/movem.c b/larn/movem.c index 99336abe..6625a187 100644 --- a/larn/movem.c +++ b/larn/movem.c @@ -1,4 +1,4 @@ -/* $NetBSD: movem.c,v 1.6 2008/01/28 05:38:54 dholland Exp $ */ +/* $NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $ */ /* * movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan. @@ -12,12 +12,16 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: movem.c,v 1.6 2008/01/28 05:38:54 dholland Exp $"); +__RCSID("$NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include "header.h" #include "extern.h" +static void movemt(int, int); +static void mmove(int, int, int, int); +static void movsphere(void); + /* * movemonst() Routine to move the monsters toward the player * @@ -127,7 +131,7 @@ movemonst() * Returns no value. */ static int tmpitem, xl, xh, yl, yh; -void +static void movemt(i, j) int i, j; { @@ -269,7 +273,7 @@ out: if (tmp < distance) /* did find connectivity */ * Enter with the from coordinates in (x,y) and the destination coordinates * in (xd,yd). */ -void +static void mmove(aa, bb, cc, dd) int aa, bb, cc, dd; { @@ -402,7 +406,7 @@ mmove(aa, bb, cc, dd) */ #define SPHMAX 20 /* maximum number of spheres movsphere can * handle */ -void +static void movsphere() { int x, y, dir, len; diff --git a/larn/object.c b/larn/object.c index 74b4d97b..1c7e607d 100644 --- a/larn/object.c +++ b/larn/object.c @@ -1,14 +1,29 @@ -/* $NetBSD: object.c,v 1.14 2008/02/04 01:07:01 dholland Exp $ */ +/* $NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */ /* object.c Larn is copyrighted 1986 by Noah Morgan. */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: object.c,v 1.14 2008/02/04 01:07:01 dholland Exp $"); +__RCSID("$NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include "header.h" #include "extern.h" +static void finditem(int); +static void ostairs(int); +static void opotion(int); +static void oscroll(int); +static void oorb(void); +static void opit(void); +static void obottomless(void); +static void oelevator(int); +static void ostatue(void); +static void omirror(void); +static void obook(void); +static void ocookie(void); +static void ogold(int); +static void ohome(void); + /* lookforobject @@ -495,7 +510,7 @@ lookforobject() /* function to say what object we found and ask if player wants to take it */ -void +static void finditem(int theitem) { int tmp, i; @@ -538,7 +553,7 @@ finditem(int theitem) subroutine to process the stair cases if dir > 0 the up else down */ -void +static void ostairs(dir) int dir; { @@ -641,7 +656,7 @@ oteleport(err) /* function to process a potion */ -void +static void opotion(pot) int pot; { @@ -850,7 +865,7 @@ quaffpotion(pot) /* function to process a magic scroll */ -void +static void oscroll(typ) int typ; { @@ -900,7 +915,7 @@ static u_char exten[] = { CANCELLATION, HASTESELF, GLOBE, SCAREMONST, HOLDMONST, TIMESTOP }; -u_char time_change[] = { +static u_char time_change[] = { HASTESELF, HERO, ALTPRO, PROTECTIONTIME, DEXCOUNT, STRCOUNT, GIANTSTR, CHARMCOUNT, INVISIBILITY, CANCELLATION, HASTESELF, AGGRAVATE, SCAREMONST, STEALTH, AWARENESS, HOLDMONST, @@ -1082,12 +1097,12 @@ read_scroll(typ) -void +static void oorb() { } -void +static void opit() { int i; @@ -1116,7 +1131,7 @@ opit() } } -void +static void obottomless() { lprcat("\nYou fell into a bottomless pit!"); @@ -1124,7 +1139,8 @@ obottomless() nap(3000); died(262); } -void + +static void oelevator(dir) int dir; { @@ -1135,17 +1151,17 @@ oelevator(dir) #endif /* lint */ } -void +static void ostatue() { } -void +static void omirror() { } -void +static void obook() { lprcat("\nDo you "); @@ -1197,7 +1213,7 @@ readbook(lev) } } -void +static void ocookie(void) { const char *p; @@ -1235,7 +1251,7 @@ ocookie(void) * routine to pick up some gold -- if arg==OMAXGOLD then the pile is worth * 100* the argument */ -void +static void ogold(arg) int arg; { @@ -1253,7 +1269,7 @@ ogold(arg) item[playerx][playery] = know[playerx][playery] = 0; /* destroy gold */ } -void +static void ohome() { int i; diff --git a/larn/scores.c b/larn/scores.c index ae289f1b..a6a47cf6 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,4 +1,4 @@ -/* $NetBSD: scores.c,v 1.17 2008/02/03 20:41:53 dholland Exp $ */ +/* $NetBSD: scores.c,v 1.18 2009/08/12 08:04:05 dholland Exp $ */ /* * scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: scores.c,v 1.17 2008/02/03 20:41:53 dholland Exp $"); +__RCSID("$NetBSD: scores.c,v 1.18 2009/08/12 08:04:05 dholland Exp $"); #endif /* not lint */ #include <sys/types.h> #include <sys/times.h> @@ -102,12 +102,22 @@ static const char *whydead[] = { "died a post mortem death", "wasted by a malloc() failure" }; +static int readboard(void); +static int writeboard(void); +static int winshou(void); +static int shou(int); +static int sortboard(void); +static void newscore(long, char *, int, int); +static void new1sub(long, int, char *, long); +static void new2sub(long, int, char *, int); +static void diedsub(int); + /* * readboard() Function to read in the scoreboard into a static buffer * * returns -1 if unable to read in the scoreboard, returns 0 if all is OK */ -int +static int readboard() { int i; @@ -134,7 +144,7 @@ readboard() * * returns -1 if unable to write the scoreboard, returns 0 if all is OK */ -int +static int writeboard() { int i; @@ -246,7 +256,7 @@ paytaxes(x) * * Returns the number of players on scoreboard that were shown */ -int +static int winshou() { struct wscofmt *p; @@ -285,7 +295,7 @@ winshou() * Enter with 0 to list the scores, enter with 1 to list inventories too * Returns the number of players on scoreboard that were shown */ -int +static int shou(x) int x; { @@ -390,7 +400,7 @@ showallscores() * * Returns 0 if no sorting done, else returns 1 */ -int +static int sortboard() { int i, j = 0, pos; @@ -429,7 +439,7 @@ sortboard() * died() reason # in whyded, and TRUE/FALSE in winner if a winner * ex. newscore(1000, "player 1", 32, 0); */ -void +static void newscore(score, whoo, whyded, winner) long score; int winner, whyded; @@ -498,7 +508,7 @@ newscore(score, whoo, whyded, winner) * slot in scoreboard in i, and the tax bill in taxes. * Returns nothing of value */ -void +static void new1sub(score, i, whoo, taxes) long score, taxes; int i; @@ -525,7 +535,7 @@ new1sub(score, i, whoo, taxes) * died() reason # in whyded, and slot in scoreboard in i. * Returns nothing of value */ -void +static void new2sub(score, i, whoo, whyded) long score; int i, whyded; @@ -732,7 +742,7 @@ invalid: * diedsub(x) Subroutine to print out the line showing the player when he is killed * int x; */ -void +static void diedsub(int x) { char ch; diff --git a/larn/store.c b/larn/store.c index 4eb5ec52..59733c78 100644 --- a/larn/store.c +++ b/larn/store.c @@ -1,4 +1,4 @@ -/* $NetBSD: store.c,v 1.14 2008/02/03 21:24:59 dholland Exp $ */ +/* $NetBSD: store.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */ /*- * Copyright (c) 1988 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91"; #else -__RCSID("$NetBSD: store.c,v 1.14 2008/02/03 21:24:59 dholland Exp $"); +__RCSID("$NetBSD: store.c,v 1.15 2009/08/12 08:04:05 dholland Exp $"); #endif #endif /* not lint */ @@ -47,7 +47,9 @@ static void outofstock(void); static void nogold(void); static void dnditem(int); static void banktitle(const char *); +static void obanksub(void); static void otradhead(void); +static void cnsitm(void); static int dndcount = 0, dnditm = 0; @@ -189,16 +191,16 @@ struct _itm itm[90] = { /* function for the dnd store */ -void -dnd_2hed() +static void +dnd_2hed(void) { lprcat("Welcome to the Larn Thrift Shoppe. We stock many items explorers find useful\n"); lprcat(" in their adventures. Feel free to browse to your hearts content.\n"); lprcat("Also be advised, if you break 'em, you pay for 'em."); } -void -dnd_hed() +static void +dnd_hed(void) { int i; for (i = dnditm; i < 26 + dnditm; i++) @@ -346,12 +348,12 @@ dnditem(i) for the college of larn */ u_char course[26] = {0}; /* the list of courses taken */ -char coursetime[] = {10, 15, 10, 20, 10, 10, 10, 5}; +static char coursetime[] = {10, 15, 10, 20, 10, 10, 10, 5}; /* function to display the header info for the school */ -void -sch_hed() +static void +sch_hed(void) { clear(); lprcat("The College of Larn offers the exciting opportunity of higher education to\n"); @@ -699,12 +701,12 @@ obanksub() } } +#if 0 /* XXX: apparently unused */ /* subroutine to appraise any stone for the bank */ -void -appraise(gemstone) - int gemstone; +static void +appraise(int gemstone) { int j, amt; for (j = 0; j < 26; j++) @@ -738,6 +740,8 @@ appraise(gemstone) lprcat("no\nO. K.\n"); } } +#endif /* 0 - unused */ + /* function for the trading post */ @@ -839,8 +843,8 @@ otradepost() } } -void -cnsitm() +static void +cnsitm(void) { lprcat("\nSorry, we can't accept unidentified objects."); } diff --git a/mille/extern.c b/mille/extern.c index 71cb2e25..445bca70 100644 --- a/mille/extern.c +++ b/mille/extern.c @@ -1,4 +1,4 @@ -/* $NetBSD: extern.c,v 1.9 2009/05/25 23:34:50 dholland Exp $ */ +/* $NetBSD: extern.c,v 1.10 2009/08/12 08:07:27 dholland Exp $ */ /* * Copyright (c) 1982, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: extern.c,v 1.9 2009/05/25 23:34:50 dholland Exp $"); +__RCSID("$NetBSD: extern.c,v 1.10 2009/08/12 08:07:27 dholland Exp $"); #endif #endif /* not lint */ @@ -52,9 +52,9 @@ bool Debug, /* set if debugging code on */ Saved; /* set if game just saved */ char Initstr[INITSTR_SIZE]; /* initial string for error field */ -const char *C_fmt = "%-18.18s", /* format for printing cards */ - *Fromfile = NULL, /* startup file for game */ - *const _cn[NUM_CARDS] = { /* Card name buffer */ +const char *C_fmt = "%-18.18s"; /* format for printing cards */ +const char *Fromfile = NULL; /* startup file for game */ +static const char *const _cn[NUM_CARDS] = {/* Card name buffer */ "", "25", "50", @@ -75,8 +75,8 @@ const char *C_fmt = "%-18.18s", /* format for printing cards */ "Puncture Proof", "Driving Ace", "Right of Way" - }, - *const *C_name = &_cn[1]; /* Card names */ +}; +const char *const *C_name = &_cn[1]; /* Card names */ int Card_no, /* Card number for current move */ End, /* End value for current hand */ diff --git a/mille/mille.h b/mille/mille.h index 8103a99f..e9672a7a 100644 --- a/mille/mille.h +++ b/mille/mille.h @@ -1,4 +1,4 @@ -/* $NetBSD: mille.h,v 1.16 2009/05/25 23:44:04 dholland Exp $ */ +/* $NetBSD: mille.h,v 1.17 2009/08/12 08:07:27 dholland Exp $ */ /* * Copyright (c) 1982, 1993 @@ -235,7 +235,6 @@ void account(CARD); void calcmove(void); int canplay(const PLAY *, const PLAY *, CARD); int check_ext(bool); -void check_go(void); void check_more(void); void die(int) __attribute__((__noreturn__)); void domove(void); @@ -243,16 +242,13 @@ bool error(const char *, ...); void extrapolate(PLAY *); void finalscore(PLAY *); CARD getcard(void); -void getmove(void); int getyn(int); -int haspicked(const PLAY *); void init(void); int is_repair(CARD); int main(int, char **); void newboard(void); void newscore(void); int onecard(const PLAY *); -int playcard(PLAY *); void prboard(void); void prompt(int); void prscore(bool); @@ -262,8 +258,6 @@ int roll(int, int); void rub(int); int safety(CARD); bool save(void); -void show_card(int, int, CARD, CARD *); -void show_score(int, int, int, int *); void shuffle(void); void sort(CARD *); void undoex(int); diff --git a/mille/move.c b/mille/move.c index e79b0a1b..060d118c 100644 --- a/mille/move.c +++ b/mille/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.16 2009/05/25 23:24:54 dholland Exp $ */ +/* $NetBSD: move.c,v 1.17 2009/08/12 08:07:27 dholland Exp $ */ /* * Copyright (c) 1983, 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.16 2009/05/25 23:24:54 dholland Exp $"); +__RCSID("$NetBSD: move.c,v 1.17 2009/08/12 08:07:27 dholland Exp $"); #endif #endif /* not lint */ @@ -56,6 +56,11 @@ __RCSID("$NetBSD: move.c,v 1.16 2009/05/25 23:24:54 dholland Exp $"); #undef CTRL #define CTRL(c) (c - 'A' + 1) +static void check_go(void); +static int playcard(PLAY *); +static void getmove(void); +static int haspicked(const PLAY *); + void domove(void) { @@ -167,7 +172,7 @@ acc: * Check and see if either side can go. If they cannot, * the game is over */ -void +static void check_go(void) { CARD card; @@ -198,7 +203,7 @@ check_go(void) Finished = TRUE; } -int +static int playcard(PLAY *pp) { int v; @@ -347,7 +352,7 @@ protected: return TRUE; } -void +static void getmove(void) { char c; @@ -481,7 +486,7 @@ ret: /* * return whether or not the player has picked */ -int +static int haspicked(const PLAY *pp) { int card; diff --git a/mille/print.c b/mille/print.c index 7ad7380f..44d79f56 100644 --- a/mille/print.c +++ b/mille/print.c @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.14 2009/05/25 23:34:50 dholland Exp $ */ +/* $NetBSD: print.c,v 1.15 2009/08/12 08:07:27 dholland Exp $ */ /* * Copyright (c) 1982, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: print.c,v 1.14 2009/05/25 23:34:50 dholland Exp $"); +__RCSID("$NetBSD: print.c,v 1.15 2009/08/12 08:07:27 dholland Exp $"); #endif #endif /* not lint */ @@ -47,6 +47,9 @@ __RCSID("$NetBSD: print.c,v 1.14 2009/05/25 23:34:50 dholland Exp $"); #define COMP_STRT 20 #define CARD_STRT 2 +static void show_card(int, int, CARD, CARD *); +static void show_score(int, int, int, int *); + void prboard(void) { @@ -102,7 +105,7 @@ prboard(void) * show_card: * Show the given card if it is different from the last one shown */ -void +static void show_card(int y, int x, CARD c, CARD *lc) { if (c == *lc) @@ -165,7 +168,7 @@ prscore(for_real) * Show a score value if it is different from the last time we * showed it. */ -void +static void show_score(int y, int x, int s, int *ls) { if (s == *ls) diff --git a/monop/misc.c b/monop/misc.c index 16886db8..3f881072 100644 --- a/monop/misc.c +++ b/monop/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.20 2008/02/24 03:52:09 christos Exp $ */ +/* $NetBSD: misc.c,v 1.21 2009/08/12 08:10:49 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: misc.c,v 1.20 2008/02/24 03:52:09 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.21 2009/08/12 08:10:49 dholland Exp $"); #endif #endif /* not lint */ @@ -45,6 +45,8 @@ __RCSID("$NetBSD: misc.c,v 1.20 2008/02/24 03:52:09 christos Exp $"); #include "monop.h" +static void is_monop(MON *, int); + /* * This routine executes a truncated set of commands until a * "yes or "no" answer is gotten. @@ -234,7 +236,7 @@ set_ownlist(pl) /* * This routine sets things up as if it is a new monopoly */ -void +static void is_monop(mp, pl) MON *mp; int pl; diff --git a/monop/monop.c b/monop/monop.c index 6a945581..3a54fccd 100644 --- a/monop/monop.c +++ b/monop/monop.c @@ -1,4 +1,4 @@ -/* $NetBSD: monop.c,v 1.24 2008/07/20 01:03:21 lukem Exp $ */ +/* $NetBSD: monop.c,v 1.25 2009/08/12 08:10:49 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: monop.c,v 1.24 2008/07/20 01:03:21 lukem Exp $"); +__RCSID("$NetBSD: monop.c,v 1.25 2009/08/12 08:10:49 dholland Exp $"); #endif #endif /* not lint */ @@ -63,8 +63,8 @@ bool fixing, /* set if fixing up debt */ told_em, /* set if told user he's out of debt */ spec; /* set if moving by card to RR or UTIL */ -const char *name_list[MAX_PL+2], /* list of players' names */ - *const comlist[] = { /* list of normal commands */ +const char *name_list[MAX_PL+2]; /* list of players' names */ +static const char *const comlist[] = { /* list of normal commands */ "quit", /* 0 */ "print", /* 1 */ "where", /* 2 */ "own holdings", /* 3 */ "holdings", /* 4 */ "mortgage", /* 5 */ @@ -75,15 +75,15 @@ const char *name_list[MAX_PL+2], /* list of players' names */ "restore", /* 14 */ "roll", /* 15 */ "", /* 16 */ 0 - }, - *const yncoms[] = { /* list of commands for yes/no answers */ +}; +const char *const yncoms[] = { /* list of commands for yes/no answers */ "yes", /* 0 */ "no", /* 1 */ "quit", /* 2 */ "print", /* 3 */ "where", /* 4 */ "own holdings", /* 5 */ "holdings", /* 6 */ 0 - }, - *const lucky_mes[] = { /* "got lucky" messages */ +}; +const char *const lucky_mes[] = { /* "got lucky" messages */ "You lucky stiff", "You got lucky", "What a lucky person!", "You must have a 4-leaf clover", "My, my! Aren't we lucky!", "Luck smiles upon you", @@ -91,7 +91,7 @@ const char *name_list[MAX_PL+2], /* list of players' names */ "Your karma must certainly be together", "How beautifully Cosmic", "Wow, you must be really with it" /* "I want your autograph", -- Save for later */ - }; +}; int player, /* current player number */ num_play, /* current number of players */ @@ -125,15 +125,15 @@ DECK deck[2]; /* Chance and Community Chest */ PLAY *play, /* player structure array ("calloc"ed) */ *cur_p; /* pointer to current player's struct */ -RR_S rr[N_RR]; /* railroad descriptions */ +static RR_S rr[N_RR]; /* railroad descriptions */ -UTIL_S util[2]; /* utility descriptions */ +static UTIL_S util[2]; /* utility descriptions */ #define MONINIT(num_in, h_cost, not_m, mon_n, sq1,sq2,sq3) \ {0, -1, num_in, 0, h_cost, not_m, mon_n, {sq1,sq2,sq3}, {0,0,0}} /* name owner num_own sq */ -MON mon[N_MON] = { /* monopoly descriptions */ +static MON mon[N_MON] = { /* monopoly descriptions */ /* num_in h_cost not_m mon_n sqnums */ MONINIT(2, 1, "Purple", "PURPLE", 1,3, 0), MONINIT(3, 1, "Lt. Blue", "LT. BLUE", 6,8,9), diff --git a/monop/monop.h b/monop/monop.h index bcbf97f7..ecc74204 100644 --- a/monop/monop.h +++ b/monop/monop.h @@ -1,4 +1,4 @@ -/* $NetBSD: monop.h,v 1.18 2008/02/24 06:07:06 dholland Exp $ */ +/* $NetBSD: monop.h,v 1.19 2009/08/12 08:10:49 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -131,23 +131,23 @@ typedef struct prp_st UTIL_S; extern bool trading, spec, fixing, told_em; -extern const char *const yncoms[], *const comlist[], *name_list[], *const lucky_mes[]; +extern const char *const yncoms[], *name_list[], *const lucky_mes[]; extern int num_play, player, num_doub, num_luck; extern void (*const func[])(void); -extern MON mon[N_MON]; +/*extern MON mon[N_MON];*/ extern PLAY *play, *cur_p; extern PROP prop[N_PROP]; -extern RR_S rr[N_RR]; +/*extern RR_S rr[N_RR];*/ extern SQUARE board[N_SQRS + 1]; -extern UTIL_S util[2]; +/*extern UTIL_S util[2];*/ /* cards.c */ @@ -180,7 +180,6 @@ void notify(void); void next_play(void); int get_int(const char *); void set_ownlist(int); -void is_monop(MON *, int); void is_not_monop(MON *); void list(void); void list_all(void); diff --git a/morse/morse.c b/morse/morse.c index e6c6ea6d..70cbe4d1 100644 --- a/morse/morse.c +++ b/morse/morse.c @@ -1,4 +1,4 @@ -/* $NetBSD: morse.c,v 1.15 2008/07/20 01:03:21 lukem Exp $ */ +/* $NetBSD: morse.c,v 1.16 2009/08/12 08:11:37 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\ #if 0 static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: morse.c,v 1.15 2008/07/20 01:03:21 lukem Exp $"); +__RCSID("$NetBSD: morse.c,v 1.16 2009/08/12 08:11:37 dholland Exp $"); #endif #endif /* not lint */ @@ -91,7 +91,7 @@ static const char "--..", }; -const struct punc { +static const struct punc { char c; const char *morse; } other[] = { @@ -111,9 +111,9 @@ const struct punc { }; int main(int, char *[]); -void morse(int); -void decode(const char *); -void show(const char *); +static void morse(int); +static void decode(const char *); +static void show(const char *); static int sflag; static int dflag; diff --git a/number/number.c b/number/number.c index 9b551144..60331f35 100644 --- a/number/number.c +++ b/number/number.c @@ -1,4 +1,4 @@ -/* $NetBSD: number.c,v 1.12 2008/07/20 01:03:21 lukem Exp $ */ +/* $NetBSD: number.c,v 1.13 2009/08/12 08:12:20 dholland Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\ #if 0 static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: number.c,v 1.12 2008/07/20 01:03:21 lukem Exp $"); +__RCSID("$NetBSD: number.c,v 1.13 2009/08/12 08:12:20 dholland Exp $"); #endif #endif /* not lint */ @@ -76,14 +76,14 @@ static const char *const name1[] = { "novemdecillion", "vigintillion", }; -void convert(char *); int main(int, char *[]); -int number(const char *, int); -void pfract(int); -int unit(int, const char *); -void usage(void) __dead; +static void convert(char *); +static int number(const char *, int); +static void pfract(int); +static int unit(int, const char *); +static void usage(void) __dead; -int lflag; +static int lflag; int main(argc, argv) |