summaryrefslogtreecommitdiffstats
path: root/hack
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 07:28:40 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 07:28:40 +0000
commit8b1c71ee649fb41155da92995044e451c39ea700 (patch)
tree24e74c8d453828689bfeac45e6162912f3c42d76 /hack
parent31f496067cd42ce5ff71163efa5921ab6522e4aa (diff)
downloadbsdgames-darwin-8b1c71ee649fb41155da92995044e451c39ea700.tar.gz
bsdgames-darwin-8b1c71ee649fb41155da92995044e451c39ea700.tar.zst
bsdgames-darwin-8b1c71ee649fb41155da92995044e451c39ea700.zip
sprinkle static
Diffstat (limited to 'hack')
-rw-r--r--hack/alloc.c8
-rw-r--r--hack/def.func_tab.h6
-rw-r--r--hack/extern.h120
-rw-r--r--hack/hack.bones.c6
-rw-r--r--hack/hack.c11
-rw-r--r--hack/hack.cmd.c21
-rw-r--r--hack/hack.do.c7
-rw-r--r--hack/hack.do_name.c20
-rw-r--r--hack/hack.do_wear.c13
-rw-r--r--hack/hack.dog.c10
-rw-r--r--hack/hack.eat.c24
-rw-r--r--hack/hack.end.c34
-rw-r--r--hack/hack.engrave.c14
-rw-r--r--hack/hack.fight.c8
-rw-r--r--hack/hack.invent.c21
-rw-r--r--hack/hack.ioctl.c6
-rw-r--r--hack/hack.lev.c11
-rw-r--r--hack/hack.main.c7
-rw-r--r--hack/hack.makemon.c6
-rw-r--r--hack/hack.mklev.c64
-rw-r--r--hack/hack.mkmaze.c17
-rw-r--r--hack/hack.mkobj.c6
-rw-r--r--hack/hack.mkshop.c31
-rw-r--r--hack/hack.mon.c31
-rw-r--r--hack/hack.o_init.c11
-rw-r--r--hack/hack.objnam.c15
-rw-r--r--hack/hack.options.c8
-rw-r--r--hack/hack.pager.c17
-rw-r--r--hack/hack.potion.c10
-rw-r--r--hack/hack.pri.c13
-rw-r--r--hack/hack.read.c11
-rw-r--r--hack/hack.rip.c8
-rw-r--r--hack/hack.rumors.c24
-rw-r--r--hack/hack.save.c7
-rw-r--r--hack/hack.shk.c7
-rw-r--r--hack/hack.shknam.c22
-rw-r--r--hack/hack.steal.c12
-rw-r--r--hack/hack.termcap.c17
-rw-r--r--hack/hack.timeout.c10
-rw-r--r--hack/hack.topl.c17
-rw-r--r--hack/hack.track.c10
-rw-r--r--hack/hack.trap.c14
-rw-r--r--hack/hack.tty.c10
-rw-r--r--hack/hack.u_init.c33
-rw-r--r--hack/hack.unix.c13
-rw-r--r--hack/hack.wizard.c10
-rw-r--r--hack/hack.worm.c8
-rw-r--r--hack/hack.worn.c6
-rw-r--r--hack/hack.zap.c28
49 files changed, 443 insertions, 400 deletions
diff --git a/hack/alloc.c b/hack/alloc.c
index 74eaf234..9a972a13 100644
--- a/hack/alloc.c
+++ b/hack/alloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: alloc.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: alloc.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -100,7 +100,8 @@ alloc(unsigned lth)
return ((long *) ptr);
}
-long *
+#if 0 /* unused */
+static long *
enlarge(char *ptr, unsigned lth)
{
char *nptr;
@@ -109,5 +110,6 @@ enlarge(char *ptr, unsigned lth)
panic("Cannot reallocate %d bytes", lth);
return ((long *) nptr);
}
+#endif
#endif /* LINT */
diff --git a/hack/def.func_tab.h b/hack/def.func_tab.h
index 78957e07..d92c3e3d 100644
--- a/hack/def.func_tab.h
+++ b/hack/def.func_tab.h
@@ -1,4 +1,4 @@
-/* $NetBSD: def.func_tab.h,v 1.7 2004/01/27 20:30:29 jsm Exp $ */
+/* $NetBSD: def.func_tab.h,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -68,12 +68,12 @@ struct func_tab {
int (*f_funct)(void);
};
-extern const struct func_tab cmdlist[];
+/*extern const struct func_tab cmdlist[];*/
struct ext_func_tab {
const char *ef_txt;
int (*ef_funct)(void);
};
-extern const struct ext_func_tab extcmdlist[];
+/*extern const struct ext_func_tab extcmdlist[];*/
#endif /* _DEF_FUNC_TAB_H_ */
diff --git a/hack/extern.h b/hack/extern.h
index cb1de38e..e2b67441 100644
--- a/hack/extern.h
+++ b/hack/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.11 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.12 2009/08/12 07:28:40 dholland Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,6 @@
/* alloc.c */
long *alloc(unsigned);
-long *enlarge(char *, unsigned);
/* hack.apply.c */
int doapply(void);
@@ -50,7 +49,6 @@ int getbones(void);
void unsee(void);
void seeoff(int);
void domove(void);
-void movobj(struct obj *, int, int);
int dopickup(void);
void pickup(int);
void lookaround(void);
@@ -67,14 +65,10 @@ void losehp(int, const char *);
void losehp_m(int, struct monst *);
void losexp(void);
int inv_weight(void);
-int inv_cnt(void);
long newuexp(void);
/* hack.cmd.c */
void rhack(const char *);
-int doextcmd(void);
-char lowc(int);
-char unctrl(int);
int movecmd(int);
int getdir(boolean);
void confdir(void);
@@ -85,7 +79,6 @@ int isok(int, int);
/* hack.do.c */
int dodrop(void);
void dropx(struct obj *);
-void dropy(struct obj *);
int doddrop(void);
int dodown(void);
int doup(void);
@@ -101,24 +94,17 @@ void heal_legs(void);
/* hack.do_name.c */
coord getpos(int, const char *);
int do_mname(void);
-void do_oname(struct obj *);
int ddocall(void);
void docall(struct obj *);
-char *xmonnam(struct monst *, int);
-char *lmonnam(struct monst *);
char *monnam(struct monst *);
char *Monnam(struct monst *);
char *amonnam(struct monst *, const char *);
char *Amonnam(struct monst *, const char *);
char *Xmonnam(struct monst *);
-char *visctrl(int);
/* hack.do_wear.c */
-void off_msg(struct obj *);
int doremarm(void);
int doremring(void);
-int dorr(struct obj *);
-int cursed(struct obj *);
int armoroff(struct obj *);
int doweararm(void);
int dowearring(void);
@@ -130,41 +116,26 @@ void corrode_armor(void);
/* hack.dog.c */
void makedog(void);
-void initedog(struct monst *);
void losedogs(void);
void keepdogs(void);
void fall_down(struct monst *);
-int dogfood(struct obj *);
int dog_move(struct monst *, int);
int inroom(xchar, xchar);
int tamedog(struct monst *, struct obj *);
/* hack.eat.c */
void init_uhunger(void);
-int opentin(void);
-int Meatdone(void);
int doeat(void);
void gethungry(void);
void morehungry(int);
void lesshungry(int);
-int unfaint(void);
-void newuhs(boolean);
int poisonous(struct obj *);
-int eatcorpse(struct obj *);
/* hack.end.c */
int dodone(void);
void done1(int);
-void done_intr(int);
-void done_hangup(int);
void done_in_by(struct monst *);
void done(const char *);
-void topten(void);
-void outheader(void);
-struct toptenentry;
-int outentry(int, struct toptenentry *, int);
-char *itoa(int);
-const char *ordin(int);
void clearlocks(void);
void hangup(int) __attribute__((__noreturn__));
char *eos(char *);
@@ -172,7 +143,6 @@ void charcat(char *, int);
void prscore(int, char **);
/* hack.engrave.c */
-struct engr *engr_at(xchar, xchar);
int sengr_at(const char *, xchar, xchar);
void u_wipe_engr(int);
void wipe_engr_at(xchar, xchar, xchar);
@@ -181,12 +151,10 @@ void make_engr_at(int, int, const char *);
int doengrave(void);
void save_engravings(int);
void rest_engravings(int);
-void del_engr(struct engr *);
/* hack.fight.c */
int hitmm(struct monst *, struct monst *);
void mondied(struct monst *);
-void monstone(struct monst *);
int fightm(struct monst *);
int thitu(int, int, const char *);
boolean hmon(struct monst *, struct obj *, int);
@@ -208,21 +176,15 @@ int carrying(int);
struct obj *o_on(unsigned int, struct obj *);
struct trap *t_at(int, int);
struct gold *g_at(int, int);
-struct obj *mkgoldobj(long);
struct obj *getobj(const char *, const char *);
-int ckunpaid(struct obj *);
int ggetobj(const char *, int (*fn)(struct obj *), int);
int askchain(struct obj *, char *, int, int (*)(struct obj *),
int (*)(struct obj *), int);
-char obj_to_let(struct obj *);
void prinv(struct obj *);
int ddoinv(void);
-void doinv(char *);
int dotypeinv(void);
int dolook(void);
void stackobj(struct obj *);
-int merged(struct obj *, struct obj *, int);
-int countgold(void);
int doprgold(void);
int doprwep(void);
int doprarm(void);
@@ -239,8 +201,6 @@ void savelev(int, xchar);
void bwrite(int, const void *, size_t);
void saveobjchn(int, struct obj *);
void savemonchn(int, struct monst *);
-void savegoldchn(int, struct gold *);
-void savetrapchn(int, struct trap *);
void getlev(int, int, xchar);
void mread(int, char *, unsigned);
void mklev(void);
@@ -264,29 +224,12 @@ int mhitu(struct monst *);
int hitu(struct monst *, int);
/* hack.mklev.c */
-void makelevel(void);
-int makerooms(void);
-void addrs(int, int, int, int);
-void addrsx(int, int, int, int, boolean);
struct mkroom;
-int comp(const void *, const void *);
-coord finddpos(int, int, int, int);
-int okdoor(int, int);
-void dodoor(int, int, struct mkroom *);
-void dosdoor(int, int, struct mkroom *, int);
-int maker(schar, schar, schar, schar);
-void makecorridors(void);
-void join(int, int);
-void make_niches(void);
-void makevtele(void);
-void makeniche(boolean);
+void makelevel(void);
void mktrap(int, int, struct mkroom *);
/* hack.mkmaze.c */
void makemaz(void);
-void walkfrom(int, int);
-void move(int *, int *, int);
-int okay(int, int, int);
coord mazexy(void);
/* hack.mkobj.c */
@@ -301,24 +244,14 @@ void mkgold(long, int, int);
/* hack.mkshop.c */
void mkshop(void);
void mkzoo(int);
-const struct permonst *morguemon(void);
void mkswamp(void);
-int nexttodoor(int, int);
-int has_dnstairs(struct mkroom *);
-int has_upstairs(struct mkroom *);
-int isbig(struct mkroom *);
-int dist2(int, int, int, int);
-int sq(int);
/* hack.mon.c */
void movemon(void);
void justswld(struct monst *, const char *);
void youswld(struct monst *, int, int, const char *);
-int dochugw(struct monst *);
int dochug(struct monst *);
int m_move(struct monst *, int);
-void mpickgold(struct monst *);
-void mpickgems(struct monst *);
int mfndpos(struct monst *, coord[9 ], int[9 ], int);
int dist(int, int);
void poisoned(const char *, const char *);
@@ -326,14 +259,12 @@ void mondead(struct monst *);
void replmon(struct monst *, struct monst *);
void relmon(struct monst *);
void monfree(struct monst *);
-void dmonsfree(void);
void unstuck(struct monst *);
void killed(struct monst *);
void kludge(const char *, const char *);
void rescham(void);
int newcham(struct monst *, const struct permonst *);
void mnexto(struct monst *);
-int ishuman(struct monst *);
void setmangry(struct monst *);
int canseemon(struct monst *);
@@ -343,16 +274,12 @@ int canseemon(struct monst *);
int letindex(int);
void init_objects(void);
int probtype(int);
-void setgemprobs(void);
void oinit(void);
void savenames(int);
void restnames(int);
int dodiscovered(void);
-int interesting_to_discover(int);
/* hack.objnam.c */
-char *strprepend(char *, char *);
-char *sitoa(int);
char *typename(int);
char *xname(struct obj *);
char *doname(struct obj *);
@@ -363,22 +290,17 @@ struct obj *readobjnam(char *);
/* hack.options.c */
void initoptions(void);
-void parseoptions(char *, boolean);
int doset(void);
/* hack.pager.c */
int dowhatis(void);
-void intruph(int);
-void page_more(FILE *, int);
void set_whole_screen(void);
int readnews(void);
void set_pager(int);
int page_line(const char *);
void cornline(int, const char *);
int dohelp(void);
-int page_file(const char *, boolean);
int dosh(void);
-int child(int);
/* hack.potion.c */
int dodrink(void);
@@ -387,7 +309,6 @@ void strange_feeling(struct obj *, const char *);
void potionhit(struct monst *, struct obj *);
void potionbreathe(struct obj *);
int dodip(void);
-void ghost_from_bottle(void);
/* hack.pri.c */
void swallowed(void);
@@ -420,31 +341,22 @@ void seemons(void);
void pmon(struct monst *);
void unpmon(struct monst *);
void nscr(void);
-void cornbot(int);
void bot(void);
void mstatusline(struct monst *);
void cls(void);
/* hack.read.c */
int doread(void);
-int identify(struct obj *);
void litroom(boolean);
-int monstersym(int);
/* hack.rip.c */
void outrip(void);
-void center(int, char *);
/* hack.rumors.c */
-void init_rumors(FILE *);
-int skipline(FILE *);
-void outline(FILE *);
void outrumor(void);
-int used(int);
/* hack.save.c */
int dosave(void);
-int dosave0(int);
int dorecover(int);
struct obj *restobjchn(int);
struct monst *restmonchn(int);
@@ -465,7 +377,6 @@ void replshk(struct monst *, struct monst *);
int inshop(void);
int dopay(void);
struct bill_x;
-struct obj *bp_to_obj(struct bill_x *);
void addtobill(struct obj *);
void splitbill(struct obj *, struct obj *);
void subfrombill(struct obj *);
@@ -482,7 +393,6 @@ void findname(char *, int);
/* hack.steal.c */
long somegold(void);
void stealgold(struct monst *);
-int stealarm(void);
int steal(struct monst *);
void mpickobj(struct monst *, struct obj *);
int stealamulet(struct monst *);
@@ -493,10 +403,6 @@ void startup(void);
void start_screen(void);
void end_screen(void);
void curs(int, int);
-void nocmov(int, int);
-void cmov(int, int);
-int xputc(int);
-void xputs(const char *);
void cl_end(void);
void clear_screen(void);
void home(void);
@@ -509,14 +415,11 @@ void cl_eos(void);
/* hack.timeout.c */
void timeout(void);
-void stoned_dialogue(void);
/* hack.topl.c */
int doredotopl(void);
-void redotoplin(void);
void remember_topl(void);
void addtopl(const char *);
-void xmore(const char *);
void more(void);
void cmore(const char *);
void clrlin(void);
@@ -539,10 +442,7 @@ int mintrap(struct monst *);
void selftouch(const char *);
void float_up(void);
void float_down(void);
-void vtele(void);
void tele(void);
-void teleds(int, int);
-int teleok(int, int);
int dotele(void);
void placebc(int);
void unplacebc(void);
@@ -552,7 +452,6 @@ void drown(void);
/* hack.tty.c */
void gettty(void);
void settty(const char *);
-void setctty(void);
void setftty(void);
void error(const char *, ...)
__attribute__((__format__(__printf__, 1, 2),__noreturn__));
@@ -567,14 +466,10 @@ void end_of_input(void) __attribute__((__noreturn__));
/* hack.u_init.c */
void u_init(void);
struct trobj;
-void ini_inv(struct trobj *);
-void wiz_inv(void);
void plnamesuffix(void);
-int role_index(int);
/* hack.unix.c */
void setrandom(void);
-struct tm *getlt(void);
int getyear(void);
char *getdatestr(void);
int phase_of_the_moon(void);
@@ -582,7 +477,6 @@ int night(void);
int midnight(void);
void gethdate(char *);
int uptodate(int);
-int veryold(int);
void getlock(void);
void getmailstatus(void);
void ckmailstatus(void);
@@ -611,8 +505,6 @@ int chwepon(struct obj *, int);
void amulet(void);
int wiz_hit(struct monst *);
void inrange(struct monst *);
-void aggravate(void);
-void clonewiz(struct monst *);
/* hack.worm.c */
#ifndef NOWORM
@@ -626,7 +518,6 @@ void wormsee(unsigned);
struct wseg;
void pwseg(struct wseg *);
void cutworm(struct monst *, xchar, xchar, uchar);
-void remseg(struct wseg *);
#endif
/* hack.worn.c */
@@ -634,8 +525,6 @@ void setworn(struct obj *, long);
void setnotworn(struct obj *);
/* hack.zap.c */
-void bhitm(struct monst *, struct obj *);
-int bhito(struct obj *, struct obj *);
int dozap(void);
const char *exclam(int);
void hit(const char *, struct monst *, const char *);
@@ -645,13 +534,8 @@ struct monst *bhit(int, int, int, int,
int (*)(struct obj *, struct obj *),
struct obj *);
struct monst *boomhit(int, int);
-char dirlet(int, int);
void buzz(int, xchar, xchar, int, int);
-int zhit(struct monst *, int);
-int revive(struct obj *);
-void rloco(struct obj *);
void fracture_rock(struct obj *);
-void burn_scrolls(void);
/* rnd.c */
int rn1(int, int);
diff --git a/hack/hack.bones.c b/hack/hack.bones.c
index 17b05606..49747726 100644
--- a/hack/hack.bones.c
+++ b/hack/hack.bones.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.bones.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.bones.c,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.bones.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.bones.c,v 1.8 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -71,7 +71,7 @@ __RCSID("$NetBSD: hack.bones.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
#include <fcntl.h>
#include <unistd.h>
-char bones[] = "bones_xx";
+static char bones[] = "bones_xx";
/* save bones and possessions of a deceased adventurer */
void
diff --git a/hack/hack.c b/hack/hack.c
index 72c2ee9c..8da2c771 100644
--- a/hack/hack.c
+++ b/hack/hack.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,12 +63,15 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void movobj(struct obj *, int, int);
+static int inv_cnt(void);
+
/*
* called on movement: 1. when throwing ball+chain far away 2. when
* teleporting 3. when walking out of a lit room
@@ -381,7 +384,7 @@ nodrag: ;
read_engr_at(u.ux, u.uy);
}
-void
+static void
movobj(struct obj *obj, int ox, int oy)
{
/* Some dirty programming to get display right */
@@ -947,7 +950,7 @@ inv_weight(void)
return (wt - carrcap);
}
-int
+static int
inv_cnt(void)
{
struct obj *otmp = invent;
diff --git a/hack/hack.cmd.c b/hack/hack.cmd.c
index 49641828..a9e7fc08 100644
--- a/hack/hack.cmd.c
+++ b/hack/hack.cmd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.cmd.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.cmd.c,v 1.10 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,14 +63,16 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.cmd.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.cmd.c,v 1.10 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
#include "def.func_tab.h"
-const struct func_tab cmdlist[] = {
+static int doextcmd(void);
+
+static const struct func_tab cmdlist[] = {
{ '\020', doredotopl },
{ '\022', doredraw },
{ '\024', dotele },
@@ -134,12 +136,15 @@ const struct func_tab cmdlist[] = {
{ 0, 0 }
};
-const struct ext_func_tab extcmdlist[] = {
+static const struct ext_func_tab extcmdlist[] = {
{ "dip", dodip },
{ "pray", dopray },
{ (char *) 0, donull }
};
+static char lowc(int);
+static char unctrl(int);
+
void
rhack(const char *cmd)
{
@@ -241,7 +246,7 @@ rush:
multi = flags.move = 0;
}
-int
+static int
doextcmd(void)
{ /* here after # - now read a full-word
* command */
@@ -262,13 +267,13 @@ doextcmd(void)
return (0);
}
-char
+static char
lowc(int sym)
{
return ((sym >= 'A' && sym <= 'Z') ? sym + 'a' - 'A' : sym);
}
-char
+static char
unctrl(int sym)
{
return ((sym >= ('A' & 037) && sym <= ('Z' & 037)) ? sym + 0140 : sym);
@@ -278,7 +283,7 @@ unctrl(int sym)
char sdir[] = "hykulnjb><";
schar xdir[10] = {-1, -1, 0, 1, 1, 1, 0, -1, 0, 0};
schar ydir[10] = {0, -1, -1, -1, 0, 1, 1, 1, 0, 0};
-schar zdir[10] = {0, 0, 0, 0, 0, 0, 0, 0, 1, -1};
+static schar zdir[10] = {0, 0, 0, 0, 0, 0, 0, 0, 1, -1};
int
movecmd(int sym) /* also sets u.dz, but returns false for <> */
diff --git a/hack/hack.do.c b/hack/hack.do.c
index 103e8a29..d2fe69b5 100644
--- a/hack/hack.do.c
+++ b/hack/hack.do.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.do.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.do.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.do.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
/* Contains code for 'd', 'D' (drop), '>', '<' (up, down) and 't' (throw) */
@@ -76,6 +76,7 @@ __RCSID("$NetBSD: hack.do.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
static int drop(struct obj *);
+static void dropy(struct obj *);
int
dodrop(void)
@@ -127,7 +128,7 @@ dropx(struct obj *obj)
dropy(obj);
}
-void
+static void
dropy(struct obj *obj)
{
if (obj->otyp == CRYSKNIFE)
diff --git a/hack/hack.do_name.c b/hack/hack.do_name.c
index 303330fd..31ca88e5 100644
--- a/hack/hack.do_name.c
+++ b/hack/hack.do_name.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,18 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static void do_oname(struct obj *);
+static char *xmonnam(struct monst *, int);
+static char *lmonnam(struct monst *);
+static char *visctrl(int);
+
coord
getpos(int force, const char *goal)
{
@@ -164,7 +169,7 @@ do_mname(void)
* when there might be pointers around in unknown places. For now: only
* when obj is in the inventory.
*/
-void
+static void
do_oname(struct obj *obj)
{
struct obj *otmp, *otmp2;
@@ -256,14 +261,15 @@ docall(struct obj *obj)
*str1 = str;
}
-const char *const ghostnames[] = {/* these names should have length < PL_NSIZ */
+static const char *const ghostnames[] = {
+ /* these names should have length < PL_NSIZ */
"adri", "andries", "andreas", "bert", "david", "dirk", "emile",
"frans", "fred", "greg", "hether", "jay", "john", "jon", "kay",
"kenny", "maud", "michiel", "mike", "peter", "robert", "ron",
"tom", "wilmar"
};
-char *
+static char *
xmonnam(struct monst *mtmp, int vb)
{
static char buf[BUFSZ]; /* %% */
@@ -302,7 +308,7 @@ xmonnam(struct monst *mtmp, int vb)
return (buf);
}
-char *
+static char *
lmonnam(struct monst *mtmp)
{
return (xmonnam(mtmp, 1));
@@ -355,7 +361,7 @@ Xmonnam(struct monst *mtmp)
return (bp);
}
-char *
+static char *
visctrl(int c)
{
static char ccc[3];
diff --git a/hack/hack.do_wear.c b/hack/hack.do_wear.c
index 6b0ffd1f..35e794a0 100644
--- a/hack/hack.do_wear.c
+++ b/hack/hack.do_wear.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.do_wear.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.do_wear.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,16 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do_wear.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.do_wear.c,v 1.7 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-void
+static int dorr(struct obj *);
+static int cursed(struct obj *);
+
+static void
off_msg(struct obj *otmp)
{
pline("You were wearing %s.", doname(otmp));
@@ -136,7 +139,7 @@ doremring(void)
return (0);
}
-int
+static int
dorr(struct obj *otmp)
{
if (cursed(otmp))
@@ -146,7 +149,7 @@ dorr(struct obj *otmp)
return (1);
}
-int
+static int
cursed(struct obj *otmp)
{
if (otmp->cursed) {
diff --git a/hack/hack.dog.c b/hack/hack.dog.c
index 3bbda261..bc8f88dd 100644
--- a/hack/hack.dog.c
+++ b/hack/hack.dog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.dog.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.dog.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -79,6 +79,8 @@ const struct permonst dog =
const struct permonst la_dog =
{"large dog", 'd', 6, 15, 4, 2, 4, sizeof(struct edog)};
+static void initedog(struct monst *);
+static int dogfood(struct obj *);
void
makedog(void)
@@ -89,7 +91,7 @@ makedog(void)
initedog(mtmp);
}
-void
+static void
initedog(struct monst *mtmp)
{
mtmp->mtame = mtmp->mpeaceful = 1;
@@ -159,7 +161,7 @@ fall_down(struct monst *mtmp)
#define APPORT 4
#define POISON 5
#define UNDEF 6
-int
+static int
dogfood(struct obj *obj)
{
switch (obj->olet) {
diff --git a/hack/hack.eat.c b/hack/hack.eat.c
index b0c01f34..c8fae24f 100644
--- a/hack/hack.eat.c
+++ b/hack/hack.eat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.eat.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,12 +63,12 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.eat.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-char POISONOUS[] = "ADKSVabhks";
+static char POISONOUS[] = "ADKSVabhks";
/* hunger texts used on bottom line (each 8 chars long) */
#define SATIATED 0
@@ -89,6 +89,12 @@ const char *const hu_stat[] = {
"Starved "
};
+static int opentin(void);
+static int Meatdone(void);
+static int unfaint(void);
+static void newuhs(boolean);
+static int eatcorpse(struct obj *);
+
void
init_uhunger(void)
{
@@ -97,7 +103,7 @@ init_uhunger(void)
}
#define TTSZ SIZE(tintxts)
-const struct {
+static const struct {
const char *txt;
int nut;
} tintxts[] = {
@@ -114,7 +120,7 @@ static struct {
int usedtime, reqtime;
} tin;
-int
+static int
opentin(void)
{
int r;
@@ -150,7 +156,7 @@ opentin(void)
return (0);
}
-int
+static int
Meatdone(void)
{
u.usym = '@';
@@ -379,7 +385,7 @@ lesshungry(int num)
newuhs(FALSE);
}
-int
+static int
unfaint(void)
{
u.uhs = FAINTING;
@@ -387,7 +393,7 @@ unfaint(void)
return 0;
}
-void
+static void
newuhs(boolean incr)
{
int newhs, h = u.uhunger;
@@ -453,7 +459,7 @@ poisonous(struct obj *otmp)
}
/* returns 1 if some text was printed */
-int
+static int
eatcorpse(struct obj *otmp)
{
char let = CORPSE_I_TO_C(otmp->otyp);
diff --git a/hack/hack.end.c b/hack/hack.end.c
index f2fcf0de..eef8effb 100644
--- a/hack/hack.end.c
+++ b/hack/hack.end.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.end.c,v 1.12 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.end.c,v 1.13 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.end.c,v 1.12 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.end.c,v 1.13 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@@ -75,6 +75,14 @@ __RCSID("$NetBSD: hack.end.c,v 1.12 2009/06/07 20:13:18 dholland Exp $");
xchar maxdlevel = 1;
+struct toptenentry;
+
+static void topten(void);
+static void outheader(void);
+static int outentry(int, struct toptenentry *, int);
+static char *itoa(int);
+static const char *ordin(int);
+
int
dodone(void)
{
@@ -101,11 +109,11 @@ done1(int n __unused)
/* NOTREACHED */
}
-int done_stopprint;
-int done_hup;
+static int done_stopprint;
+static int done_hup;
/*ARGSUSED*/
-void
+static void
done_intr(int n __unused)
{
done_stopprint++;
@@ -113,7 +121,7 @@ done_intr(int n __unused)
(void) signal(SIGQUIT, SIG_IGN);
}
-void
+static void
done_hangup(int n)
{
done_hup++;
@@ -309,9 +317,11 @@ struct toptenentry {
char name[NAMSZ + 1];
char death[DTHSZ + 1];
char date[7];/* yymmdd */
-} *tt_head;
+};
-void
+static struct toptenentry *tt_head;
+
+static void
topten(void)
{
int uid = getuid();
@@ -478,7 +488,7 @@ unlock:
(void) unlink(reclock);
}
-void
+static void
outheader(void)
{
char linebuf[BUFSZ];
@@ -492,7 +502,7 @@ outheader(void)
}
/* so>0: standout line; so=0: ordinary line; so<0: no output, return length */
-int
+static int
outentry(int rank, struct toptenentry *t1, int so)
{
boolean quit = FALSE, gotkilled = FALSE, starv = FALSE;
@@ -607,7 +617,7 @@ outentry(int rank, struct toptenentry *t1, int so)
return /*(strlen(linebuf))*/ pos;
}
-char *
+static char *
itoa(int a)
{
static char buf[12];
@@ -615,7 +625,7 @@ itoa(int a)
return (buf);
}
-const char *
+static const char *
ordin(int n)
{
int dg = n % 10;
diff --git a/hack/hack.engrave.c b/hack/hack.engrave.c
index c83d1433..33d7a3da 100644
--- a/hack/hack.engrave.c
+++ b/hack/hack.engrave.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.engrave.c,v 1.8 2009/06/07 20:30:49 dholland Exp $ */
+/* $NetBSD: hack.engrave.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.engrave.c,v 1.8 2009/06/07 20:30:49 dholland Exp $");
+__RCSID("$NetBSD: hack.engrave.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -82,9 +82,13 @@ struct engr {
#define DUST 1
#define ENGRAVE 2
#define BURN 3
-} *head_engr;
+};
-struct engr *
+static struct engr *head_engr;
+
+static void del_engr(struct engr *);
+
+static struct engr *
engr_at(xchar x, xchar y)
{
struct engr *ep = head_engr;
@@ -371,7 +375,7 @@ rest_engravings(int fd)
}
}
-void
+static void
del_engr(struct engr *ep)
{
struct engr *ept;
diff --git a/hack/hack.fight.c b/hack/hack.fight.c
index 7cc75159..dc5074cc 100644
--- a/hack/hack.fight.c
+++ b/hack/hack.fight.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.fight.c,v 1.11 2009/06/07 20:31:10 dholland Exp $ */
+/* $NetBSD: hack.fight.c,v 1.12 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.fight.c,v 1.11 2009/06/07 20:31:10 dholland Exp $");
+__RCSID("$NetBSD: hack.fight.c,v 1.12 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -72,6 +72,8 @@ __RCSID("$NetBSD: hack.fight.c,v 1.11 2009/06/07 20:31:10 dholland Exp $");
static boolean far_noise;
static long noisetime;
+static void monstone(struct monst *);
+
/* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */
int
hitmm(struct monst *magr, struct monst *mdef)
@@ -158,7 +160,7 @@ mondied(struct monst *mdef)
}
/* drop a rock and remove monster */
-void
+static void
monstone(struct monst *mdef)
{
if (strchr(mlarge, mdef->data->mlet))
diff --git a/hack/hack.invent.c b/hack/hack.invent.c
index 3d7d8377..8f9f768e 100644
--- a/hack/hack.invent.c
+++ b/hack/hack.invent.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.invent.c,v 1.14 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.invent.c,v 1.14 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <assert.h>
@@ -79,8 +79,9 @@ __RCSID("$NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
static int lastinvnr = 51; /* 0 ... 51 */
-static void assigninvlet(struct obj *);
static char *xprname(struct obj *, char);
+static void doinv(char *);
+static int merged(struct obj *, struct obj *, int);
static void
assigninvlet(struct obj *otmp)
@@ -359,7 +360,7 @@ g_at(int x, int y)
}
/* make dummy object structure containing gold - for temporary use only */
-struct obj *
+static struct obj *
mkgoldobj(long q)
{
struct obj *otmp;
@@ -542,7 +543,7 @@ getobj(const char *let, const char *word)
return (otmp);
}
-int
+static int
ckunpaid(struct obj *otmp)
{
return (otmp->unpaid);
@@ -680,7 +681,7 @@ ret:
}
/* should of course only be called for things in invent */
-char
+static char
obj_to_let(struct obj *obj)
{
struct obj *otmp;
@@ -701,7 +702,7 @@ prinv(struct obj *obj)
pline(xprname(obj, obj_to_let(obj)));
}
-static char *
+static char *
xprname(struct obj *obj, char let)
{
static char li[BUFSZ];
@@ -721,7 +722,7 @@ ddoinv(void)
/* called with 0 or "": all objects in inventory */
/* otherwise: all objects with (serial) letter in lets */
-void
+static void
doinv(char *lets)
{
struct obj *otmp;
@@ -901,7 +902,7 @@ stackobj(struct obj *obj)
}
/* merge obj with otmp and delete obj if types agree */
-int
+static int
merged(struct obj *otmp, struct obj *obj, int lose)
{
if (obj->otyp == otmp->otyp &&
@@ -928,7 +929,7 @@ static long goldcounted;
* it may take a while before you have counted it all.
* [Bug: d$ and pickup still tell you how much it was.]
*/
-int
+static int
countgold(void)
{
if ((goldcounted += 100 * (u.ulevel + 1)) >= u.ugold) {
diff --git a/hack/hack.ioctl.c b/hack/hack.ioctl.c
index 95bb7b9b..776c6aab 100644
--- a/hack/hack.ioctl.c
+++ b/hack/hack.ioctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.ioctl.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.ioctl.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
/*
@@ -74,7 +74,7 @@ __RCSID("$NetBSD: hack.ioctl.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
#include <termios.h>
#include "hack.h"
#include "extern.h"
-struct termios termios;
+static struct termios termios;
void
getioctls(void)
diff --git a/hack/hack.lev.c b/hack/hack.lev.c
index c846d18e..f6eb6176 100644
--- a/hack/hack.lev.c
+++ b/hack/hack.lev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.lev.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.lev.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.lev.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.lev.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -78,6 +78,9 @@ __RCSID("$NetBSD: hack.lev.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
boolean level_exists[MAXLEVEL + 1];
+static void savegoldchn(int, struct gold *);
+static void savetrapchn(int, struct trap *);
+
void
savelev(int fd, xchar lev)
{
@@ -176,7 +179,7 @@ savemonchn(int fd, struct monst *mtmp)
bwrite(fd, (char *) &minusone, sizeof(int));
}
-void
+static void
savegoldchn(int fd, struct gold *gold)
{
struct gold *gold2;
@@ -189,7 +192,7 @@ savegoldchn(int fd, struct gold *gold)
bwrite(fd, nul, sizeof(struct gold));
}
-void
+static void
savetrapchn(int fd, struct trap *trap)
{
struct trap *trap2;
diff --git a/hack/hack.main.c b/hack/hack.main.c
index 05bd88f9..623752c7 100644
--- a/hack/hack.main.c
+++ b/hack/hack.main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.main.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.main.c,v 1.14 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.main.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.main.c,v 1.14 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@@ -90,7 +90,8 @@ const char *catmore; /* default pager */
#endif
char SAVEF[PL_NSIZ + 11] = "save/"; /* save/99999player */
char *hname; /* name of the game (argv[0] of call) */
-char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
+
+static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
int main(int, char *[]);
static void chdirx(const char *, boolean);
diff --git a/hack/hack.makemon.c b/hack/hack.makemon.c
index 9a0821e8..4872426e 100644
--- a/hack/hack.makemon.c
+++ b/hack/hack.makemon.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.makemon.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.makemon.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.makemon.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.makemon.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-struct monst zeromonst;
+static const struct monst zeromonst;
/*
* called with [x,y] = coordinates;
diff --git a/hack/hack.mklev.c b/hack/hack.mklev.c
index bb160fe3..dbf6c8d4 100644
--- a/hack/hack.mklev.c
+++ b/hack/hack.mklev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mklev.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mklev.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <unistd.h>
@@ -78,24 +78,40 @@ __RCSID("$NetBSD: hack.mklev.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
#define XLIM 4 /* define minimum required space around a
* room */
#define YLIM 3
-boolean secret; /* TRUE while making a vault: increase
+static boolean secret; /* TRUE while making a vault: increase
* [XY]LIM */
-int smeq[MAXNROFROOMS + 1];
+static int smeq[MAXNROFROOMS + 1];
+static const struct rm zerorm;
+static schar nxcor;
+static boolean goldseen;
+
int doorindex;
-struct rm zerorm;
-schar nxcor;
-boolean goldseen;
int nroom;
/* Definitions used by makerooms() and addrs() */
#define MAXRS 50 /* max lth of temp rectangle table -
* arbitrary */
-struct rectangle {
+static struct rectangle {
xchar rlx, rly, rhx, rhy;
-} rs[MAXRS + 1];
-int rscnt, rsmax; /* 0..rscnt-1: currently under consideration */
+} rs[MAXRS + 1];
+static int rscnt, rsmax; /* 0..rscnt-1: currently under consideration */
/* rscnt..rsmax: discarded */
+static int makerooms(void);
+static void addrs(int, int, int, int);
+static void addrsx(int, int, int, int, boolean);
+static int comp(const void *, const void *);
+static coord finddpos(int, int, int, int);
+static int okdoor(int, int);
+static void dodoor(int, int, struct mkroom *);
+static void dosdoor(int, int, struct mkroom *, int);
+static int maker(schar, schar, schar, schar);
+static void makecorridors(void);
+static void join(int, int);
+static void make_niches(void);
+static void makevtele(void);
+static void makeniche(boolean);
+
void
makelevel(void)
{
@@ -209,7 +225,7 @@ makelevel(void)
#endif /* QUEST */
}
-int
+static int
makerooms(void)
{
struct rectangle *rsp;
@@ -281,7 +297,7 @@ makerooms(void)
return (0); /* failed to make vault - very strange */
}
-void
+static void
addrs(int lowx, int lowy, int hix, int hiy)
{
struct rectangle *rsp;
@@ -318,7 +334,7 @@ addrs(int lowx, int lowy, int hix, int hiy)
}
/* discarded: piece of a discarded area */
-void
+static void
addrsx(int lx, int ly, int hx, int hy, boolean discarded)
{
struct rectangle *rsp;
@@ -350,7 +366,7 @@ addrsx(int lx, int ly, int hx, int hy, boolean discarded)
rsp->rhy = hy;
}
-int
+static int
comp(const void *vx, const void *vy)
{
const struct mkroom *x = vx, *y = vy;
@@ -359,7 +375,7 @@ comp(const void *vx, const void *vy)
return (x->lx > y->lx);
}
-coord
+static coord
finddpos(int xl, int yl, int xh, int yh)
{
coord ff;
@@ -389,7 +405,7 @@ gotit:
}
/* see whether it is allowable to create a door at [x,y] */
-int
+static int
okdoor(int x, int y)
{
if (levl[x - 1][y].typ == DOOR || levl[x + 1][y].typ == DOOR ||
@@ -402,7 +418,7 @@ okdoor(int x, int y)
return (1);
}
-void
+static void
dodoor(int x, int y, struct mkroom *aroom)
{
if (doorindex >= DOORMAX) {
@@ -414,7 +430,7 @@ dodoor(int x, int y, struct mkroom *aroom)
dosdoor(x, y, aroom, rn2(8) ? DOOR : SDOOR);
}
-void
+static void
dosdoor(int x, int y, struct mkroom *aroom, int type)
{
struct mkroom *broom;
@@ -440,7 +456,7 @@ dosdoor(int x, int y, struct mkroom *aroom, int type)
}
/* Only called from makerooms() */
-int
+static int
maker(schar lowx, schar ddx, schar lowy, schar ddy)
{
struct mkroom *croom;
@@ -524,7 +540,7 @@ chk:
return (1);
}
-void
+static void
makecorridors(void)
{
int a, b;
@@ -549,7 +565,7 @@ makecorridors(void)
}
}
-void
+static void
join(int a, int b)
{
coord cc, tt;
@@ -690,7 +706,7 @@ join(int a, int b)
smeq[a] = smeq[b];
}
-void
+static void
make_niches(void)
{
int ct = rnd(nroom / 2 + 1);
@@ -698,13 +714,13 @@ make_niches(void)
makeniche(FALSE);
}
-void
+static void
makevtele(void)
{
makeniche(TRUE);
}
-void
+static void
makeniche(boolean with_trap)
{
struct mkroom *aroom;
diff --git a/hack/hack.mkmaze.c b/hack/hack.mkmaze.c
index b71d5741..01fb9af3 100644
--- a/hack/hack.mkmaze.c
+++ b/hack/hack.mkmaze.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mkmaze.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkmaze.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,15 +63,20 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkmaze.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkmaze.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
#include "def.mkroom.h" /* not really used */
-const struct permonst hell_hound =
+
+static const struct permonst hell_hound =
{"hell hound", 'd', 12, 14, 2, 3, 6, 0};
+static void walkfrom(int, int);
+static void move(int *, int *, int);
+static int okay(int, int, int);
+
void
makemaz(void)
{
@@ -151,7 +156,7 @@ makemaz(void)
xdnstair = ydnstair = 0;
}
-void
+static void
walkfrom(int x, int y)
{
int q, a, dir;
@@ -172,7 +177,7 @@ walkfrom(int x, int y)
}
}
-void
+static void
move(int *x, int *y, int dir)
{
switch (dir) {
@@ -191,7 +196,7 @@ move(int *x, int *y, int dir)
}
}
-int
+static int
okay(int x, int y, int dir)
{
move(&x, &y, dir);
diff --git a/hack/hack.mkobj.c b/hack/hack.mkobj.c
index b204cdf2..43f6c26c 100644
--- a/hack/hack.mkobj.c
+++ b/hack/hack.mkobj.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mkobj.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkobj.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
+static const char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
struct obj *
mkobj_at(int let, int x, int y)
diff --git a/hack/hack.mkshop.c b/hack/hack.mkshop.c
index 06b16753..7157a37b 100644
--- a/hack/hack.mkshop.c
+++ b/hack/hack.mkshop.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkshop.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkshop.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -72,8 +72,19 @@ __RCSID("$NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
#include "extern.h"
#include "def.mkroom.h"
#include "def.eshk.h"
+
#define ESHK ((struct eshk *)(&(shk->mextra[0])))
-const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50}; /* their probabilities */
+
+/* their probabilities */
+static const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50};
+
+static const struct permonst *morguemon(void);
+static int nexttodoor(int, int);
+static int has_dnstairs(struct mkroom *);
+static int has_upstairs(struct mkroom *);
+static int isbig(struct mkroom *);
+static int dist2(int, int, int, int);
+static int sq(int);
void
mkshop(void)
@@ -273,7 +284,7 @@ mkzoo(int type)
}
}
-const struct permonst *
+static const struct permonst *
morguemon(void)
{
int i = rn2(100), hd = rn2(dlevel);
@@ -313,7 +324,7 @@ mkswamp(void)
}
}
-int
+static int
nexttodoor(int sx, int sy)
{
int dx, dy;
@@ -326,34 +337,34 @@ nexttodoor(int sx, int sy)
return (0);
}
-int
+static int
has_dnstairs(struct mkroom *sroom)
{
return (sroom->lx <= xdnstair && xdnstair <= sroom->hx &&
sroom->ly <= ydnstair && ydnstair <= sroom->hy);
}
-int
+static int
has_upstairs(struct mkroom *sroom)
{
return (sroom->lx <= xupstair && xupstair <= sroom->hx &&
sroom->ly <= yupstair && yupstair <= sroom->hy);
}
-int
+static int
isbig(struct mkroom *sroom)
{
int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly);
return (area > 20);
}
-int
+static int
dist2(int x0, int y0, int x1, int y1)
{
return ((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));
}
-int
+static int
sq(int a)
{
return (a * a);
diff --git a/hack/hack.mon.c b/hack/hack.mon.c
index 8ee9b470..cea68bf0 100644
--- a/hack/hack.mon.c
+++ b/hack/hack.mon.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mon.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mon.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -75,13 +75,20 @@ __RCSID("$NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
#define NULL (char *) 0
#endif
-int warnlevel; /* used by movemon and dochugw */
-long lastwarntime;
-int lastwarnlev;
-const char *const warnings[] = {
+static int warnlevel; /* used by movemon and dochugw */
+static long lastwarntime;
+static int lastwarnlev;
+
+static const char *const warnings[] = {
"white", "pink", "red", "ruby", "purple", "black"
};
+static int dochugw(struct monst *);
+static void mpickgold(struct monst *);
+static void mpickgems(struct monst *);
+static void dmonsfree(void);
+static int ishuman(struct monst *);
+
void
movemon(void)
{
@@ -206,7 +213,7 @@ youswld(struct monst *mtmp, int dam, int die, const char *name)
#endif
}
-int
+static int
dochugw(struct monst *mtmp)
{
int x = mtmp->mx;
@@ -540,7 +547,7 @@ postmov:
return (mmoved);
}
-void
+static void
mpickgold(struct monst *mtmp)
{
struct gold *gold;
@@ -552,7 +559,7 @@ mpickgold(struct monst *mtmp)
}
}
-void
+static void
mpickgems(struct monst *mtmp)
{
struct obj *otmp;
@@ -746,7 +753,7 @@ relmon(struct monst *mon)
* we do not free monsters immediately, in order to have their name available
* shortly after their demise
*/
-struct monst *fdmon; /* chain of dead monsters, need not to be
+static struct monst *fdmon; /* chain of dead monsters, need not to be
* saved */
void
@@ -756,7 +763,7 @@ monfree(struct monst *mtmp)
fdmon = mtmp;
}
-void
+static void
dmonsfree(void)
{
struct monst *mtmp;
@@ -986,7 +993,7 @@ mnexto(struct monst *mtmp)
pmon(mtmp);
}
-int
+static int
ishuman(struct monst *mtmp)
{
return (mtmp->data->mlet == '@');
diff --git a/hack/hack.o_init.c b/hack/hack.o_init.c
index d556203b..804f0a0a 100644
--- a/hack/hack.o_init.c
+++ b/hack/hack.o_init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.o_init.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.o_init.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.o_init.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.o_init.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -72,6 +72,9 @@ __RCSID("$NetBSD: hack.o_init.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
#include "def.objects.h"
#include "hack.onames.h" /* for LAST_GEM */
+static void setgemprobs(void);
+static int interesting_to_discover(int);
+
int
letindex(int let)
{
@@ -148,7 +151,7 @@ probtype(int let)
return (i);
}
-void
+static void
setgemprobs(void)
{
int j, first;
@@ -232,7 +235,7 @@ dodiscovered(void)
return (0);
}
-int
+static int
interesting_to_discover(int i)
{
return (
diff --git a/hack/hack.objnam.c b/hack/hack.objnam.c
index d2123e45..b3eb4679 100644
--- a/hack/hack.objnam.c
+++ b/hack/hack.objnam.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.objnam.c,v 1.9 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.objnam.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.objnam.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.objnam.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -74,7 +74,10 @@ __RCSID("$NetBSD: hack.objnam.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
#define Strcpy (void) strcpy
#define PREFIX 15
-char *
+static char *strprepend(char *, char *);
+static char *sitoa(int);
+
+static char *
strprepend(char *s, char *pref)
{
int i = strlen(pref);
@@ -87,7 +90,7 @@ strprepend(char *s, char *pref)
return (s);
}
-char *
+static char *
sitoa(int a)
{
static char buf[13];
@@ -438,8 +441,8 @@ Doname(struct obj *obj)
return (s);
}
-const char *const wrp[] = {"wand", "ring", "potion", "scroll", "gem"};
-const char wrpsym[] = {WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM};
+static const char *const wrp[] = {"wand", "ring", "potion", "scroll", "gem"};
+static const char wrpsym[] = {WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM};
struct obj *
readobjnam(char *bp)
diff --git a/hack/hack.options.c b/hack/hack.options.c
index e01a0d04..7f0789c1 100644
--- a/hack/hack.options.c
+++ b/hack/hack.options.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.options.c,v 1.9 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.options.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.options.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.options.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -71,6 +71,8 @@ __RCSID("$NetBSD: hack.options.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
#include "hack.h"
#include "extern.h"
+static void parseoptions(char *, boolean);
+
void
initoptions(void)
{
@@ -88,7 +90,7 @@ initoptions(void)
parseoptions(opts, TRUE);
}
-void
+static void
parseoptions(char *opts, boolean from_env)
{
char *op, *op2;
diff --git a/hack/hack.pager.c b/hack/hack.pager.c
index ee474a1e..b72cb99e 100644
--- a/hack/hack.pager.c
+++ b/hack/hack.pager.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.pager.c,v 1.12 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.pager.c,v 1.13 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.pager.c,v 1.12 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.pager.c,v 1.13 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* This file contains the command routine dowhatis() and a pager. */
@@ -79,6 +79,11 @@ __RCSID("$NetBSD: hack.pager.c,v 1.12 2009/06/07 18:30:39 dholland Exp $");
#include "hack.h"
#include "extern.h"
+static void intruph(int);
+static void page_more(FILE *, int);
+static int page_file(const char *, boolean);
+static int child(int);
+
int
dowhatis(void)
{
@@ -129,7 +134,7 @@ dowhatis(void)
/* make the paging of a file interruptible */
static int got_intrup;
-void
+static void
intruph(int n __unused)
{
got_intrup++;
@@ -137,7 +142,7 @@ intruph(int n __unused)
/* simple pager, also used from dohelp() */
/* strip: nr of chars to be stripped from each line (0 or 1) */
-void
+static void
page_more(FILE *fp, int strip)
{
char *bufr, *ep;
@@ -361,7 +366,7 @@ dohelp(void)
}
/* return: 0 - cannot open fnam; 1 - otherwise */
-int
+static int
page_file(const char *fnam, boolean silent)
{
#ifdef DEF_PAGER /* this implies that UNIX is defined */
@@ -452,7 +457,7 @@ union wait { /* used only for the cast (union wait *) 0 */
#endif /* BSD */
#endif /* NOWAITINCLUDE */
-int
+static int
child(int wt)
{
int status;
diff --git a/hack/hack.potion.c b/hack/hack.potion.c
index 147f0a98..5707217b 100644
--- a/hack/hack.potion.c
+++ b/hack/hack.potion.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.potion.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.potion.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,12 +63,14 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.potion.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.potion.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void ghost_from_bottle(void);
+
int
dodrink(void)
{
@@ -290,7 +292,7 @@ strange_feeling(struct obj *obj, const char *txt)
useup(obj);
}
-const char *const bottlenames[] = {
+static const char *const bottlenames[] = {
"bottle", "phial", "flagon", "carafe", "flask", "jar", "vial"
};
@@ -445,7 +447,7 @@ dodip(void)
return (1);
}
-void
+static void
ghost_from_bottle(void)
{
struct monst *mtmp;
diff --git a/hack/hack.pri.c b/hack/hack.pri.c
index 17c70f1e..0db65d56 100644
--- a/hack/hack.pri.c
+++ b/hack/hack.pri.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.pri.c,v 1.11 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.pri.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,14 +63,17 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.pri.c,v 1.11 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.pri.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-xchar scrlx, scrhx, scrly, scrhy; /* corners of new area on
+
+static xchar scrlx, scrhx, scrly, scrhy; /* corners of new area on
* screen */
+static void cornbot(int);
+
void
swallowed(void)
{
@@ -94,7 +97,7 @@ swallowed(void)
/* VARARGS1 */
-boolean panicking;
+static boolean panicking;
void
panic(const char *fmt, ...)
@@ -697,7 +700,7 @@ nscr(void)
}
/* 100 suffices for bot(); no relation with COLNO */
-char oldbot[100], newbot[100];
+static char oldbot[100], newbot[100];
void
cornbot(int lth)
{
diff --git a/hack/hack.read.c b/hack/hack.read.c
index e224a437..3a232eed 100644
--- a/hack/hack.read.c
+++ b/hack/hack.read.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.read.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,16 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.read.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static int identify(struct obj *);
+static int monstersym(int);
+
int
doread(void)
{
@@ -527,7 +530,7 @@ doread(void)
return (1);
}
-int
+static int
identify(struct obj *otmp) /* also called by newmail() */
{
objects[otmp->otyp].oc_name_known = 1;
@@ -624,7 +627,7 @@ do_it:
}
/* Test whether we may genocide all monsters with symbol ch */
-int
+static int
monstersym(int ch) /* arnold@ucsfcgl */
{
const struct permonst *mp;
diff --git a/hack/hack.rip.c b/hack/hack.rip.c
index a0b11671..9c2c199a 100644
--- a/hack/hack.rip.c
+++ b/hack/hack.rip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.rip.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.rip.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -83,6 +83,8 @@ static const char *ripbot = "\
*| * * * | *\n\
_________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______";
+static void center(int, char *);
+
void
outrip(void)
{
@@ -124,7 +126,7 @@ outrip(void)
getret();
}
-void
+static void
center(int line __unused, char *text)
{
int n = strlen(text) / 2;
diff --git a/hack/hack.rumors.c b/hack/hack.rumors.c
index 0a0077c2..b8a3c9b2 100644
--- a/hack/hack.rumors.c
+++ b/hack/hack.rumors.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.rumors.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.rumors.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,17 +63,23 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.rumors.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.rumors.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h" /* for RUMORFILE and BSD (strchr) */
#include "extern.h"
#define CHARSZ 8 /* number of bits in a char */
-int n_rumors = 0;
-int n_used_rumors = -1;
-char *usedbits;
-void
+static int n_rumors = 0;
+static int n_used_rumors = -1;
+static char *usedbits;
+
+static void init_rumors(FILE *);
+static int skipline(FILE *);
+static void outline(FILE *);
+static int used(int);
+
+static void
init_rumors(FILE *rumf)
{
int i;
@@ -87,7 +93,7 @@ init_rumors(FILE *rumf)
usedbits[i] = 0;
}
-int
+static int
skipline(FILE *rumf)
{
char line[COLNO];
@@ -99,7 +105,7 @@ skipline(FILE *rumf)
}
}
-void
+static void
outline(FILE *rumf)
{
char line[COLNO];
@@ -139,7 +145,7 @@ none:
(void) fclose(rumf);
}
-int
+static int
used(int i)
{
return (usedbits[i / CHARSZ] & (1 << (i % CHARSZ)));
diff --git a/hack/hack.save.c b/hack/hack.save.c
index a8a7472e..72722a02 100644
--- a/hack/hack.save.c
+++ b/hack/hack.save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.save.c,v 1.12 2009/06/07 20:25:38 dholland Exp $ */
+/* $NetBSD: hack.save.c,v 1.13 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.save.c,v 1.12 2009/06/07 20:25:38 dholland Exp $");
+__RCSID("$NetBSD: hack.save.c,v 1.13 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@@ -73,6 +73,7 @@ __RCSID("$NetBSD: hack.save.c,v 1.12 2009/06/07 20:25:38 dholland Exp $");
#include "hack.h"
#include "extern.h"
+static int dosave0(int);
int
dosave(void)
@@ -94,7 +95,7 @@ hangup(int n __unused)
#endif /* NOSAVEONHANGUP */
/* returns 1 if save successful */
-int
+static int
dosave0(int hu)
{
int fd, ofd;
diff --git a/hack/hack.shk.c b/hack/hack.shk.c
index 356a37f1..26f860c7 100644
--- a/hack/hack.shk.c
+++ b/hack/hack.shk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.shk.c,v 1.10 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.shk.c,v 1.10 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -77,6 +77,7 @@ static void findshk(int);
static struct bill_x *onbill(struct obj *);
static void pay(long, struct monst *);
static int dopayobj(struct bill_x *);
+static struct obj *bp_to_obj(struct bill_x *);
static int getprice(struct obj *);
static int realhunger(void);
#endif
@@ -629,7 +630,7 @@ paybill(void)
}
/* find obj on one of the lists */
-struct obj *
+static struct obj *
bp_to_obj(struct bill_x *bp)
{
struct obj *obj;
diff --git a/hack/hack.shknam.c b/hack/hack.shknam.c
index de982d73..e503d449 100644
--- a/hack/hack.shknam.c
+++ b/hack/hack.shknam.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.shknam.c,v 1.6 2003/04/02 18:36:40 jsm Exp $ */
+/* $NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.shknam.c,v 1.6 2003/04/02 18:36:40 jsm Exp $");
+__RCSID("$NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-const char *const shkliquors[] = {
+static const char *const shkliquors[] = {
/* Ukraine */
"Njezjin", "Tsjernigof", "Gomel", "Ossipewsk", "Gorlowka",
/* N. Russia */
@@ -84,7 +84,7 @@ const char *const shkliquors[] = {
0
};
-const char *const shkbooks[] = {
+static const char *const shkbooks[] = {
/* Eire */
"Skibbereen", "Kanturk", "Rath Luirc", "Ennistymon", "Lahinch",
"Loughrea", "Croagh", "Maumakeogh", "Ballyjamesduff",
@@ -96,7 +96,7 @@ const char *const shkbooks[] = {
0
};
-const char *const shkarmors[] = {
+static const char *const shkarmors[] = {
/* Turquie */
"Demirci", "Kalecik", "Boyabai", "Yildizeli", "Gaziantep",
"Siirt", "Akhalataki", "Tirebolu", "Aksaray", "Ermenak",
@@ -107,7 +107,7 @@ const char *const shkarmors[] = {
0
};
-const char *const shkwands[] = {
+static const char *const shkwands[] = {
/* Wales */
"Yr Wyddgrug", "Trallwng", "Mallwyd", "Pontarfynach",
"Rhaeader", "Llandrindod", "Llanfair-ym-muallt",
@@ -121,7 +121,7 @@ const char *const shkwands[] = {
0
};
-const char *const shkrings[] = {
+static const char *const shkrings[] = {
/* Hollandse familienamen */
"Feyfer", "Flugi", "Gheel", "Havic", "Haynin", "Hoboken",
"Imbyze", "Juyn", "Kinsky", "Massis", "Matray", "Moy",
@@ -134,7 +134,7 @@ const char *const shkrings[] = {
0
};
-const char *const shkfoods[] = {
+static const char *const shkfoods[] = {
/* Indonesia */
"Djasinga", "Tjibarusa", "Tjiwidej", "Pengalengan",
"Bandjar", "Parbalingga", "Bojolali", "Sarangan",
@@ -146,7 +146,7 @@ const char *const shkfoods[] = {
0
};
-const char *const shkweapons[] = {
+static const char *const shkweapons[] = {
/* Perigord */
"Voulgezac", "Rouffiac", "Lerignac", "Touverac", "Guizengeard",
"Melac", "Neuvicq", "Vanzac", "Picq", "Urignac", "Corignac",
@@ -157,7 +157,7 @@ const char *const shkweapons[] = {
0
};
-const char *const shkgeneral[] = {
+static const char *const shkgeneral[] = {
/* Suriname */
"Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
"Adjama", "Pakka Pakka", "Kabalebo", "Wonotobo",
@@ -175,7 +175,7 @@ const char *const shkgeneral[] = {
0
};
-const struct shk_nx {
+static const struct shk_nx {
char x;
const char *const *xn;
} shk_nx[] = {
diff --git a/hack/hack.steal.c b/hack/hack.steal.c
index 0164609a..06d47bf3 100644
--- a/hack/hack.steal.c
+++ b/hack/hack.steal.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.steal.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,15 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.steal.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static int stealarm(void);
+
/*
* actually returns something that fits in an int
*/
@@ -107,9 +109,9 @@ stealgold(struct monst *mtmp)
}
/* steal armor after he finishes taking it off */
-unsigned stealoid; /* object to be stolen */
-unsigned stealmid; /* monster doing the stealing */
-int
+static unsigned stealoid; /* object to be stolen */
+static unsigned stealmid; /* monster doing the stealing */
+static int
stealarm(void)
{
struct monst *mtmp;
diff --git a/hack/hack.termcap.c b/hack/hack.termcap.c
index 5d847dce..6e7e9662 100644
--- a/hack/hack.termcap.c
+++ b/hack/hack.termcap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.termcap.c,v 1.17 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.termcap.c,v 1.18 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.termcap.c,v 1.17 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.termcap.c,v 1.18 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -82,6 +82,11 @@ static int SG;
char *CD; /* tested in pri.c: docorner() */
int CO, LI; /* used in pri.c and whatis.c */
+static void nocmov(int, int);
+static void cmov(int, int);
+static int xputc(int);
+static void xputs(const char *);
+
void
startup(void)
{
@@ -176,7 +181,7 @@ curs(int x, int y)
cmov(x, y);
}
-void
+static void
nocmov(int x, int y)
{
if (cury > y) {
@@ -224,7 +229,7 @@ nocmov(int x, int y)
}
}
-void
+static void
cmov(int x, int y)
{
char buf[256];
@@ -236,13 +241,13 @@ cmov(int x, int y)
}
}
-int
+static int
xputc(int c)
{
return (fputc(c, stdout));
}
-void
+static void
xputs(const char *s)
{
tputs(s, 1, xputc);
diff --git a/hack/hack.timeout.c b/hack/hack.timeout.c
index 49632f4f..381205c5 100644
--- a/hack/hack.timeout.c
+++ b/hack/hack.timeout.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.timeout.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.timeout.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,12 +63,14 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.timeout.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.timeout.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void stoned_dialogue(void);
+
void
timeout(void)
{
@@ -112,7 +114,7 @@ timeout(void)
}
/* He is being petrified - dialogue by inmet!tower */
-const char *const stoned_texts[] = {
+static const char *const stoned_texts[] = {
"You are slowing down.",/* 5 */
"Your limbs are stiffening.", /* 4 */
"Your limbs have turned to stone.", /* 3 */
@@ -120,7 +122,7 @@ const char *const stoned_texts[] = {
"You are a statue." /* 1 */
};
-void
+static void
stoned_dialogue(void)
{
long i = (Stoned & TIMEOUT);
diff --git a/hack/hack.topl.c b/hack/hack.topl.c
index 138a1db2..e5b8a856 100644
--- a/hack/hack.topl.c
+++ b/hack/hack.topl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,22 +63,25 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
-char toplines[BUFSZ];
-xchar tlx, tly; /* set by pline; used by addtopl */
+static char toplines[BUFSZ];
+static xchar tlx, tly; /* set by pline; used by addtopl */
-struct topl {
+static struct topl {
struct topl *next_topl;
char *topl_text;
} *old_toplines, *last_redone_topl;
#define OTLMAX 20 /* max nr of old toplines remembered */
+static void redotoplin(void);
+static void xmore(const char *);
+
int
doredotopl(void)
{
@@ -93,7 +96,7 @@ doredotopl(void)
return (0);
}
-void
+static void
redotoplin(void)
{
home();
@@ -149,7 +152,7 @@ addtopl(const char *s)
}
/* s = allowed chars besides space/return */
-void
+static void
xmore(const char *s)
{
if (flags.toplin) {
diff --git a/hack/hack.track.c b/hack/hack.track.c
index 2621b4cd..3e36a538 100644
--- a/hack/hack.track.c
+++ b/hack/hack.track.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.track.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.track.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.track.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.track.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -71,9 +71,9 @@ __RCSID("$NetBSD: hack.track.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
#define UTSZ 50
-coord utrack[UTSZ];
-int utcnt = 0;
-int utpnt = 0;
+static coord utrack[UTSZ];
+static int utcnt = 0;
+static int utpnt = 0;
void
initrack(void)
diff --git a/hack/hack.trap.c b/hack/hack.trap.c
index da058edf..b2614555 100644
--- a/hack/hack.trap.c
+++ b/hack/hack.trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.trap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.trap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.trap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.trap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -85,6 +85,10 @@ const char *const traps[] = {
" mimic"
};
+static void vtele(void);
+static void teleds(int, int);
+static int teleok(int, int);
+
struct trap *
maketrap(int x, int y, int typ)
{
@@ -339,7 +343,7 @@ float_down(void)
pickup(1);
}
-void
+static void
vtele(void)
{
struct mkroom *croom;
@@ -383,7 +387,7 @@ tele(void)
teleds(nux, nuy);
}
-void
+static void
teleds(int nux, int nuy)
{
if (Punished)
@@ -409,7 +413,7 @@ teleds(int nux, int nuy)
read_engr_at(u.ux, u.uy);
}
-int
+static int
teleok(int x, int y)
{ /* might throw him into a POOL */
return (isok(x, y) && !IS_ROCK(levl[x][y].typ) && !m_at(x, y) &&
diff --git a/hack/hack.tty.c b/hack/hack.tty.c
index b6027f1d..8d0802b7 100644
--- a/hack/hack.tty.c
+++ b/hack/hack.tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.tty.c,v 1.13 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.tty.c,v 1.14 2009/08/12 07:28:41 dholland Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: hack.tty.c,v 1.13 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.tty.c,v 1.14 2009/08/12 07:28:41 dholland Exp $");
#endif
#endif /* not lint */
@@ -120,7 +120,9 @@ __RCSID("$NetBSD: hack.tty.c,v 1.13 2009/06/07 18:30:39 dholland Exp $");
static char erase_char, kill_char;
static boolean settty_needed = FALSE;
-struct termios inittyb, curttyb;
+static struct termios inittyb, curttyb;
+
+static void setctty(void);
/*
* Get initial state of terminal, set ospeed (for termcap routines)
@@ -162,7 +164,7 @@ settty(const char *s)
setioctls();
}
-void
+static void
setctty(void)
{
if (tcsetattr(0, TCSADRAIN, &curttyb) < 0)
diff --git a/hack/hack.u_init.c b/hack/hack.u_init.c
index 28d3fc40..5bed1e5e 100644
--- a/hack/hack.u_init.c
+++ b/hack/hack.u_init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.u_init.c,v 1.11 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.u_init.c,v 1.11 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <ctype.h>
@@ -77,15 +77,16 @@ __RCSID("$NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
-struct you zerou;
-char pl_character[PL_CSIZ];
-const char *(roles[]) = { /* must all have distinct first letter */
+char pl_character[PL_CSIZ];
+
+static const struct you zerou;
+static const char *(roles[]) = { /* must all have distinct first letter */
/* roles[4] may be changed to -woman */
"Tourist", "Speleologist", "Fighter", "Knight",
"Cave-man", "Wizard"
};
#define NR_OF_ROLES SIZE(roles)
-char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
+static char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
struct trobj {
uchar trotyp;
@@ -96,13 +97,13 @@ struct trobj {
};
#ifdef WIZARD
-struct trobj Extra_objs[] = {
+static struct trobj Extra_objs[] = {
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}
};
#endif /* WIZARD */
-struct trobj Cave_man[] = {
+static struct trobj Cave_man[] = {
{MACE, 1, WEAPON_SYM, 1, 1},
{BOW, 1, WEAPON_SYM, 1, 1},
{ARROW, 0, WEAPON_SYM, 25, 1}, /* quan is variable */
@@ -110,13 +111,13 @@ struct trobj Cave_man[] = {
{0, 0, 0, 0, 0}
};
-struct trobj Fighter[] = {
+static struct trobj Fighter[] = {
{TWO_HANDED_SWORD, 0, WEAPON_SYM, 1, 1},
{RING_MAIL, 0, ARMOR_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Knight[] = {
+static struct trobj Knight[] = {
{LONG_SWORD, 0, WEAPON_SYM, 1, 1},
{SPEAR, 2, WEAPON_SYM, 1, 1},
{RING_MAIL, 1, ARMOR_SYM, 1, 1},
@@ -126,7 +127,7 @@ struct trobj Knight[] = {
{0, 0, 0, 0, 0}
};
-struct trobj Speleologist[] = {
+static struct trobj Speleologist[] = {
{STUDDED_LEATHER_ARMOR, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, 0, POTION_SYM, 2, 0},
{FOOD_RATION, 0, FOOD_SYM, 3, 1},
@@ -135,12 +136,12 @@ struct trobj Speleologist[] = {
{0, 0, 0, 0, 0}
};
-struct trobj Tinopener[] = {
+static struct trobj Tinopener[] = {
{CAN_OPENER, 0, TOOL_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Tourist[] = {
+static struct trobj Tourist[] = {
{UNDEF_TYP, 0, FOOD_SYM, 10, 1},
{POT_EXTRA_HEALING, 0, POTION_SYM, 2, 0},
{EXPENSIVE_CAMERA, 0, TOOL_SYM, 1, 1},
@@ -148,7 +149,7 @@ struct trobj Tourist[] = {
{0, 0, 0, 0, 0}
};
-struct trobj Wizard[] = {
+static struct trobj Wizard[] = {
{ELVEN_CLOAK, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, UNDEF_SPE, WAND_SYM, 2, 0},
{UNDEF_TYP, UNDEF_SPE, RING_SYM, 2, 0},
@@ -157,6 +158,10 @@ struct trobj Wizard[] = {
{0, 0, 0, 0, 0}
};
+static void ini_inv(struct trobj *);
+static void wiz_inv(void);
+static int role_index(int);
+
void
u_init(void)
{
diff --git a/hack/hack.unix.c b/hack/hack.unix.c
index 708e9f79..77db96d7 100644
--- a/hack/hack.unix.c
+++ b/hack/hack.unix.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.unix.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.unix.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* This file collects some Unix dependencies; hack.pager.c contains some more */
@@ -95,6 +95,9 @@ __RCSID("$NetBSD: hack.unix.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
extern int locknum;
+static struct tm *getlt(void);
+static int veryold(int);
+
void
setrandom(void)
@@ -102,7 +105,7 @@ setrandom(void)
(void) srandom((int) time((time_t *) 0));
}
-struct tm *
+static struct tm *
getlt(void)
{
time_t date;
@@ -159,7 +162,7 @@ midnight(void)
return (getlt()->tm_hour == 0);
}
-struct stat buf, hbuf;
+static struct stat buf, hbuf;
void
gethdate(char *name)
@@ -224,7 +227,7 @@ uptodate(int fd)
}
/* see whether we should throw away this xlock file */
-int
+static int
veryold(int fd)
{
int i;
diff --git a/hack/hack.wizard.c b/hack/hack.wizard.c
index f1b5b031..72115382 100644
--- a/hack/hack.wizard.c
+++ b/hack/hack.wizard.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.wizard.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.wizard.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.wizard.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.wizard.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */
@@ -76,7 +76,11 @@ __RCSID("$NetBSD: hack.wizard.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
#define BOLT_LIM 8 /* from this distance D and 1 will try to hit
* you */
-const char wizapp[] = "@DNPTUVXcemntx";
+static const char wizapp[] = "@DNPTUVXcemntx";
+
+static void aggravate(void);
+static void clonewiz(struct monst *);
+
/* If he has found the Amulet, make the wizard appear after some time */
void
diff --git a/hack/hack.worm.c b/hack/hack.worm.c
index 287af018..2a606be1 100644
--- a/hack/hack.worm.c
+++ b/hack/hack.worm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.worm.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worm.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -76,6 +76,8 @@ struct wseg *wsegs[32]; /* linked list, tail first */
struct wseg *wheads[32];
long wgrowtime[32];
+static void remseg(struct wseg *);
+
int
getwn(struct monst *mtmp)
{
@@ -272,7 +274,7 @@ cutworm(struct monst *mtmp, xchar x, xchar y, uchar weptyp)
panic("Cannot find worm segment");
}
-void
+static void
remseg(struct wseg *wtmp)
{
if (wtmp->wdispl)
diff --git a/hack/hack.worn.c b/hack/hack.worn.c
index d0ca0f3b..8333c77f 100644
--- a/hack/hack.worn.c
+++ b/hack/hack.worn.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.worn.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.worn.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worn.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.worn.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-struct worn {
+static struct worn {
long w_mask;
struct obj **w_obj;
} worn[] = {
diff --git a/hack/hack.zap.c b/hack/hack.zap.c
index cfec5768..ebef14cc 100644
--- a/hack/hack.zap.c
+++ b/hack/hack.zap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.zap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,13 +63,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.zap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-const char *const fl[] = {
+static const char *const fl[] = {
"magic missile",
"bolt of fire",
"sleep ray",
@@ -77,9 +77,17 @@ const char *const fl[] = {
"death ray"
};
+static void bhitm(struct monst *, struct obj *);
+static int bhito(struct obj *, struct obj *);
+static char dirlet(int, int);
+static int zhit(struct monst *, int);
+static int revive(struct obj *);
+static void rloco(struct obj *);
+static void burn_scrolls(void);
+
/* Routines for IMMEDIATE wands. */
/* bhitm: monster mtmp was hit by the effect of wand otmp */
-void
+static void
bhitm(struct monst *mtmp, struct obj *otmp)
{
wakeup(mtmp);
@@ -136,7 +144,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
* object obj was hit by the effect of wand otmp
* returns TRUE if sth was done
*/
-int
+static int
bhito(struct obj *obj, struct obj *otmp)
{
int res = TRUE;
@@ -475,7 +483,7 @@ boomhit(int dx, int dy)
return (0);
}
-char
+static char
dirlet(int dx, int dy)
{
return
@@ -638,7 +646,7 @@ buzz(int type, xchar sx, xchar sy, int dx, int dy)
Tmp_at(-1, -1);
}
-int
+static int
zhit(struct monst *mon, int type) /* returns damage to mon */
{
int tmp = 0;
@@ -678,7 +686,7 @@ zhit(struct monst *mon, int type) /* returns damage to mon */
#define CORPSE_I_TO_C(otyp) (char) ((otyp >= DEAD_ACID_BLOB)\
? 'a' + (otyp - DEAD_ACID_BLOB)\
: '@' + (otyp - DEAD_HUMAN))
-int
+static int
revive(struct obj *obj)
{
struct monst *mtmp = NULL;
@@ -695,7 +703,7 @@ revive(struct obj *obj)
return (!!mtmp); /* TRUE if some monster created */
}
-void
+static void
rloco(struct obj *obj)
{
int tx, ty, otx, oty;
@@ -726,7 +734,7 @@ fracture_rock(struct obj *obj)
prl(obj->ox, obj->oy);
}
-void
+static void
burn_scrolls(void)
{
struct obj *obj, *obj2;