summaryrefslogtreecommitdiffstats
path: root/larn
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2012-06-19 05:30:43 +0000
committerdholland <dholland@NetBSD.org>2012-06-19 05:30:43 +0000
commit60030fd11e6c646dbc35c5254b2520d5af45288f (patch)
tree2d9c57e3deb2afa23793d42c8ba11c5b98398282 /larn
parent98b4affa216164b77e59278a2b1cdc3deee77716 (diff)
downloadbsdgames-darwin-60030fd11e6c646dbc35c5254b2520d5af45288f.tar.gz
bsdgames-darwin-60030fd11e6c646dbc35c5254b2520d5af45288f.tar.zst
bsdgames-darwin-60030fd11e6c646dbc35c5254b2520d5af45288f.zip
WARNS=5
Diffstat (limited to 'larn')
-rw-r--r--larn/create.c49
-rw-r--r--larn/diag.c10
-rw-r--r--larn/display.c36
-rw-r--r--larn/global.c72
-rw-r--r--larn/help.c10
-rw-r--r--larn/io.c75
-rw-r--r--larn/main.c60
-rw-r--r--larn/monster.c85
-rw-r--r--larn/moreobj.c22
-rw-r--r--larn/movem.c14
-rw-r--r--larn/nap.c7
-rw-r--r--larn/object.c54
-rw-r--r--larn/regen.c6
-rw-r--r--larn/savelev.c8
-rw-r--r--larn/scores.c46
-rw-r--r--larn/signal.c20
-rw-r--r--larn/store.c31
-rw-r--r--larn/tok.c13
18 files changed, 259 insertions, 359 deletions
diff --git a/larn/create.c b/larn/create.c
index af72ca2a..440b9184 100644
--- a/larn/create.c
+++ b/larn/create.c
@@ -1,10 +1,10 @@
-/* $NetBSD: create.c,v 1.11 2008/02/03 19:29:50 dholland Exp $ */
+/* $NetBSD: create.c,v 1.12 2012/06/19 05:30:43 dholland Exp $ */
/* create.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: create.c,v 1.11 2008/02/03 19:29:50 dholland Exp $");
+__RCSID("$NetBSD: create.c,v 1.12 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -29,7 +29,7 @@ static void checkgen(void);
this is called at the beginning of a game and at no other time
*/
void
-makeplayer()
+makeplayer(void)
{
int i;
scbr();
@@ -72,8 +72,7 @@ makeplayer()
Note that it is here we remove genocided monsters from the present level.
*/
void
-newcavelevel(x)
- int x;
+newcavelevel(int x)
{
int i, j;
if (beenhere[level])
@@ -116,8 +115,7 @@ newcavelevel(x)
static int mx, mxl, mxh, my, myl, myh, tmp2;
static void
-makemaze(k)
- int k;
+makemaze(int k)
{
int i, j, tmp;
int z;
@@ -177,8 +175,7 @@ makemaze(k)
function to eat away a filled in maze
*/
void
-eat(xx, yy)
- int xx, yy;
+eat(int xx, int yy)
{
int dir, try;
dir = rnd(4);
@@ -241,8 +238,7 @@ eat(xx, yy)
* - random object
*/
static int
-cannedlevel(k)
- int k;
+cannedlevel(int k)
{
char *row;
int i, j;
@@ -318,8 +314,7 @@ cannedlevel(k)
level V3 has potion of cure dianthroritis and demon prince
*/
static void
-treasureroom(lv)
- int lv;
+treasureroom(int lv)
{
int tx, ty, xsize, ysize;
@@ -341,8 +336,7 @@ treasureroom(lv)
* the coordinate given is that of the upper left corner of the room
*/
static void
-troom(lv, xsize, ysize, tx, ty, glyph)
- int lv, xsize, ysize, tx, ty, glyph;
+troom(int lv, int xsize, int ysize, int tx, int ty, int glyph)
{
int i, j;
int tp1, tp2;
@@ -399,8 +393,7 @@ troom(lv, xsize, ysize, tx, ty, glyph)
subroutine to create the objects in the maze for the given level
*/
static void
-makeobject(j)
- int j;
+makeobject(int j)
{
int i;
if (j == 0) {
@@ -493,11 +486,13 @@ makeobject(j)
*/
static void
-fillmroom(n, what, arg)
- int n, arg;
- char what;
+fillmroom(int n, int what_i, int arg)
{
int i;
+ char what;
+
+ /* truncate to char width (just in case it matters) */
+ what = (char)what_i;
for (i = 0; i < n; i++)
fillroom(what, arg);
}
@@ -514,11 +509,13 @@ froom(int n, int theitem, int arg)
* uses a random walk
*/
static void
-fillroom(what, arg)
- int arg;
- char what;
+fillroom(int what_i, int arg)
{
int x, y;
+ char what;
+
+ /* truncate to char width (just in case it matters) */
+ what = (char)what_i;
#ifdef EXTRA
c[FILLROOM]++;
@@ -552,8 +549,7 @@ fillroom(what, arg)
monsters
*/
int
-fillmonst(what)
- int what;
+fillmonst(int what)
{
int x, y, trys;
for (trys = 5; trys > 0; --trys) { /* max # of creation attempts */
@@ -575,8 +571,7 @@ fillmonst(what)
if sethp(1) then wipe out old monsters else leave them there
*/
static void
-sethp(flg)
- int flg;
+sethp(int flg)
{
int i, j;
if (flg)
diff --git a/larn/diag.c b/larn/diag.c
index 43f1ff64..a3482c1d 100644
--- a/larn/diag.c
+++ b/larn/diag.c
@@ -1,9 +1,9 @@
-/* $NetBSD: diag.c,v 1.12 2008/02/03 19:20:41 dholland Exp $ */
+/* $NetBSD: diag.c,v 1.13 2012/06/19 05:30:43 dholland Exp $ */
/* diag.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: diag.c,v 1.12 2008/02/03 19:20:41 dholland Exp $");
+__RCSID("$NetBSD: diag.c,v 1.13 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -176,8 +176,7 @@ diagdrawscreen()
*/
static time_t zzz = 0;
int
-savegame(fname)
- char *fname;
+savegame(char *fname)
{
int i, k;
struct sphere *sp;
@@ -242,8 +241,7 @@ savegame(fname)
}
void
-restoregame(fname)
- char *fname;
+restoregame(char *fname)
{
int i, k;
struct sphere *sp, *sp2;
diff --git a/larn/display.c b/larn/display.c
index e6f54b02..7d437495 100644
--- a/larn/display.c
+++ b/larn/display.c
@@ -1,9 +1,9 @@
-/* $NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: display.c,v 1.10 2012/06/19 05:30:43 dholland Exp $ */
/* display.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: display.c,v 1.10 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -26,26 +26,26 @@ static char always = 0;
now for the bottom line of the display
*/
void
-bottomline()
+bottomline(void)
{
recalc();
bot1f = 1;
}
void
-bottomhp()
+bottomhp(void)
{
bot2f = 1;
}
void
-bottomspell()
+bottomspell(void)
{
bot3f = 1;
}
void
-bottomdo()
+bottomdo(void)
{
if (bot1f) {
bot3f = bot1f = bot2f = 0;
@@ -63,7 +63,7 @@ bottomdo()
}
void
-bot_linex()
+bot_linex(void)
{
int i;
if (cbak[SPELLS] <= -50 || (always)) {
@@ -142,7 +142,7 @@ bot_linex()
called from ogold()
*/
void
-bottomgold()
+bottomgold(void)
{
botsub(makecode(GOLD, 69, 19), "%-6ld");
/* botsub(GOLD,"%-6ld",69,19); */
@@ -244,8 +244,7 @@ botsub(int idx, const char *str)
static int d_xmin = 0, d_xmax = MAXX, d_ymin = 0, d_ymax = MAXY;
void
-draws(xmin, xmax, ymin, ymax)
- int xmin, xmax, ymin, ymax;
+draws(int xmin, int xmax, int ymin, int ymax)
{
int i, idx;
if (xmin == 0 && xmax == MAXX) { /* clear section of screen as
@@ -283,7 +282,7 @@ draws(xmin, xmax, ymin, ymax)
u_char screen[MAXX][MAXY]; /* template for the screen */
static u_char d_flag;
void
-drawscreen()
+drawscreen(void)
{
int i, j, kk;
int lastx, lasty; /* variables used to optimize the
@@ -376,8 +375,7 @@ drawscreen()
subroutine to display a cell location on the screen
*/
void
-showcell(x, y)
- int x, y;
+showcell(int x, int y)
{
int i, j, kk, mm;
if (c[BLINDCOUNT])
@@ -441,8 +439,7 @@ showcell(x, y)
used in godirect() in monster.c for missile weapons display
*/
void
-show1cell(x, y)
- int x, y;
+show1cell(int x, int y)
{
if (c[BLINDCOUNT])
return; /* see nothing if blind */
@@ -475,7 +472,7 @@ show1cell(x, y)
cursor values start from 1 up
*/
void
-showplayer()
+showplayer(void)
{
cursor(playerx + 1, playery + 1);
oldx = playerx;
@@ -494,8 +491,8 @@ showplayer()
short diroffx[] = {0, 0, 1, 0, -1, 1, -1, 1, -1};
short diroffy[] = {0, 1, 0, -1, 0, -1, -1, 1, 1};
int
-moveplayer(dir)
- int dir; /* from = present room # direction =
+moveplayer(int dir)
+ /* from = present room # direction =
* [1-north] [2-east] [3-south] [4-west]
* [5-northeast] [6-northwest] [7-southeast]
* [8-southwest] if direction=0, don't
@@ -550,8 +547,7 @@ moveplayer(dir)
*/
static int lincount, count;
void
-seemagic(arg)
- int arg;
+seemagic(int arg)
{
int i, number = 0;
count = lincount = 0;
diff --git a/larn/global.c b/larn/global.c
index 54d34af7..013aa6f6 100644
--- a/larn/global.c
+++ b/larn/global.c
@@ -1,4 +1,4 @@
-/* $NetBSD: global.c,v 1.13 2012/02/18 06:57:23 matt Exp $ */
+/* $NetBSD: global.c,v 1.14 2012/06/19 05:30:43 dholland Exp $ */
/*
* global.c Larn is copyrighted 1986 by Noah Morgan.
@@ -21,7 +21,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: global.c,v 1.13 2012/02/18 06:57:23 matt Exp $");
+__RCSID("$NetBSD: global.c,v 1.14 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -42,7 +42,7 @@ extern const char *password;
uses c[EXPERIENCE] c[LEVEL]
*/
void
-raiselevel()
+raiselevel(void)
{
if (c[LEVEL] < MAXPLEVEL)
raiseexperience((long) (skill[c[LEVEL]] - c[EXPERIENCE]));
@@ -54,7 +54,7 @@ raiselevel()
subroutine to lower the players character level by one
*/
void
-loselevel()
+loselevel(void)
{
if (c[LEVEL] > 1)
loseexperience((long) (c[EXPERIENCE] - skill[c[LEVEL] - 1] + 1));
@@ -66,8 +66,7 @@ loselevel()
subroutine to increase experience points
*/
void
-raiseexperience(x)
- long x;
+raiseexperience(long x)
{
int i, tmp;
i = c[LEVEL];
@@ -94,8 +93,7 @@ raiseexperience(x)
subroutine to lose experience points
*/
void
-loseexperience(x)
- long x;
+loseexperience(long x)
{
int i, tmp;
i = c[LEVEL];
@@ -127,8 +125,7 @@ loseexperience(x)
warning -- will kill player if hp goes to zero
*/
void
-losehp(x)
- int x;
+losehp(int x)
{
if ((c[HP] -= x) <= 0) {
beep();
@@ -139,8 +136,7 @@ losehp(x)
}
void
-losemhp(x)
- int x;
+losemhp(int x)
{
c[HP] -= x;
if (c[HP] < 1)
@@ -157,16 +153,14 @@ losemhp(x)
subroutine to gain maximum hit points
*/
void
-raisehp(x)
- int x;
+raisehp(int x)
{
if ((c[HP] += x) > c[HPMAX])
c[HP] = c[HPMAX];
}
void
-raisemhp(x)
- int x;
+raisemhp(int x)
{
c[HPMAX] += x;
c[HP] += x;
@@ -178,8 +172,7 @@ raisemhp(x)
subroutine to gain maximum spells
*/
void
-raisemspells(x)
- int x;
+raisemspells(int x)
{
c[SPELLMAX] += x;
c[SPELLS] += x;
@@ -191,8 +184,7 @@ raisemspells(x)
subroutine to lose maximum spells
*/
void
-losemspells(x)
- int x;
+losemspells(int x)
{
if ((c[SPELLMAX] -= x) < 0)
c[SPELLMAX] = 0;
@@ -208,8 +200,7 @@ losemspells(x)
for the given cave level
*/
int
-makemonst(lev)
- int lev;
+makemonst(int lev)
{
int tmp, x;
if (lev < 1)
@@ -235,7 +226,7 @@ makemonst(lev)
function to be sure player is not in a wall
*/
void
-positionplayer()
+positionplayer(void)
{
int try;
try = 2;
@@ -255,7 +246,7 @@ positionplayer()
recalc() function to recalculate the armor class of the player
*/
void
-recalc()
+recalc(void)
{
int i, j, k;
c[AC] = c[MOREDEFENSES];
@@ -381,7 +372,7 @@ recalc()
subroutine to ask if the player really wants to quit
*/
void
-quit()
+quit(void)
{
int i;
cursors();
@@ -414,7 +405,7 @@ quit()
function to ask --more-- then the user must enter a space
*/
void
-more()
+more(void)
{
lprcat("\n --- press ");
standout("space");
@@ -496,8 +487,7 @@ take(int theitem, int arg)
returns 1 if something there already else 0
*/
int
-drop_object(k)
- int k;
+drop_object(int k)
{
int theitem;
if ((k < 0) || (k > 25))
@@ -538,7 +528,7 @@ drop_object(k)
function to enchant armor player is currently wearing
*/
void
-enchantarmor()
+enchantarmor(void)
{
int tmp;
if (c[WEAR] < 0) {
@@ -568,7 +558,7 @@ enchantarmor()
function to enchant a weapon presently being wielded
*/
void
-enchweapon()
+enchweapon(void)
{
int tmp;
if (c[WIELD] < 0) {
@@ -596,7 +586,7 @@ enchweapon()
returns 1 if pockets are full, else 0
*/
int
-pocketfull()
+pocketfull(void)
{
int i, limit;
if ((limit = 15 + (c[LEVEL] >> 1)) > 26)
@@ -611,7 +601,7 @@ pocketfull()
function to return 1 if a monster is next to the player else returns 0
*/
int
-nearbymonst()
+nearbymonst(void)
{
int tmp, tmp2;
for (tmp = playerx - 1; tmp < playerx + 2; tmp++)
@@ -626,7 +616,7 @@ nearbymonst()
returns 1 if steals something else returns 0
*/
int
-stealsomething()
+stealsomething(void)
{
int i, j;
j = 100;
@@ -651,7 +641,7 @@ stealsomething()
function to return 1 is player carrys nothing else return 0
*/
int
-emptyhanded()
+emptyhanded(void)
{
int i;
for (i = 0; i < 26; i++)
@@ -667,7 +657,7 @@ emptyhanded()
function to create a gem on a square near the player
*/
void
-creategem()
+creategem(void)
{
int i, j;
switch (rnd(4)) {
@@ -755,7 +745,7 @@ adjustcvalues(int theitem, int arg)
*/
static char gpwbuf[33];
int
-getpassword()
+getpassword(void)
{
int i, j;
char *gpwp;
@@ -781,7 +771,7 @@ getpassword()
returns y or n
*/
int
-getyn()
+getyn(void)
{
int i;
i = 0;
@@ -795,7 +785,7 @@ getyn()
returns the number of pounds the player is carrying
*/
int
-packweight()
+packweight(void)
{
int i, j, k;
k = c[GOLD] / 1000;
@@ -858,15 +848,13 @@ packweight()
#ifndef MACRORND
/* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
int
-rnd(x)
- int x;
+rnd(int x)
{
return ((((randx = randx * 1103515245 + 12345) >> 7) % (x)) + 1);
}
int
-rund(x)
- int x;
+rund(int x)
{
return ((((randx = randx * 1103515245 + 12345) >> 7) % (x)));
}
diff --git a/larn/help.c b/larn/help.c
index 76827a5a..477052cb 100644
--- a/larn/help.c
+++ b/larn/help.c
@@ -1,9 +1,9 @@
-/* $NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: help.c,v 1.9 2012/06/19 05:30:43 dholland Exp $ */
/* help.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: help.c,v 1.9 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <unistd.h>
@@ -24,7 +24,7 @@ static int openhelp(void);
* pages of help text (23 lines per page)
*/
void
-help()
+help(void)
{
int i, j;
#ifndef VT100
@@ -73,7 +73,7 @@ help()
* function to display the welcome message and background
*/
void
-welcome()
+welcome(void)
{
int i;
#ifndef VT100
@@ -100,7 +100,7 @@ welcome()
* function to say press return to continue and reset scroll when done
*/
static void
-retcont()
+retcont(void)
{
cursor(1, 24);
lprcat("Press ");
diff --git a/larn/io.c b/larn/io.c
index b2a9fb89..245ce8a4 100644
--- a/larn/io.c
+++ b/larn/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.26 2011/10/03 12:32:28 roy Exp $ */
+/* $NetBSD: io.c,v 1.27 2012/06/19 05:30:43 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.26 2011/10/03 12:32:28 roy Exp $");
+__RCSID("$NetBSD: io.c,v 1.27 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -144,7 +144,7 @@ static char lgetwbuf[LINBUFSIZE]; /* get line (word) buffer */
* Attributes off, clear screen, set scrolling region, set tty mode
*/
void
-setupvt100()
+setupvt100(void)
{
clear();
setscroll();
@@ -157,7 +157,7 @@ setupvt100()
* Attributes off, clear screen, unset scrolling region, restore tty mode
*/
void
-clearvt100()
+clearvt100(void)
{
resetscroll();
clear();
@@ -168,7 +168,7 @@ clearvt100()
* ttgetch() Routine to read in one character from the terminal
*/
int
-ttgetch()
+ttgetch(void)
{
char byt;
#ifdef EXTRA
@@ -185,7 +185,7 @@ ttgetch()
* like: system("stty cbreak -echo")
*/
void
-scbr()
+scbr(void)
{
gtty(0, &ttx);
doraw(ttx);
@@ -198,7 +198,7 @@ scbr()
* like: system("stty -cbreak echo")
*/
void
-sncbr()
+sncbr(void)
{
gtty(0, &ttx);
unraw(ttx);
@@ -209,7 +209,7 @@ sncbr()
* newgame() Subroutine to save the initial time and seed rnd()
*/
void
-newgame()
+newgame(void)
{
long *p, *pe;
for (p = c, pe = c + 100; p < pe; *p++ = 0);
@@ -265,8 +265,7 @@ lprintf(const char *fmt, ...)
* Returns nothing of value.
*/
void
-lprint(x)
- long x;
+lprint(long x)
{
if (lpnt >= lpend)
lflush();
@@ -285,9 +284,7 @@ lprint(x)
* Returns nothing of value
*/
void
-lwrite(buf, len)
- char *buf;
- int len;
+lwrite(char *buf, int len)
{
char *s;
u_char *t;
@@ -327,7 +324,7 @@ lwrite(buf, len)
* Returns 0 if EOF, otherwise the character
*/
long
-lgetc()
+lgetc(void)
{
int i;
if (ipoint != iepoint)
@@ -359,7 +356,7 @@ lgetc()
* Returns the int read
*/
long
-larn_lrint()
+larn_lrint(void)
{
unsigned long i;
i = 255 & lgetc();
@@ -378,9 +375,7 @@ larn_lrint()
* Returns nothing of value
*/
void
-lrfill(adr, num)
- char *adr;
- int num;
+lrfill(char *adr, int num)
{
u_char *pnt;
int num2;
@@ -415,7 +410,7 @@ lrfill(adr, num)
* Returns pointer to a buffer that contains word. If EOF, returns a NULL
*/
char *
-lgetw()
+lgetw(void)
{
char *lgp, cc;
int n = LINBUFSIZE, quote = 0;
@@ -443,7 +438,7 @@ lgetw()
* Returns pointer to a buffer that contains the line. If EOF, returns NULL
*/
char *
-lgetl()
+lgetl(void)
{
int i = LINBUFSIZE, ch;
char *str = lgetwbuf;
@@ -467,8 +462,7 @@ lgetl()
* Returns -1 if error, otherwise the file descriptor opened.
*/
int
-lcreat(str)
- char *str;
+lcreat(char *str)
{
lflush();
lpnt = lpbuf;
@@ -493,8 +487,7 @@ lcreat(str)
* Returns -1 if error, otherwise the file descriptor opened.
*/
int
-lopen(str)
- char *str;
+lopen(char *str)
{
ipoint = iepoint = MAXIBUF;
if (str == NULL)
@@ -516,8 +509,7 @@ lopen(str)
* Returns -1 if error, otherwise the file descriptor opened.
*/
int
-lappend(str)
- char *str;
+lappend(char *str)
{
lpnt = lpbuf;
lpend = lpbuf + BUFBIG;
@@ -537,7 +529,7 @@ lappend(str)
* Returns nothing of value.
*/
void
-lrclose()
+lrclose(void)
{
if (io_infd > 0) {
close(io_infd);
@@ -551,7 +543,7 @@ lrclose()
* Returns nothing of value.
*/
void
-lwclose()
+lwclose(void)
{
lflush();
if (io_outfd > 2) {
@@ -621,8 +613,7 @@ cursor(x, y)
* cursor(x,y) Put cursor at specified coordinates staring at [1,1] (termcap)
*/
void
-cursor(x, y)
- int x, y;
+cursor(int x, int y)
{
if (lpnt >= lpend)
lflush();
@@ -637,7 +628,7 @@ cursor(x, y)
* Routine to position cursor at beginning of 24th line
*/
void
-cursors()
+cursors(void)
{
cursor(1, 24);
}
@@ -655,7 +646,7 @@ static char *outbuf = 0; /* translated output buffer */
* init_term() Terminal initialization -- setup termcap info
*/
void
-init_term()
+init_term(void)
{
setupterm(NULL, 0, NULL); /* will exit if invalid term */
if (!cursor_address) {
@@ -683,8 +674,7 @@ init_term()
* cl_line(x,y) Clear the whole line indicated by 'y' and leave cursor at [x,y]
*/
void
-cl_line(x, y)
- int x, y;
+cl_line(int x, int y)
{
#ifdef VT100
cursor(x, y);
@@ -700,8 +690,7 @@ cl_line(x, y)
* cl_up(x,y) Clear screen from [x,1] to current position. Leave cursor at [x,y]
*/
void
-cl_up(x, y)
- int x, y;
+cl_up(int x, int y)
{
#ifdef VT100
cursor(x, y);
@@ -721,8 +710,7 @@ cl_up(x, y)
* cl_dn(x,y) Clear screen from [1,y] to end of display. Leave cursor at [x,y]
*/
void
-cl_dn(x, y)
- int x, y;
+cl_dn(int x, int y)
{
#ifdef VT100
cursor(x, y);
@@ -767,7 +755,7 @@ standout(const char *str)
* set_score_output() Called when output should be literally printed.
*/
void
-set_score_output()
+set_score_output(void)
{
enable_scroll = -1;
}
@@ -783,7 +771,7 @@ set_score_output()
static int scrline = 18; /* line # for wraparound instead of scrolling
* if no DL */
void
-lflush()
+lflush(void)
{
int lpoint;
u_char *str;
@@ -931,7 +919,7 @@ ttputch(int ch)
* flush_buf() Flush buffer with decoded output.
*/
static void
-flush_buf()
+flush_buf(void)
{
if (vindex)
write(io_outfd, outbuf, vindex);
@@ -944,8 +932,7 @@ flush_buf()
* Processes only the \33[#m sequence (converts . files for termcap use
*/
char *
-tmcapcnv(sd, ss)
- char *sd, *ss;
+tmcapcnv(char *sd, char *ss)
{
int tmstate = 0; /* 0=normal, 1=\33 2=[ 3=# */
char tmdigit = 0; /* the # in \33[#m */
@@ -997,7 +984,7 @@ tmcapcnv(sd, ss)
* beep() Routine to emit a beep if enabled (see no-beep in .larnopts)
*/
void
-beep()
+beep(void)
{
if (!nobeep)
*lpnt++ = '\7';
diff --git a/larn/main.c b/larn/main.c
index b74d1fac..1b442d6d 100644
--- a/larn/main.c
+++ b/larn/main.c
@@ -1,9 +1,9 @@
-/* $NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $ */
/* main.c */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -75,9 +75,7 @@ static char *termtypes[] = {"vt100", "vt101", "vt102", "vt103", "vt125",
************
*/
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int i;
int hard;
@@ -330,7 +328,7 @@ main(argc, argv)
show character's inventory
*/
static void
-showstr()
+showstr(void)
{
int i, number;
for (number = 3, i = 0; i < 26; i++)
@@ -342,7 +340,7 @@ showstr()
}
void
-qshowstr()
+qshowstr(void)
{
int i, j, k, sigsav;
srcount = 0;
@@ -369,8 +367,7 @@ qshowstr()
* subroutine to clear screen depending on # lines to display
*/
static void
-t_setup(count)
- int count;
+t_setup(int count)
{
if (count < 20) { /* how do we clear the screen? */
cl_up(79, count);
@@ -385,8 +382,7 @@ t_setup(count)
* subroutine to restore normal display screen depending on t_setup()
*/
static void
-t_endup(count)
- int count;
+t_endup(int count)
{
if (count < 18) /* how did we clear the screen? */
draws(0, MAXX, 0, (count > MAXY) ? MAXY : count);
@@ -400,7 +396,7 @@ t_endup(count)
function to show the things player is wearing only
*/
static void
-showwear()
+showwear(void)
{
int i, j, sigsav, count;
sigsav = nosignal;
@@ -449,7 +445,7 @@ showwear()
function to show the things player can wield only
*/
static void
-showwield()
+showwield(void)
{
int i, j, sigsav, count;
sigsav = nosignal;
@@ -507,7 +503,7 @@ showwield()
* function to show the things player can read only
*/
static void
-showread()
+showread(void)
{
int i, j, sigsav, count;
sigsav = nosignal;
@@ -539,7 +535,7 @@ showread()
* function to show the things player can eat only
*/
static void
-showeat()
+showeat(void)
{
int i, j, sigsav, count;
sigsav = nosignal;
@@ -569,7 +565,7 @@ showeat()
function to show the things player can quaff only
*/
static void
-showquaff()
+showquaff(void)
{
int i, j, sigsav, count;
sigsav = nosignal;
@@ -596,9 +592,7 @@ showquaff()
}
static void
-show1(idx, str2)
- int idx;
- const char *str2[];
+show1(int idx, const char *str2[])
{
lprintf("\n%c) %s", idx + 'a', objectname[iven[idx]]);
if (str2 != 0 && str2[ivenarg[idx]][0] != 0)
@@ -653,7 +647,7 @@ show3(int indx)
subroutine to randomly create monsters if needed
*/
static void
-randmonst()
+randmonst(void)
{
if (c[TIMESTOP])
return; /* don't make monsters if time is stopped */
@@ -671,7 +665,7 @@ randmonst()
get and execute a command
*/
static void
-parse()
+parse(void)
{
int i, j, k, flag;
while (1) {
@@ -980,7 +974,7 @@ parse()
}
void
-parse2()
+parse2(void)
{
if (c[HASTEMONST])
movemonst();
@@ -990,8 +984,7 @@ parse2()
}
static void
-run(dir)
- int dir;
+run(int dir)
{
int i;
i = 1;
@@ -1015,7 +1008,7 @@ run(dir)
function to wield a weapon
*/
static void
-wield()
+wield(void)
{
int i;
while (1) {
@@ -1053,15 +1046,13 @@ wield()
common routine to say you don't have an item
*/
static void
-ydhi(x)
- int x;
+ydhi(int x)
{
cursors();
lprintf("\nYou don't have item %c!", x);
}
static void
-ycwi(x)
- int x;
+ycwi(int x)
{
cursors();
lprintf("\nYou can't wield item %c!", x);
@@ -1071,7 +1062,7 @@ ycwi(x)
function to wear armor
*/
static void
-wear()
+wear(void)
{
int i;
while (1) {
@@ -1123,7 +1114,7 @@ wear()
function to drop an object
*/
static void
-dropobj()
+dropobj(void)
{
int i;
unsigned char *p;
@@ -1187,7 +1178,7 @@ dropobj()
* readscr() Subroutine to read a scroll one is carrying
*/
static void
-readscr()
+readscr(void)
{
int i;
while (1) {
@@ -1260,7 +1251,7 @@ eatcookie(void)
* subroutine to quaff a potion one is carrying
*/
static void
-quaff()
+quaff(void)
{
int i;
while (1) {
@@ -1308,8 +1299,7 @@ whatitem(const char *str)
and allow * to mean return amt, else return the number entered
*/
unsigned long
-readnum(mx)
- long mx;
+readnum(long mx)
{
int i;
unsigned long amt = 0;
diff --git a/larn/monster.c b/larn/monster.c
index 46f7af53..35a329e5 100644
--- a/larn/monster.c
+++ b/larn/monster.c
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.17 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 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.17 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -141,8 +141,7 @@ static void genmonst(void);
* Returns no value.
*/
void
-createmonster(mon)
- int mon;
+createmonster(int mon)
{
int x, y, k, i;
if (mon < 1 || mon > MAXMONST + 8) { /* check for monster number
@@ -212,8 +211,7 @@ cgood(int x, int y, int theitem, int monst)
* Returns no value, thus we don't know about createitem() failures.
*/
void
-createitem(it, arg)
- int it, arg;
+createitem(int it, int arg)
{
int x, y, k, i;
if (it >= MAXOBJ)
@@ -240,7 +238,7 @@ createitem(it, arg)
*/
static char eys[] = "\nEnter your spell: ";
void
-cast()
+cast(void)
{
int i, j, a, b, d;
cursors();
@@ -653,7 +651,7 @@ speldamage(int x)
* No arguments and no return value
*/
static void
-loseint()
+loseint(void)
{
if (--c[INTELLIGENCE] < 3)
c[INTELLIGENCE] = 3;
@@ -666,7 +664,7 @@ loseint()
* returns 0 if not confused, non-zero (time remaining confused) if confused
*/
static int
-isconfuse()
+isconfuse(void)
{
if (c[CONFUSE]) {
lprcat(" You can't aim your magic!");
@@ -684,8 +682,7 @@ isconfuse()
* Enter with the spell number in x, and the monster number in monst.
*/
static int
-nospell(x, monst)
- int x, monst;
+nospell(int x, int monst)
{
int tmp;
if (x >= SPNUM || monst >= MAXMONST + 8 || monst < 0 || x < 0)
@@ -706,8 +703,7 @@ nospell(x, monst)
* Enter with the number of full hits being done
*/
static int
-fullhit(xx)
- int xx;
+fullhit(int xx)
{
int i;
if (xx < 0 || xx > 20)
@@ -729,9 +725,7 @@ fullhit(xx)
* Returns no value.
*/
static void
-direct(spnum, dam, str, arg)
- int spnum, dam, arg;
- const char *str;
+direct(int spnum, int dam, const char *str, int arg)
{
int x, y;
int m;
@@ -791,13 +785,16 @@ direct(spnum, dam, str, arg)
* Returns no value.
*/
void
-godirect(spnum, dam, str, delay, cshow)
- int spnum, dam, delay;
- const char *str, cshow;
+godirect(int spnum, int dam, const char *str, int delay, int cshow_i)
{
u_char *p;
int x, y, m;
int dx, dy;
+ char cshow;
+
+ /* truncate to char width in case it matters */
+ cshow = (char)cshow_i;
+
if (spnum < 0 || spnum >= SPNUM || str == 0 || delay < 0)
return; /* bad args */
if (isconfuse())
@@ -939,8 +936,7 @@ ifblind(int x, int y)
* Returns no value.
*/
static void
-tdirect(spnum)
- int spnum;
+tdirect(int spnum)
{
int x, y;
int m;
@@ -1007,8 +1003,7 @@ omnidirect(int spnum, int dam, const char *str)
* Returns index into diroffx[] (0-8).
*/
static int
-dirsub(x, y)
- int *x, *y;
+dirsub(int *x, int *y)
{
int i;
lprcat("\nIn What Direction? ");
@@ -1050,8 +1045,7 @@ out:
* routine are affected.
*/
int
-vxy(x, y)
- int *x, *y;
+vxy(int *x, int *y)
{
int flag = 0;
if (*x < 0) {
@@ -1082,8 +1076,7 @@ vxy(x, y)
* Returns no value.
*/
static void
-dirpoly(spnum)
- int spnum;
+dirpoly(int spnum)
{
int x, y, m;
if (spnum < 0 || spnum >= SPNUM)
@@ -1115,8 +1108,7 @@ dirpoly(spnum)
* Returns no value.
*/
void
-hitmonster(x, y)
- int x, y;
+hitmonster(int x, int y)
{
int tmp, monst, damag = 0, flag;
if (c[TIMESTOP])
@@ -1168,9 +1160,7 @@ hitmonster(x, y)
* Called by hitmonster(x,y)
*/
static int
-hitm(x, y, amt)
- int x, y;
- int amt;
+hitm(int x, int y, int amt)
{
int monst;
int hpoints, amt2;
@@ -1225,8 +1215,7 @@ hitm(x, y, amt)
* Returns nothing of value.
*/
void
-hitplayer(x, y)
- int x, y;
+hitplayer(int x, int y)
{
int dam, tmp, mster, bias;
vxy(&x, &y); /* verify coordinates are within range */
@@ -1302,8 +1291,7 @@ hitplayer(x, y)
* Returns nothing of value.
*/
static void
-dropsomething(monst)
- int monst;
+dropsomething(int monst)
{
switch (monst) {
case ORC:
@@ -1336,8 +1324,7 @@ dropsomething(monst)
* Returns nothing of value.
*/
void
-dropgold(amount)
- int amount;
+dropgold(int amount)
{
if (amount > 250)
createitem(OMAXGOLD, amount / 100);
@@ -1384,8 +1371,7 @@ static char nobjtab[] = {
OLONGSWORD};
int
-newobject(lev, i)
- int lev, *i;
+newobject(int lev, int *i)
{
int tmp = 32, j;
if (level < 0 || level > MAXLEVEL + MAXVLEVEL)
@@ -1518,8 +1504,7 @@ static char rustarm[ARMORTYPES][2] = {
};
static char spsel[] = {1, 2, 3, 5, 6, 8, 9, 11, 13, 14};
static int
-spattack(x, xx, yy)
- int x, xx, yy;
+spattack(int x, int xx, int yy)
{
int i, j = 0, k, m;
const char *p = NULL;
@@ -1706,8 +1691,7 @@ spout3: p = "\nThe %s bit you!";
* Note: if x > c[HP] this routine could kill the player!
*/
void
-checkloss(x)
- int x;
+checkloss(int x)
{
if (x > 0) {
losehp(x);
@@ -1722,7 +1706,7 @@ checkloss(x)
* Returns the experience gained from all monsters killed
*/
int
-annihilate()
+annihilate(void)
{
int i, j;
long k;
@@ -1757,8 +1741,7 @@ annihilate()
* Returns the number of spheres currently in existence
*/
int
-newsphere(x, y, dir, life)
- int x, y, dir, life;
+newsphere(int x, int y, int dir, int life)
{
int m;
struct sphere *sp;
@@ -1847,8 +1830,7 @@ boom: sphboom(x, y); /* blow up stuff around sphere */
* Returns the number of spheres currently in existence
*/
int
-rmsphere(x, y)
- int x, y;
+rmsphere(int x, int y)
{
struct sphere *sp, *sp2 = 0;
for (sp = spheres; sp; sp2 = sp, sp = sp->p)
@@ -1881,8 +1863,7 @@ rmsphere(x, y)
* Enter with the coordinates of the blast, Returns no value
*/
static void
-sphboom(x, y)
- int x, y;
+sphboom(int x, int y)
{
int i, j;
if (c[HOLDMONST])
@@ -1909,7 +1890,7 @@ sphboom(x, y)
* This is done by setting a flag in the monster[] structure
*/
static void
-genmonst()
+genmonst(void)
{
int i, j;
cursors();
diff --git a/larn/moreobj.c b/larn/moreobj.c
index b0cb5961..d36e6e17 100644
--- a/larn/moreobj.c
+++ b/larn/moreobj.c
@@ -1,4 +1,4 @@
-/* $NetBSD: moreobj.c,v 1.11 2008/02/19 06:05:26 dholland Exp $ */
+/* $NetBSD: moreobj.c,v 1.12 2012/06/19 05:30:43 dholland Exp $ */
/*
* moreobj.c Larn is copyrighted 1986 by Noah Morgan.
@@ -9,7 +9,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: moreobj.c,v 1.11 2008/02/19 06:05:26 dholland Exp $");
+__RCSID("$NetBSD: moreobj.c,v 1.12 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include <unistd.h>
@@ -22,7 +22,7 @@ static void fch(int, long *);
* subroutine to process an altar object
*/
void
-oaltar()
+oaltar(void)
{
lprcat("\nDo you (p) pray (d) desecrate");
@@ -64,8 +64,7 @@ oaltar()
subroutine to process a throne object
*/
void
-othrone(arg)
- int arg;
+othrone(int arg)
{
lprcat("\nDo you (p) pry off jewels, (s) sit down");
@@ -92,7 +91,7 @@ othrone(arg)
}
void
-odeadthrone()
+odeadthrone(void)
{
int k;
@@ -124,7 +123,7 @@ odeadthrone()
subroutine to process a throne object
*/
void
-ochest()
+ochest(void)
{
lprcat("\nDo you (t) take it, (o) try to open it");
@@ -155,7 +154,7 @@ ochest()
process a fountain object
*/
void
-ofountain()
+ofountain(void)
{
cursors();
@@ -188,9 +187,7 @@ ofountain()
subroutine to process an up/down of a character attribute for ofountain
*/
static void
-fch(how, x)
- int how;
- long *x;
+fch(int how, long *x)
{
if (how < 0) {
lprcat(" went down by one!");
@@ -207,8 +204,7 @@ fch(how, x)
if x > 0 they are raised if x < 0 they are lowered
*/
void
-fntchange(how)
- int how;
+fntchange(int how)
{
long j;
lprc('\n');
diff --git a/larn/movem.c b/larn/movem.c
index 81127dd7..b9745fcc 100644
--- a/larn/movem.c
+++ b/larn/movem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $ */
+/* $NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $ */
/*
* movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan.
@@ -12,7 +12,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $");
+__RCSID("$NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -32,7 +32,7 @@ static void movsphere(void);
static short w1[9], w1x[9], w1y[9];
static int tmp1, tmp2, tmp3, tmp4, distance;
void
-movemonst()
+movemonst(void)
{
int i, j;
if (c[TIMESTOP])
@@ -132,8 +132,7 @@ movemonst()
*/
static int tmpitem, xl, xh, yl, yh;
static void
-movemt(i, j)
- int i, j;
+movemt(int i, int j)
{
int k, m, z, tmp, xtmp, ytmp, monst;
switch (monst = mitem[i][j]) { /* for half speed monsters */
@@ -274,8 +273,7 @@ out: if (tmp < distance) /* did find connectivity */
* in (xd,yd).
*/
static void
-mmove(aa, bb, cc, dd)
- int aa, bb, cc, dd;
+mmove(int aa, int bb, int cc, int dd)
{
int tmp, i, flag;
const char *who = NULL;
@@ -405,7 +403,7 @@ mmove(aa, bb, cc, dd)
#define SPHMAX 20 /* maximum number of spheres movsphere can
* handle */
static void
-movsphere()
+movsphere(void)
{
int x, y, dir, len;
struct sphere *sp, *sp2;
diff --git a/larn/nap.c b/larn/nap.c
index c4b3c56a..1bd11ea6 100644
--- a/larn/nap.c
+++ b/larn/nap.c
@@ -1,9 +1,9 @@
-/* $NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $ */
+/* $NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $ */
/* nap.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $");
+__RCSID("$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include <unistd.h>
@@ -14,8 +14,7 @@ __RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $");
* routine to take a nap for n milliseconds
*/
void
-nap(x)
- int x;
+nap(int x)
{
if (x <= 0)
return; /* eliminate chance for infinite loop */
diff --git a/larn/object.c b/larn/object.c
index 1c7e607d..a8e14496 100644
--- a/larn/object.c
+++ b/larn/object.c
@@ -1,10 +1,10 @@
-/* $NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $ */
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $");
#endif /* not lint */
#include "header.h"
#include "extern.h"
@@ -31,7 +31,7 @@ static void ohome(void);
if an object was found.
*/
void
-lookforobject()
+lookforobject(void)
{
int i, j;
if (c[TIMESTOP])
@@ -554,8 +554,7 @@ finditem(int theitem)
if dir > 0 the up else down
*/
static void
-ostairs(dir)
- int dir;
+ostairs(int dir)
{
int k;
lprcat("\nDo you (s) stay here ");
@@ -620,8 +619,7 @@ ostairs(dir)
subroutine to handle a teleport trap +/- 1 level maximum
*/
void
-oteleport(err)
- int err;
+oteleport(int err)
{
int tmp;
if (err)
@@ -657,8 +655,7 @@ oteleport(err)
function to process a potion
*/
static void
-opotion(pot)
- int pot;
+opotion(int pot)
{
lprcat("\nDo you (d) drink it, (t) take it");
iopts();
@@ -687,8 +684,7 @@ opotion(pot)
function to drink a potion
*/
void
-quaffpotion(pot)
- int pot;
+quaffpotion(int pot)
{
int i, j, k;
if (pot < 0 || pot >= MAXPOTION)
@@ -866,8 +862,7 @@ quaffpotion(pot)
function to process a magic scroll
*/
static void
-oscroll(typ)
- int typ;
+oscroll(int typ)
{
lprcat("\nDo you ");
if (c[BLINDCOUNT] == 0)
@@ -927,8 +922,7 @@ static u_char time_change[] = {
* function to adjust time when time warping and taking courses in school
*/
void
-adjusttime(tim)
- long tim;
+adjusttime(long tim)
{
int j;
for (j = 0; j < 26; j++)/* adjust time related parameters */
@@ -942,8 +936,7 @@ adjusttime(tim)
function to read a scroll
*/
void
-read_scroll(typ)
- int typ;
+read_scroll(int typ)
{
int i, j;
if (typ < 0 || typ >= MAXSCROLL)
@@ -1098,12 +1091,12 @@ read_scroll(typ)
static void
-oorb()
+oorb(void)
{
}
static void
-opit()
+opit(void)
{
int i;
if (rnd(101) < 81) {
@@ -1132,7 +1125,7 @@ opit()
}
static void
-obottomless()
+obottomless(void)
{
lprcat("\nYou fell into a bottomless pit!");
beep();
@@ -1141,8 +1134,7 @@ obottomless()
}
static void
-oelevator(dir)
- int dir;
+oelevator(int dir)
{
#ifdef lint
int x;
@@ -1152,17 +1144,17 @@ oelevator(dir)
}
static void
-ostatue()
+ostatue(void)
{
}
static void
-omirror()
+omirror(void)
{
}
static void
-obook()
+obook(void)
{
lprcat("\nDo you ");
if (c[BLINDCOUNT] == 0)
@@ -1196,8 +1188,7 @@ obook()
function to read a book
*/
void
-readbook(lev)
- int lev;
+readbook(int lev)
{
int i, tmp;
if (lev <= 3)
@@ -1252,8 +1243,7 @@ ocookie(void)
* 100* the argument
*/
static void
-ogold(arg)
- int arg;
+ogold(int arg)
{
long i;
i = iarg[playerx][playery];
@@ -1270,7 +1260,7 @@ ogold(arg)
}
static void
-ohome()
+ohome(void)
{
int i;
nosignal = 1; /* disable signals */
@@ -1334,13 +1324,13 @@ ohome()
/* routine to save program space */
void
-iopts()
+iopts(void)
{
lprcat(", or (i) ignore it? ");
}
void
-ignore()
+ignore(void)
{
lprcat("ignore\n");
}
diff --git a/larn/regen.c b/larn/regen.c
index efeefca5..2c8537f8 100644
--- a/larn/regen.c
+++ b/larn/regen.c
@@ -1,9 +1,9 @@
-/* $NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $ */
+/* $NetBSD: regen.c,v 1.6 2012/06/19 05:30:44 dholland Exp $ */
/* regen.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $");
+__RCSID("$NetBSD: regen.c,v 1.6 2012/06/19 05:30:44 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -17,7 +17,7 @@ __RCSID("$NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $");
subroutine to regenerate player hp and spells
*/
void
-regen()
+regen(void)
{
int i, flag;
long *d;
diff --git a/larn/savelev.c b/larn/savelev.c
index 17cc6bec..9954ff08 100644
--- a/larn/savelev.c
+++ b/larn/savelev.c
@@ -1,9 +1,9 @@
-/* $NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $ */
+/* $NetBSD: savelev.c,v 1.7 2012/06/19 05:30:44 dholland Exp $ */
/* savelev.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $");
+__RCSID("$NetBSD: savelev.c,v 1.7 2012/06/19 05:30:44 dholland Exp $");
#endif /* not lint */
#include "header.h"
#include "extern.h"
@@ -12,7 +12,7 @@ __RCSID("$NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $");
* routine to save the present level into storage
*/
void
-savelevel()
+savelevel(void)
{
struct cel *pcel;
u_char *pitem, *pknow, *pmitem;
@@ -41,7 +41,7 @@ savelevel()
* routine to restore a level from storage
*/
void
-getlevel()
+getlevel(void)
{
struct cel *pcel;
u_char *pitem, *pknow, *pmitem;
diff --git a/larn/scores.c b/larn/scores.c
index c17a770f..49a6f873 100644
--- a/larn/scores.c
+++ b/larn/scores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scores.c,v 1.20 2010/04/24 00:56:14 dholland Exp $ */
+/* $NetBSD: scores.c,v 1.21 2012/06/19 05:30:44 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.20 2010/04/24 00:56:14 dholland Exp $");
+__RCSID("$NetBSD: scores.c,v 1.21 2012/06/19 05:30:44 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
#include <sys/times.h>
@@ -118,7 +118,7 @@ static void diedsub(int);
* returns -1 if unable to read in the scoreboard, returns 0 if all is OK
*/
static int
-readboard()
+readboard(void)
{
int i;
@@ -145,7 +145,7 @@ readboard()
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
*/
static int
-writeboard()
+writeboard(void)
{
int i;
@@ -173,7 +173,7 @@ writeboard()
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
*/
int
-makeboard()
+makeboard(void)
{
int i;
set_score_output();
@@ -200,7 +200,7 @@ makeboard()
* the winners scoreboard.
*/
int
-hashewon()
+hashewon(void)
{
int i;
c[HARDGAME] = 0;
@@ -223,8 +223,7 @@ hashewon()
* Returns amount actually paid.
*/
long
-paytaxes(x)
- long x;
+paytaxes(long x)
{
int i;
long amt;
@@ -257,7 +256,7 @@ paytaxes(x)
* Returns the number of players on scoreboard that were shown
*/
static int
-winshou()
+winshou(void)
{
struct wscofmt *p;
int i, j, count;
@@ -296,8 +295,7 @@ winshou()
* Returns the number of players on scoreboard that were shown
*/
static int
-shou(x)
- int x;
+shou(int x)
{
int i, j, n, k;
int count;
@@ -351,7 +349,7 @@ shou(x)
*/
static char esb[] = "The scoreboard is empty.\n";
void
-showscores()
+showscores(void)
{
int i, j;
lflush();
@@ -373,7 +371,7 @@ showscores()
* Returns nothing of value
*/
void
-showallscores()
+showallscores(void)
{
int i, j;
lflush();
@@ -401,7 +399,7 @@ showallscores()
* Returns 0 if no sorting done, else returns 1
*/
static int
-sortboard()
+sortboard(void)
{
int i, j = 0, pos;
long jdat;
@@ -440,10 +438,7 @@ sortboard()
* ex. newscore(1000, "player 1", 32, 0);
*/
static void
-newscore(score, whoo, whyded, winner)
- long score;
- int winner, whyded;
- char *whoo;
+newscore(long score, char *whoo, int whyded, int winner)
{
int i;
long taxes;
@@ -509,10 +504,7 @@ newscore(score, whoo, whyded, winner)
* Returns nothing of value
*/
static void
-new1sub(score, i, whoo, taxes)
- long score, taxes;
- int i;
- char *whoo;
+new1sub(long score, int i, char *whoo, long taxes)
{
struct wscofmt *p;
p = &winr[i];
@@ -536,10 +528,7 @@ new1sub(score, i, whoo, taxes)
* Returns nothing of value
*/
static void
-new2sub(score, i, whoo, whyded)
- long score;
- int i, whyded;
- char *whoo;
+new2sub(long score, int i, char *whoo, int whyded)
{
int j;
struct scofmt *p;
@@ -601,8 +590,7 @@ new2sub(score, i, whoo, whyded)
static int scorerror;
void
-died(x)
- int x;
+died(int x)
{
int f, win;
char ch;
@@ -768,7 +756,7 @@ diedsub(int x)
* diedlog() Subroutine to read a log file and print it out in ascii format
*/
void
-diedlog()
+diedlog(void)
{
int n;
char *p;
diff --git a/larn/signal.c b/larn/signal.c
index 42493424..3fa8df15 100644
--- a/larn/signal.c
+++ b/larn/signal.c
@@ -1,10 +1,10 @@
-/* $NetBSD: signal.c,v 1.8 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: signal.c,v 1.9 2012/06/19 05:30:44 dholland Exp $ */
/* "Larn is copyrighted 1986 by Noah Morgan.\n" */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: signal.c,v 1.8 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: signal.c,v 1.9 2012/06/19 05:30:44 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@@ -23,7 +23,7 @@ static void sigpanic(int);
#define BIT(a) (1<<((a)-1))
static void
-s2choose()
+s2choose(void)
{ /* text to be displayed if ^C during intro
* screen */
cursor(1, 24);
@@ -36,8 +36,7 @@ s2choose()
}
static void
-cntlc(n)
- int n;
+cntlc(int n)
{ /* what to do for a ^C */
if (nosignal)
return; /* don't do anything if inhibited */
@@ -57,8 +56,7 @@ cntlc(n)
* subroutine to save the game if a hangup signal
*/
static void
-sgam(n)
- int n;
+sgam(int n)
{
savegame(savefilename);
wizard = 1;
@@ -67,8 +65,7 @@ sgam(n)
#ifdef SIGTSTP
static void
-tstop(n)
- int n;
+tstop(int n)
{ /* control Y */
if (nosignal)
return; /* nothing if inhibited */
@@ -100,7 +97,7 @@ tstop(n)
* subroutine to issue the needed signal traps called from main()
*/
void
-sigsetup()
+sigsetup(void)
{
signal(SIGQUIT, cntlc);
signal(SIGINT, cntlc);
@@ -126,8 +123,7 @@ sigsetup()
* routine to process a fatal error signal
*/
static void
-sigpanic(sig)
- int sig;
+sigpanic(int sig)
{
char buf[128];
signal(sig, SIG_DFL);
diff --git a/larn/store.c b/larn/store.c
index 59733c78..2d335380 100644
--- a/larn/store.c
+++ b/larn/store.c
@@ -1,4 +1,4 @@
-/* $NetBSD: store.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: store.c,v 1.16 2012/06/19 05:30:44 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.15 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: store.c,v 1.16 2012/06/19 05:30:44 dholland Exp $");
#endif
#endif /* not lint */
@@ -210,7 +210,7 @@ dnd_hed(void)
}
static void
-handsfull()
+handsfull(void)
{
lprcat("\nYou can't carry anything more!");
lflush();
@@ -218,7 +218,7 @@ handsfull()
}
static void
-outofstock()
+outofstock(void)
{
lprcat("\nSorry, but we are out of that item.");
lflush();
@@ -226,7 +226,7 @@ outofstock()
}
static void
-nogold()
+nogold(void)
{
lprcat("\nYou don't have enough gold to pay for that!");
lflush();
@@ -234,7 +234,7 @@ nogold()
}
void
-dndstore()
+dndstore(void)
{
int i;
dnditm = 0;
@@ -320,8 +320,7 @@ dndstore()
to print the item list; used in dndstore() enter with the index into itm
*/
static void
-dnditem(i)
- int i;
+dnditem(int i)
{
int j, k;
if (i >= MAXITM)
@@ -390,7 +389,7 @@ sch_hed(void)
}
void
-oschool()
+oschool(void)
{
int i;
long time_used;
@@ -515,12 +514,12 @@ oschool()
int lasttime = 0; /* last time he was in bank */
void
-obank()
+obank(void)
{
banktitle(" Welcome to the First National Bank of Larn.");
}
void
-obank2()
+obank2(void)
{
banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
}
@@ -560,7 +559,7 @@ banktitle(const char *str)
* function to put interest on your bank account
*/
void
-ointerest()
+ointerest(void)
{
int i;
if (c[BANKACCOUNT] < 0)
@@ -579,7 +578,7 @@ static short gemorder[26] = {0}; /* the reference to screen location
* for each */
static long gemvalue[26] = {0}; /* the appraisal of the gems */
void
-obanksub()
+obanksub(void)
{
long amt;
int i, k;
@@ -746,7 +745,7 @@ appraise(int gemstone)
function for the trading post
*/
static void
-otradhead()
+otradhead(void)
{
clear();
lprcat("Welcome to the Larn Trading Post. We buy items that explorers no longer find\n");
@@ -757,7 +756,7 @@ otradhead()
}
void
-otradepost()
+otradepost(void)
{
int i, j, value, isub, izarg;
dnditm = dndcount = 0;
@@ -853,7 +852,7 @@ cnsitm(void)
* for the Larn Revenue Service
*/
void
-olrs()
+olrs(void)
{
int i, first;
long amt;
diff --git a/larn/tok.c b/larn/tok.c
index 1a9b8bca..6bab595e 100644
--- a/larn/tok.c
+++ b/larn/tok.c
@@ -1,9 +1,9 @@
-/* $NetBSD: tok.c,v 1.10 2008/02/04 01:07:01 dholland Exp $ */
+/* $NetBSD: tok.c,v 1.11 2012/06/19 05:30:44 dholland Exp $ */
/* tok.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: tok.c,v 1.10 2008/02/04 01:07:01 dholland Exp $");
+__RCSID("$NetBSD: tok.c,v 1.11 2012/06/19 05:30:44 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -35,7 +35,7 @@ static u_char usermpoint = 0; /* the user monster pointer */
lexical analyzer for larn
*/
int
-yylex()
+yylex(void)
{
char cc;
int ic;
@@ -111,7 +111,7 @@ yylex()
* flushall() Function to flush all type-ahead in the input buffer
*/
void
-flushall()
+flushall(void)
{
char cc;
int ic;
@@ -132,8 +132,7 @@ flushall()
enter with hard= -1 for default hardness, else any desired hardness
*/
void
-sethard(hard)
- int hard;
+sethard(int hard)
{
int j, k, i;
struct monst *mp;
@@ -167,7 +166,7 @@ sethard(hard)
function to read and process the larn options file
*/
void
-readopts()
+readopts(void)
{
const char *i;
int j, k;