From 8916e2056e90ba2c157dfd2b98fb48837d565646 Mon Sep 17 00:00:00 2001 From: dholland Date: Wed, 12 Aug 2009 08:04:05 +0000 Subject: sprinkle static --- larn/bill.c | 6 +++--- larn/display.c | 11 +++++----- larn/extern.h | 68 +--------------------------------------------------------- larn/fortune.c | 6 +++--- larn/help.c | 7 +++--- larn/io.c | 8 +++---- larn/main.c | 64 +++++++++++++++++++++++++++++++++++------------------- larn/monster.c | 43 ++++++++++++++++++++++++------------- larn/movem.c | 14 +++++++----- larn/object.c | 50 +++++++++++++++++++++++++++--------------- larn/scores.c | 32 +++++++++++++++++---------- larn/store.c | 32 +++++++++++++++------------ 12 files changed, 172 insertions(+), 169 deletions(-) (limited to 'larn') 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 #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 #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 @@ -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); diff --git a/larn/io.c b/larn/io.c index 0186d0a8..f9495afc 100644 --- a/larn/io.c +++ b/larn/io.c @@ -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 #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 #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 @@ -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 #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 @@ -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 #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 #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 #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 #include @@ -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."); } -- cgit v1.2.3-56-ge451