Module Name: src
Committed By: dholland
Date: Wed Aug 12 08:04:05 UTC 2009
Modified Files:
src/games/larn: bill.c display.c extern.h fortune.c help.c io.c main.c
monster.c movem.c object.c scores.c store.c
Log Message:
sprinkle static
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/larn/bill.c
cvs rdiff -u -r1.8 -r1.9 src/games/larn/display.c
cvs rdiff -u -r1.12 -r1.13 src/games/larn/extern.h
cvs rdiff -u -r1.6 -r1.7 src/games/larn/fortune.c src/games/larn/movem.c
cvs rdiff -u -r1.7 -r1.8 src/games/larn/help.c
cvs rdiff -u -r1.23 -r1.24 src/games/larn/io.c src/games/larn/main.c
cvs rdiff -u -r1.16 -r1.17 src/games/larn/monster.c
cvs rdiff -u -r1.14 -r1.15 src/games/larn/object.c src/games/larn/store.c
cvs rdiff -u -r1.17 -r1.18 src/games/larn/scores.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/larn/bill.c
diff -u src/games/larn/bill.c:1.9 src/games/larn/bill.c:1.10
--- src/games/larn/bill.c:1.9 Sun Feb 3 03:49:15 2008
+++ src/games/larn/bill.c Wed Aug 12 08:04:05 2009
@@ -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 @@
/* 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",
Index: src/games/larn/display.c
diff -u src/games/larn/display.c:1.8 src/games/larn/display.c:1.9
--- src/games/larn/display.c:1.8 Sun Feb 3 19:20:41 2008
+++ src/games/larn/display.c Wed Aug 12 08:04:05 2009
@@ -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 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 @@
* 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 @@
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()
{
Index: src/games/larn/extern.h
diff -u src/games/larn/extern.h:1.12 src/games/larn/extern.h:1.13
--- src/games/larn/extern.h:1.12 Tue Feb 19 06:05:26 2008
+++ src/games/larn/extern.h Wed Aug 12 08:04:05 2009
@@ -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 @@
/* help.c */
void help(void);
void welcome(void);
-void retcont(void);
/* io.c */
void setupvt100(void);
@@ -150,29 +149,9 @@
/* 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 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 @@
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 @@
/* 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 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 @@
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 */
Index: src/games/larn/fortune.c
diff -u src/games/larn/fortune.c:1.6 src/games/larn/fortune.c:1.7
--- src/games/larn/fortune.c:1.6 Mon Jan 28 05:38:53 2008
+++ src/games/larn/fortune.c Wed Aug 12 08:04:05 2009
@@ -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 @@
* 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",
Index: src/games/larn/movem.c
diff -u src/games/larn/movem.c:1.6 src/games/larn/movem.c:1.7
--- src/games/larn/movem.c:1.6 Mon Jan 28 05:38:54 2008
+++ src/games/larn/movem.c Wed Aug 12 08:04:05 2009
@@ -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 @@
* Returns no value.
*/
static int tmpitem, xl, xh, yl, yh;
-void
+static void
movemt(i, j)
int i, j;
{
@@ -269,7 +273,7 @@
* 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 @@
*/
#define SPHMAX 20 /* maximum number of spheres movsphere can
* handle */
-void
+static void
movsphere()
{
int x, y, dir, len;
Index: src/games/larn/help.c
diff -u src/games/larn/help.c:1.7 src/games/larn/help.c:1.8
--- src/games/larn/help.c:1.7 Sun Feb 3 21:24:58 2008
+++ src/games/larn/help.c Wed Aug 12 08:04:05 2009
@@ -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 @@
#include "header.h"
#include "extern.h"
+static void retcont(void);
static int openhelp(void);
/*
@@ -98,7 +99,7 @@
/*
* function to say press return to continue and reset scroll when done
*/
-void
+static void
retcont()
{
cursor(1, 24);
Index: src/games/larn/io.c
diff -u src/games/larn/io.c:1.23 src/games/larn/io.c:1.24
--- src/games/larn/io.c:1.23 Sun Feb 3 21:24:58 2008
+++ src/games/larn/io.c Wed Aug 12 08:04:05 2009
@@ -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 @@
* 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 */
/*
Index: src/games/larn/main.c
diff -u src/games/larn/main.c:1.23 src/games/larn/main.c:1.24
--- src/games/larn/main.c:1.23 Sun Feb 3 21:24:58 2008
+++ src/games/larn/main.c Wed Aug 12 08:04:05 2009
@@ -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 @@
#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 @@
show character's inventory
*/
-void
+static void
showstr()
{
int i, number;
@@ -348,7 +368,7 @@
/*
* subroutine to clear screen depending on # lines to display
*/
-void
+static void
t_setup(count)
int count;
{
@@ -364,7 +384,7 @@
/*
* subroutine to restore normal display screen depending on t_setup()
*/
-void
+static void
t_endup(count)
int count;
{
@@ -379,7 +399,7 @@
/*
function to show the things player is wearing only
*/
-void
+static void
showwear()
{
int i, j, sigsav, count;
@@ -428,7 +448,7 @@
/*
function to show the things player can wield only
*/
-void
+static void
showwield()
{
int i, j, sigsav, count;
@@ -486,7 +506,7 @@
/*
* function to show the things player can read only
*/
-void
+static void
showread()
{
int i, j, sigsav, count;
@@ -518,7 +538,7 @@
/*
* function to show the things player can eat only
*/
-void
+static void
showeat()
{
int i, j, sigsav, count;
@@ -548,7 +568,7 @@
/*
function to show the things player can quaff only
*/
-void
+static void
showquaff()
{
int i, j, sigsav, count;
@@ -575,7 +595,7 @@
t_endup(count);
}
-void
+static void
show1(idx, str2)
int idx;
const char *str2[];
@@ -632,7 +652,7 @@
/*
subroutine to randomly create monsters if needed
*/
-void
+static void
randmonst()
{
if (c[TIMESTOP])
@@ -650,7 +670,7 @@
get and execute a command
*/
-void
+static void
parse()
{
int i, j, k, flag;
@@ -969,7 +989,7 @@
regen();
}
-void
+static void
run(dir)
int dir;
{
@@ -994,7 +1014,7 @@
/*
function to wield a weapon
*/
-void
+static void
wield()
{
int i;
@@ -1032,14 +1052,14 @@
/*
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 @@
/*
function to wear armor
*/
-void
+static void
wear()
{
int i;
@@ -1102,7 +1122,7 @@
/*
function to drop an object
*/
-void
+static void
dropobj()
{
int i;
@@ -1166,7 +1186,7 @@
/*
* readscr() Subroutine to read a scroll one is carrying
*/
-void
+static void
readscr()
{
int i;
@@ -1201,7 +1221,7 @@
/*
* subroutine to eat a cookie one is carrying
*/
-void
+static void
eatcookie(void)
{
const char *p;
@@ -1239,7 +1259,7 @@
/*
* subroutine to quaff a potion one is carrying
*/
-void
+static void
quaff()
{
int i;
Index: src/games/larn/monster.c
diff -u src/games/larn/monster.c:1.16 src/games/larn/monster.c:1.17
--- src/games/larn/monster.c:1.16 Sun Feb 3 21:24:58 2008
+++ src/games/larn/monster.c Wed Aug 12 08:04:05 2009
@@ -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 @@
};
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 @@
* 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 @@
*
* No arguments and no return value
*/
-void
+static void
loseint()
{
if (--c[INTELLIGENCE] < 3)
@@ -652,7 +665,7 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* Enter with the spell number that wants to teleport away
* Returns no value.
*/
-void
+static void
tdirect(spnum)
int spnum;
{
@@ -960,7 +973,7 @@
* 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 @@
* Enter with the spell number in spmun.
* Returns no value.
*/
-void
+static void
dirpoly(spnum)
int spnum;
{
@@ -1154,7 +1167,7 @@
* 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 @@
*
* Enter with the coordinates of the blast, Returns no value
*/
-void
+static void
sphboom(x, y)
int x, y;
{
@@ -1895,7 +1908,7 @@
*
* This is done by setting a flag in the monster[] structure
*/
-void
+static void
genmonst()
{
int i, j;
Index: src/games/larn/object.c
diff -u src/games/larn/object.c:1.14 src/games/larn/object.c:1.15
--- src/games/larn/object.c:1.14 Mon Feb 4 01:07:01 2008
+++ src/games/larn/object.c Wed Aug 12 08:04:05 2009
@@ -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 @@
/*
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 @@
subroutine to process the stair cases
if dir > 0 the up else down
*/
-void
+static void
ostairs(dir)
int dir;
{
@@ -641,7 +656,7 @@
/*
function to process a potion
*/
-void
+static void
opotion(pot)
int pot;
{
@@ -850,7 +865,7 @@
/*
function to process a magic scroll
*/
-void
+static void
oscroll(typ)
int typ;
{
@@ -900,7 +915,7 @@
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 @@
-void
+static void
oorb()
{
}
-void
+static void
opit()
{
int i;
@@ -1116,7 +1131,7 @@
}
}
-void
+static void
obottomless()
{
lprcat("\nYou fell into a bottomless pit!");
@@ -1124,7 +1139,8 @@
nap(3000);
died(262);
}
-void
+
+static void
oelevator(dir)
int dir;
{
@@ -1135,17 +1151,17 @@
#endif /* lint */
}
-void
+static void
ostatue()
{
}
-void
+static void
omirror()
{
}
-void
+static void
obook()
{
lprcat("\nDo you ");
@@ -1197,7 +1213,7 @@
}
}
-void
+static void
ocookie(void)
{
const char *p;
@@ -1235,7 +1251,7 @@
* 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 @@
item[playerx][playery] = know[playerx][playery] = 0; /* destroy gold */
}
-void
+static void
ohome()
{
int i;
Index: src/games/larn/store.c
diff -u src/games/larn/store.c:1.14 src/games/larn/store.c:1.15
--- src/games/larn/store.c:1.14 Sun Feb 3 21:24:59 2008
+++ src/games/larn/store.c Wed Aug 12 08:04:05 2009
@@ -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 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 @@
/*
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 @@
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 @@
}
}
+#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 @@
lprcat("no\nO. K.\n");
}
}
+#endif /* 0 - unused */
+
/*
function for the trading post
*/
@@ -839,8 +843,8 @@
}
}
-void
-cnsitm()
+static void
+cnsitm(void)
{
lprcat("\nSorry, we can't accept unidentified objects.");
}
Index: src/games/larn/scores.c
diff -u src/games/larn/scores.c:1.17 src/games/larn/scores.c:1.18
--- src/games/larn/scores.c:1.17 Sun Feb 3 20:41:53 2008
+++ src/games/larn/scores.c Wed Aug 12 08:04:05 2009
@@ -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 @@
"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 @@
*
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
*/
-int
+static int
writeboard()
{
int i;
@@ -246,7 +256,7 @@
*
* Returns the number of players on scoreboard that were shown
*/
-int
+static int
winshou()
{
struct wscofmt *p;
@@ -285,7 +295,7 @@
* 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 @@
*
* Returns 0 if no sorting done, else returns 1
*/
-int
+static int
sortboard()
{
int i, j = 0, pos;
@@ -429,7 +439,7 @@
* 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 @@
* 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 @@
* 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 @@
* 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;