--- rogue-5.4.2/misc.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/misc.c 2007-07-15 21:54:52.000000000 -0700
@@ -19,7 +19,7 @@
* A quick glance all around the player
*/
-look(bool wakeup)
+void look(bool wakeup)
{
int x, y;
chtype ch;
@@ -96,13 +96,17 @@
}
else
{
- if (wakeup)
+ if (wakeup) {
wake_monster(y, x);
- if (see_monst(tp))
- if (on(player, ISHALU))
+ }
+ if (see_monst(tp)) {
+ if (on(player, ISHALU)) {
ch = rnd(26) + 'A';
- else
+ }
+ else {
ch = tp->t_disguise;
+ }
+ }
}
if (on(player, ISBLIND) && (y != hero.y || x != hero.x))
continue;
@@ -206,7 +210,7 @@
* Erase the area shown by a lamp in a dark room.
*/
-erase_lamp(coord *pos, struct room *rp)
+void erase_lamp(coord *pos, struct room *rp)
{
int y, x, ey, sy, ex;
@@ -269,7 +273,7 @@
* She wants to eat something, so let her try
*/
-eat()
+void eat()
{
THING *obj;
@@ -309,7 +313,7 @@
* Check to see if the guy has gone up a level.
*/
-check_level()
+void check_level()
{
int i, add, olevel;
@@ -334,7 +338,7 @@
* highest it has been, just in case
*/
-chg_str(int amt)
+void chg_str(int amt)
{
auto str_t comp;
@@ -354,7 +358,7 @@
* add_str:
* Perform the actual add, checking upper and lower bound limits
*/
-add_str(str_t *sp, int amt)
+void add_str(str_t *sp, int amt)
{
if ((*sp += amt) < 3)
*sp = 3;
@@ -391,7 +395,7 @@
* Aggravate all the monsters on this level
*/
-aggravate()
+void aggravate()
{
THING *mp;
@@ -528,7 +532,7 @@
* Call an object something after use.
*/
-call_it(struct obj_info *info)
+void call_it(struct obj_info *info)
{
if (info->oi_know)
{
--- rogue-5.4.2/potions.c.orig 2007-07-15 21:37:54.000000000 -0700
+++ rogue-5.4.2/potions.c 2007-07-15 21:59:41.000000000 -0700
@@ -17,7 +17,7 @@
typedef struct
{
int pa_flags;
- int (*pa_daemon)();
+ void (*pa_daemon)();
int pa_time;
char *pa_high, *pa_straight;
} PACT;
@@ -55,7 +55,7 @@
* Quaff a potion from the pack
*/
-quaff()
+void quaff()
{
THING *obj, *tp, *mp;
bool discardit = FALSE;
@@ -251,7 +251,7 @@
* Turn on the ability to see invisible
*/
-invis_on()
+void invis_on()
{
THING *mp;
@@ -338,7 +338,7 @@
* The guy just magically went up a level.
*/
-raise_level()
+void raise_level()
{
pstats.s_exp = e_levels[pstats.s_lvl-1] + 1L;
check_level();
@@ -350,7 +350,7 @@
* turns on a flag
*/
-do_pot(int type, bool knowit)
+void do_pot(int type, bool knowit)
{
PACT *pp;
int t;
--- rogue-5.4.2/new_level.c.orig 2007-07-15 21:19:43.000000000 -0700
+++ rogue-5.4.2/new_level.c 2007-07-15 21:20:48.000000000 -0700
@@ -18,7 +18,7 @@
#define MAXTREAS 10 /* maximum number of treasures in a treasure room */
#define MINTREAS 2 /* minimum number of treasures in a treasure room */
-new_level()
+void new_level()
{
THING *tp;
PLACE *pp;
@@ -118,7 +118,7 @@
* Put potions and scrolls on this level
*/
-put_things()
+void put_things()
{
int i;
THING *obj;
@@ -180,7 +180,7 @@
#define MAXTRIES 10 /* max number of tries to put down a monster */
-treas_room()
+void treas_room()
{
int nm;
THING *tp;
--- rogue-5.4.2/wizard.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/wizard.c 2007-07-15 20:56:09.000000000 -0700
@@ -20,7 +20,7 @@
* What a certin object is
*/
-whatis(bool insist, int type)
+void whatis(bool insist, int type)
{
THING *obj;
@@ -74,7 +74,7 @@
* Set things up when we really know what a thing is
*/
-set_know(THING *obj, struct obj_info *info)
+void set_know(THING *obj, struct obj_info *info)
{
char **guess;
@@ -97,14 +97,14 @@
{
struct h_list *hp;
static struct h_list tlist[] = {
- POTION, "potion", FALSE,
- SCROLL, "scroll", FALSE,
- FOOD, "food", FALSE,
- R_OR_S, "ring, wand or staff", FALSE,
- RING, "ring", FALSE,
- STICK, "wand or staff", FALSE,
- WEAPON, "weapon", FALSE,
- ARMOR, "suit of armor", FALSE,
+ {POTION, "potion", FALSE},
+ {SCROLL, "scroll", FALSE},
+ {FOOD, "food", FALSE},
+ {R_OR_S, "ring, wand or staff", FALSE},
+ {RING, "ring", FALSE},
+ {STICK, "wand or staff", FALSE},
+ {WEAPON, "weapon", FALSE},
+ {ARMOR, "suit of armor", FALSE},
};
for (hp = tlist; hp->h_ch; hp++)
@@ -191,7 +191,7 @@
* Bamf the hero someplace else
*/
-teleport()
+void teleport()
{
static coord c;
--- rogue-5.4.2/main.c.orig 2007-07-15 20:53:43.000000000 -0700
+++ rogue-5.4.2/main.c 2007-07-15 21:54:25.000000000 -0700
@@ -96,7 +96,7 @@
/*
* check for print-score option
*/
- if (argc == 2)
+ if (argc == 2) {
if (strcmp(argv[1], "-s") == 0)
{
noscore = TRUE;
@@ -115,6 +115,7 @@
death(death_monst());
exit(0);
}
+ }
init_check(); /* check for legal startup */
if (argc == 2)
@@ -167,6 +168,8 @@
fuse(swander, 0, WANDERTIME, AFTER);
start_daemon(stomach, 0, AFTER);
playit();
+
+ exit(0);
}
/*
@@ -185,7 +188,7 @@
* Exit the program, printing a message.
*/
-fatal(char *s)
+void fatal(char *s)
{
mvaddstr(LINES - 2, 0, s);
refresh();
@@ -223,7 +226,7 @@
* Handle stop and start signals
*/
-tstp(int ignored)
+void tstp(int ignored)
{
int y, x;
int oy, ox;
@@ -262,7 +265,7 @@
* refreshing things and looking at the proper times.
*/
-playit()
+void playit()
{
char *opts;
@@ -367,7 +370,7 @@
* Let them escape for a while
*/
-shell()
+void shell()
{
char *sh;
@@ -404,7 +407,7 @@
* Leave the process properly
*/
-my_exit(int st)
+void my_exit(int st)
{
resetltchars();
exit(st);
--- rogue-5.4.2/init.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/init.c 2007-07-15 20:56:09.000000000 -0700
@@ -18,7 +18,7 @@
* init_player:
* Roll her up
*/
-init_player()
+void init_player()
{
register THING *obj;
@@ -233,7 +233,7 @@
* init_colors:
* Initialize the potion color scheme for this time
*/
-init_colors()
+void init_colors()
{
register int i, j;
@@ -255,7 +255,7 @@
*/
#define MAXNAME 40 /* Max number of characters in a name */
-init_names()
+void init_names()
{
register int nsyl;
register char *cp, *sp;
@@ -288,7 +288,7 @@
* init_stones:
* Initialize the ring stone setting scheme for this time
*/
-init_stones()
+void init_stones()
{
register int i, j;
@@ -309,7 +309,7 @@
* init_materials:
* Initialize the construction materials for wands and staffs
*/
-init_materials()
+void init_materials()
{
register int i, j;
register char *str;
@@ -370,7 +370,7 @@
* sumprobs:
* Sum up the probabilities for items appearing
*/
-sumprobs(info, bound
+void sumprobs(info, bound
#ifdef MASTER
, name
#endif
@@ -396,7 +396,7 @@
* init_probs:
* Initialize the probabilities for the various items
*/
-init_probs()
+void init_probs()
{
sumprobs(things, NT);
sumprobs(pot_info, MP);
@@ -412,7 +412,7 @@
* badcheck:
* Check to see if a series of probabilities sums to 100
*/
-badcheck(name, info, bound)
+void badcheck(name, info, bound)
char *name;
register struct obj_info *info;
register int bound;
--- rogue-5.4.2/weapons.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/weapons.c 2007-07-15 20:56:09.000000000 -0700
@@ -40,7 +40,7 @@
* Fire a missile in a given direction
*/
-missile(int ydelta, int xdelta)
+void missile(int ydelta, int xdelta)
{
THING *obj;
@@ -68,7 +68,7 @@
* across the room
*/
-do_motion(THING *obj, int ydelta, int xdelta)
+void do_motion(THING *obj, int ydelta, int xdelta)
{
int ch;
@@ -115,7 +115,7 @@
* Drop an item someplace around here.
*/
-fall(THING *obj, bool pr)
+void fall(THING *obj, bool pr)
{
PLACE *pp;
static coord fpos;
@@ -125,11 +125,13 @@
pp = INDEX(fpos.y, fpos.x);
pp->p_ch = obj->o_type;
obj->o_pos = fpos;
- if (cansee(fpos.y, fpos.x))
- if (pp->p_monst != NULL)
+ if (cansee(fpos.y, fpos.x)) {
+ if (pp->p_monst != NULL) {
pp->p_monst->t_oldch = obj->o_type;
- else
+ } else {
mvaddch(fpos.y, fpos.x, obj->o_type);
+ }
+ }
attach(lvl_obj, obj);
return;
}
@@ -151,7 +153,7 @@
* Set up the initial goodies for a weapon
*/
-init_weapon(THING *weap, char which)
+void init_weapon(THING *weap, char which)
{
struct init_weaps *iwp;
@@ -185,7 +187,7 @@
* hit_monster:
* Does the missile hit the monster?
*/
-hit_monster(int y, int x, THING *obj)
+bool hit_monster(int y, int x, THING *obj)
{
static coord mp;
@@ -214,7 +216,7 @@
* Pull out a certain weapon
*/
-wield()
+void wield()
{
THING *obj, *oweapon;
char *sp;
--- rogue-5.4.2/io.c.orig 2006-01-29 16:11:31.000000000 -0800
+++ rogue-5.4.2/io.c 2007-07-15 21:59:10.000000000 -0700
@@ -17,8 +17,27 @@
static char msgbuf[2*MAXMSG+1];
static int newpos = 0;
+/*
+ * readchar:
+ * Reads and returns a character, checking for gross input errors
+ */
+int readchar()
+{
+ int ch;
+
+ ch = md_readchar();
+
+ if ((ch == 3) || (ch == 0))
+ {
+ quit(0);
+ return(27);
+ }
+
+ return(ch);
+}
+
/* VARARGS1 */
-msg(char *fmt, ...)
+int msg(char *fmt, ...)
{
va_list args;
@@ -46,7 +65,7 @@
* Add things to the current message
*/
/* VARARGS1 */
-addmsg(char *fmt, ...)
+void addmsg(char *fmt, ...)
{
va_list args;
@@ -60,7 +79,7 @@
* Display a new msg (giving him a chance to see the previous one
* if it is up there with the --More--)
*/
-endmsg()
+int endmsg()
{
char ch;
@@ -105,7 +124,7 @@
* doadd:
* Perform an add onto the message buffer
*/
-doadd(char *fmt, va_list args)
+void doadd(char *fmt, va_list args)
{
static char buf[MAXSTR];
@@ -123,7 +142,7 @@
* step_ok:
* Returns true if it is ok to step on ch
*/
-step_ok(ch)
+bool step_ok(char ch)
{
switch (ch)
{
@@ -137,29 +156,10 @@
}
/*
- * readchar:
- * Reads and returns a character, checking for gross input errors
- */
-readchar()
-{
- int ch;
-
- ch = md_readchar();
-
- if ((ch == 3) || (ch == 0))
- {
- quit(0);
- return(27);
- }
-
- return(ch);
-}
-
-/*
* status:
* Display the important stats line. Keep the cursor where it was.
*/
-status()
+void status()
{
register int oy, ox, temp;
static int hpwidth = 0;
@@ -234,7 +234,7 @@
* wait_for
* Sit around until the guy types the right key
*/
-wait_for(ch)
+void wait_for(ch)
register int ch;
{
register char c;
@@ -251,7 +251,7 @@
* show_win:
* Function used to display a window and wait before returning
*/
-show_win(message)
+void show_win(message)
char *message;
{
WINDOW *win;
--- rogue-5.4.2/mdport.c.orig 2007-07-15 21:02:48.000000000 -0700
+++ rogue-5.4.2/mdport.c 2007-07-15 21:05:01.000000000 -0700
@@ -99,7 +99,7 @@
# define SE exit_standout_mode
#endif
-int
+void
md_putchar(int c)
{
putchar(c);
@@ -107,7 +107,7 @@
static int md_standout_mode = 0;
-int
+void
md_raw_standout()
{
#ifdef _WIN32
@@ -130,7 +130,7 @@
#endif
}
-int
+void
md_raw_standend()
{
#ifdef _WIN32
@@ -189,7 +189,7 @@
}
-int
+void
md_normaluser()
{
#ifndef _WIN32
@@ -278,18 +278,20 @@
h = szPath;
#endif
- if ( (h == NULL) || (*h == '\0') )
- if ( (h = getenv("HOME")) == NULL )
- if ( (h = getenv("HOMEDRIVE")) == NULL)
+ if ( (h == NULL) || (*h == '\0') ) {
+ if ( (h = getenv("HOME")) == NULL ) {
+ if ( (h = getenv("HOMEDRIVE")) == NULL) {
h = "";
- else
- {
+ } else {
strncpy(homedir,h,PATH_MAX-1);
homedir[PATH_MAX-1] = 0;
- if ( (h = getenv("HOMEPATH")) == NULL)
+ if ( (h = getenv("HOMEPATH")) == NULL) {
h = "";
+ }
}
+ }
+ }
len = strlen(homedir);
@@ -304,7 +306,7 @@
return(homedir);
}
-int
+void
md_sleep(int s)
{
#ifdef _WIN32
--- rogue-5.4.2/passages.c.orig 2007-07-15 21:36:04.000000000 -0700
+++ rogue-5.4.2/passages.c 2007-07-15 21:37:49.000000000 -0700
@@ -18,7 +18,7 @@
* Draw all the passages on a level.
*/
-do_passages()
+void do_passages()
{
struct rdes *r1, *r2 = NULL;
int i, j;
@@ -127,7 +127,7 @@
* Draw a corridor from a room in a certain direction.
*/
-conn(int r1, int r2)
+void conn(int r1, int r2)
{
struct room *rpf, *rpt = NULL;
char rmt;
@@ -267,7 +267,7 @@
* add a passage character or secret passage here
*/
-putpass(coord *cp)
+void putpass(coord *cp)
{
PLACE *pp;
@@ -285,7 +285,7 @@
* the exits array of the room.
*/
-door(struct room *rm, coord *cp)
+void door(struct room *rm, coord *cp)
{
PLACE *pp;
@@ -354,7 +354,7 @@
static bool newpnum;
-passnum()
+void passnum()
{
struct room *rp;
int i;
@@ -376,7 +376,7 @@
* Number a passageway square and its brethren
*/
-numpass(int y, int x)
+void numpass(int y, int x)
{
char *fp;
struct room *rp;
--- rogue-5.4.2/extern.c.orig 2007-07-15 20:53:43.000000000 -0700
+++ rogue-5.4.2/extern.c 2007-07-15 20:56:09.000000000 -0700
@@ -325,72 +325,72 @@
};
struct h_list helpstr[] = {
- '?', " prints help", TRUE,
- '/', " identify object", TRUE,
- 'h', " left", TRUE,
- 'j', " down", TRUE,
- 'k', " up", TRUE,
- 'l', " right", TRUE,
- 'y', " up & left", TRUE,
- 'u', " up & right", TRUE,
- 'b', " down & left", TRUE,
- 'n', " down & right", TRUE,
- 'H', " run left", FALSE,
- 'J', " run down", FALSE,
- 'K', " run up", FALSE,
- 'L', " run right", FALSE,
- 'Y', " run up & left", FALSE,
- 'U', " run up & right", FALSE,
- 'B', " run down & left", FALSE,
- 'N', " run down & right", FALSE,
- CTRL('H'), " run left until adjacent", FALSE,
- CTRL('J'), " run down until adjacent", FALSE,
- CTRL('K'), " run up until adjacent", FALSE,
- CTRL('L'), " run right until adjacent", FALSE,
- CTRL('Y'), " run up & left until adjacent", FALSE,
- CTRL('U'), " run up & right until adjacent", FALSE,
- CTRL('B'), " run down & left until adjacent", FALSE,
- CTRL('N'), " run down & right until adjacent", FALSE,
- '\0', " <SHIFT><dir>: run that way", TRUE,
- '\0', " <CTRL><dir>: run till adjacent", TRUE,
- 'f', "<dir> fight till death or near death", TRUE,
- 't', "<dir> throw something", TRUE,
- 'm', "<dir> move onto without picking up", TRUE,
- 'z', "<dir> zap a wand in a direction", TRUE,
- '^', "<dir> identify trap type", TRUE,
- 's', " search for trap/secret door", TRUE,
- '>', " go down a staircase", TRUE,
- '<', " go up a staircase", TRUE,
- '.', " rest for a turn", TRUE,
- ',', " pick something up", TRUE,
- 'i', " inventory", TRUE,
- 'I', " inventory single item", TRUE,
- 'q', " quaff potion", TRUE,
- 'r', " read scroll", TRUE,
- 'e', " eat food", TRUE,
- 'w', " wield a weapon", TRUE,
- 'W', " wear armor", TRUE,
- 'T', " take armor off", TRUE,
- 'P', " put on ring", TRUE,
- 'R', " remove ring", TRUE,
- 'd', " drop object", TRUE,
- 'c', " call object", TRUE,
- 'a', " repeat last command", TRUE,
- ')', " print current weapon", TRUE,
- ']', " print current armor", TRUE,
- '=', " print current rings", TRUE,
- '@', " print current stats", TRUE,
- 'D', " recall what's been discovered", TRUE,
- 'o', " examine/set options", TRUE,
- CTRL('R'), " redraw screen", TRUE,
- CTRL('P'), " repeat last message", TRUE,
- ESCAPE, " cancel command", TRUE,
- 'S', " save game", TRUE,
- 'Q', " quit", TRUE,
- '!', " shell escape", TRUE,
- 'F', "<dir> fight till either of you dies", TRUE,
- 'v', " print version number", TRUE,
- 0, NULL
+ {'?', " prints help", TRUE},
+ {'/', " identify object", TRUE},
+ {'h', " left", TRUE},
+ {'j', " down", TRUE},
+ {'k', " up", TRUE},
+ {'l', " right", TRUE},
+ {'y', " up & left", TRUE},
+ {'u', " up & right", TRUE},
+ {'b', " down & left", TRUE},
+ {'n', " down & right", TRUE},
+ {'H', " run left", FALSE},
+ {'J', " run down", FALSE},
+ {'K', " run up", FALSE},
+ {'L', " run right", FALSE},
+ {'Y', " run up & left", FALSE},
+ {'U', " run up & right", FALSE},
+ {'B', " run down & left", FALSE},
+ {'N', " run down & right", FALSE},
+ {CTRL('H'), " run left until adjacent", FALSE},
+ {CTRL('J'), " run down until adjacent", FALSE},
+ {CTRL('K'), " run up until adjacent", FALSE},
+ {CTRL('L'), " run right until adjacent", FALSE},
+ {CTRL('Y'), " run up & left until adjacent", FALSE},
+ {CTRL('U'), " run up & right until adjacent", FALSE},
+ {CTRL('B'), " run down & left until adjacent", FALSE},
+ {CTRL('N'), " run down & right until adjacent", FALSE},
+ {'\0', " <SHIFT><dir>: run that way", TRUE},
+ {'\0', " <CTRL><dir>: run till adjacent", TRUE},
+ {'f', "<dir> fight till death or near death", TRUE},
+ {'t', "<dir> throw something", TRUE},
+ {'m', "<dir> move onto without picking up", TRUE},
+ {'z', "<dir> zap a wand in a direction", TRUE},
+ {'^', "<dir> identify trap type", TRUE},
+ {'s', " search for trap/secret door", TRUE},
+ {'>', " go down a staircase", TRUE},
+ {'<', " go up a staircase", TRUE},
+ {'.', " rest for a turn", TRUE},
+ {',', " pick something up", TRUE},
+ {'i', " inventory", TRUE},
+ {'I', " inventory single item", TRUE},
+ {'q', " quaff potion", TRUE},
+ {'r', " read scroll", TRUE},
+ {'e', " eat food", TRUE},
+ {'w', " wield a weapon", TRUE},
+ {'W', " wear armor", TRUE},
+ {'T', " take armor off", TRUE},
+ {'P', " put on ring", TRUE},
+ {'R', " remove ring", TRUE},
+ {'d', " drop object", TRUE},
+ {'c', " call object", TRUE},
+ {'a', " repeat last command", TRUE},
+ {')', " print current weapon", TRUE},
+ {']', " print current armor", TRUE},
+ {'=', " print current rings", TRUE},
+ {'@', " print current stats", TRUE},
+ {'D', " recall what's been discovered", TRUE},
+ {'o', " examine/set options", TRUE},
+ {CTRL('R'), " redraw screen", TRUE},
+ {CTRL('P'), " repeat last message", TRUE},
+ {ESCAPE, " cancel command", TRUE},
+ {'S', " save game", TRUE},
+ {'Q', " quit", TRUE},
+ {'!', " shell escape", TRUE},
+ {'F', "<dir> fight till either of you dies", TRUE},
+ {'v', " print version number", TRUE},
+ {0, NULL}
};
#ifdef TIOCGLTC
--- rogue-5.4.2/save.c.orig 2007-07-15 21:00:07.000000000 -0700
+++ rogue-5.4.2/save.c 2007-07-15 21:01:48.000000000 -0700
@@ -41,7 +41,7 @@
* Implement the "save game" command
*/
-save_game()
+void save_game()
{
FILE *savef;
int c;
@@ -146,7 +146,7 @@
* Write the saved game on the file
*/
-save_file(FILE *savef)
+void save_file(FILE *savef)
{
char buf[80];
mvcur(0, COLS - 1, LINES - 1, 0);
@@ -404,7 +404,7 @@
* read_scrore
* Read in the score file
*/
-rd_score(SCORE *top_ten, FILE *fd)
+void rd_score(SCORE *top_ten, FILE *fd)
{
unsigned int i;
@@ -423,7 +423,7 @@
* write_scrore
* Read in the score file
*/
-wr_score(SCORE *top_ten, FILE *outf)
+void wr_score(SCORE *top_ten, FILE *outf)
{
unsigned int i;
--- rogue-5.4.2/rooms.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/rooms.c 2007-07-15 21:44:45.000000000 -0700
@@ -27,7 +27,7 @@
* Create rooms and corridors with a connectivity graph
*/
-do_rooms()
+void do_rooms()
{
int i;
struct room *rp;
@@ -148,7 +148,7 @@
* rooms; for maze rooms, draw maze.
*/
-draw_room(struct room *rp)
+void draw_room(struct room *rp)
{
int y, x;
@@ -175,7 +175,7 @@
* Draw a vertical line
*/
-vert(struct room *rp, int startx)
+void vert(struct room *rp, int startx)
{
int y;
@@ -188,7 +188,7 @@
* Draw a horizontal line
*/
-horiz(struct room *rp, int starty)
+void horiz(struct room *rp, int starty)
{
int x;
@@ -206,7 +206,7 @@
static SPOT maze[NUMLINES/3+1][NUMCOLS/3+1];
-do_maze(struct room *rp)
+void do_maze(struct room *rp)
{
SPOT *sp;
int starty, startx;
@@ -235,7 +235,7 @@
* Dig out from around where we are now, if possible
*/
-dig(int y, int x)
+void dig(int y, int x)
{
coord *cp;
int cnt, newy, newx, nexty = 0, nextx = 0;
@@ -294,7 +294,7 @@
* Account for maze exits
*/
-accnt_maze(int y, int x, int ny, int nx)
+void accnt_maze(int y, int x, int ny, int nx)
{
SPOT *sp;
coord *cp;
@@ -312,7 +312,7 @@
* Pick a random spot in a room
*/
-rnd_pos(struct room *rp, coord *cp)
+void rnd_pos(struct room *rp, coord *cp)
{
cp->x = rp->r_pos.x + rnd(rp->r_max.x - 2) + 1;
cp->y = rp->r_pos.y + rnd(rp->r_max.y - 2) + 1;
@@ -360,7 +360,7 @@
* Code that is executed whenver you appear in a room
*/
-enter_room(coord *cp)
+void enter_room(coord *cp)
{
struct room *rp;
THING *tp;
@@ -406,7 +406,7 @@
* Code for when we exit a room
*/
-leave_room(coord *cp)
+void leave_room(coord *cp)
{
PLACE *pp;
struct room *rp;
--- rogue-5.4.2/fight.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/fight.c 2007-07-15 21:54:00.000000000 -0700
@@ -59,7 +59,7 @@
* fight:
* The player attacks the monster.
*/
-fight(mp, weap, thrown)
+bool fight(mp, weap, thrown)
register coord *mp;
register THING *weap;
bool thrown;
@@ -137,7 +137,7 @@
* attack:
* The monster attacks the player
*/
-attack(mp)
+int attack(mp)
register THING *mp;
{
register char *mname;
@@ -212,7 +212,7 @@
/*
* Rattlesnakes have poisonous bites
*/
- if (!save(VS_POISON))
+ if (!save(VS_POISON)) {
if (!ISWEARING(R_SUSTSTR))
{
chg_str(-1);
@@ -221,11 +221,14 @@
else
msg("a bite has weakened you");
}
- else if (!to_death)
- if (!terse)
+ else if (!to_death) {
+ if (!terse) {
msg("a bite momentarily weakens you");
- else
+ } else {
msg("bite has no effect");
+ }
+ }
+ }
when 'W':
case 'V':
/*
@@ -372,7 +375,7 @@
* swing:
* Returns true if the swing hits
*/
-swing(at_lvl, op_arm, wplus)
+int swing(at_lvl, op_arm, wplus)
int at_lvl, op_arm, wplus;
{
int res = rnd(20);
@@ -412,17 +415,21 @@
dplus = (weap == NULL ? 0 : weap->o_dplus);
if (weap == cur_weapon)
{
- if (ISRING(LEFT, R_ADDDAM))
+ if (ISRING(LEFT, R_ADDDAM)) {
dplus += cur_ring[LEFT]->o_arm;
- else if (ISRING(LEFT, R_ADDHIT))
+ }
+ else if (ISRING(LEFT, R_ADDHIT)) {
hplus += cur_ring[LEFT]->o_arm;
- if (ISRING(RIGHT, R_ADDDAM))
+ }
+ if (ISRING(RIGHT, R_ADDDAM)) {
dplus += cur_ring[RIGHT]->o_arm;
- else if (ISRING(RIGHT, R_ADDHIT))
+ }
+ else if (ISRING(RIGHT, R_ADDHIT)) {
hplus += cur_ring[RIGHT]->o_arm;
+ }
}
cp = weap->o_damage;
- if (hurl)
+ if (hurl) {
if ((weap->o_flags&ISMISL) && cur_weapon != NULL &&
cur_weapon->o_which == weap->o_launch)
{
@@ -430,8 +437,10 @@
hplus += cur_weapon->o_hplus;
dplus += cur_weapon->o_dplus;
}
- else if (weap->o_launch < 0)
+ else if (weap->o_launch < 0) {
cp = weap->o_hurldmg;
+ }
+ }
}
/*
* If the creature being attacked is not running (alseep or held)
@@ -500,7 +509,7 @@
* thunk:
* A missile hits a monster
*/
-thunk(weap, mname, noend)
+void thunk(weap, mname, noend)
register THING *weap;
register char *mname;
register bool noend;
@@ -521,7 +530,7 @@
* Print a message to indicate a succesful hit
*/
-hit(er, ee, noend)
+void hit(er, ee, noend)
register char *er, *ee;
bool noend;
{
@@ -552,7 +561,7 @@
* miss:
* Print a message to indicate a poor swing
*/
-miss(er, ee, noend)
+void miss(er, ee, noend)
register char *er, *ee;
bool noend;
{
@@ -579,7 +588,7 @@
* bounce:
* A missile misses a monster
*/
-bounce(weap, mname, noend)
+void bounce(weap, mname, noend)
register THING *weap;
register char *mname;
bool noend;
@@ -599,7 +608,7 @@
* remove_mon:
* Remove a monster from the screen
*/
-remove_mon(mp, tp, waskill)
+void remove_mon(mp, tp, waskill)
register coord *mp;
register THING *tp;
bool waskill;
@@ -633,7 +642,7 @@
* killed:
* Called to put a monster to death
*/
-killed(tp, pr)
+void killed(tp, pr)
register THING *tp;
bool pr;
{
--- rogue-5.4.2/options.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/options.c 2007-07-15 21:23:46.000000000 -0700
@@ -33,14 +33,14 @@
char *o_prompt; /* prompt for interactive entry */
int *o_opt; /* pointer to thing to set */
/* function to print value */
- int (*o_putfunc)(void *opt);
+ void (*o_putfunc)(void *opt);
/* function to get value interactively */
int (*o_getfunc)(void *opt, WINDOW *win);
};
typedef struct optstruct OPTION;
-int pr_optname(OPTION *op);
+void pr_optname(OPTION *op);
OPTION optlist[] = {
{"terse", "Terse output",
@@ -70,7 +70,7 @@
* Print and then set options from the terminal
*/
-option()
+void option()
{
OPTION *op;
int retval;
@@ -92,19 +92,19 @@
for (op = optlist; op < &optlist[NUM_OPTS]; op++)
{
pr_optname(op);
- if ((retval = (*op->o_getfunc)(op->o_opt, hw)))
- if (retval == QUIT)
+ if ((retval = (*op->o_getfunc)(op->o_opt, hw))) {
+ if (retval == QUIT) {
break;
- else if (op > optlist) { /* MINUS */
+ } else if (op > optlist) { /* MINUS */
wmove(hw, (op - optlist) - 1, 0);
op -= 2;
- }
- else /* trying to back up beyond the top */
+ } else /* trying to back up beyond the top */
{
putchar('\007');
wmove(hw, 0, 0);
op--;
}
+ }
}
/*
* Switch back to original screen
@@ -125,7 +125,7 @@
* Print out the option name prompt
*/
-pr_optname(OPTION *op)
+void pr_optname(OPTION *op)
{
wprintw(hw, "%s (\"%s\"): ", op->o_prompt, op->o_name);
}
@@ -135,7 +135,7 @@
* Put out a boolean
*/
-put_bool(void *b)
+void put_bool(void *b)
{
waddstr(hw, *(bool *) b ? "True" : "False");
}
@@ -145,7 +145,7 @@
* Put out a string
*/
-put_str(void *str)
+void put_str(void *str)
{
waddstr(hw, (char *) str);
}
@@ -155,7 +155,7 @@
* Put out an inventory type
*/
-put_inv_t(void *ip)
+void put_inv_t(void *ip)
{
waddstr(hw, inv_t_name[*(int *) ip]);
}
@@ -393,7 +393,7 @@
* or the end of the entire option string.
*/
-parse_opts(char *str)
+void parse_opts(char *str)
{
char *sp;
OPTION *op;
@@ -481,7 +481,7 @@
* Copy string using unctrl for things
*/
-strucpy(char *s1, char *s2, int len)
+void strucpy(char *s1, char *s2, int len)
{
if (len > MAXINP)
len = MAXINP;
--- rogue-5.4.2/mach_dep.c.orig 2007-07-15 20:53:43.000000000 -0700
+++ rogue-5.4.2/mach_dep.c 2007-07-15 20:56:09.000000000 -0700
@@ -75,7 +75,7 @@
* Check out too see if it is proper to play the game now
*/
-init_check()
+void init_check()
{
#if defined(MAXLOAD) || defined(MAXUSERS)
if (too_much())
@@ -97,7 +97,7 @@
* setuid(getuid()) in case we are running setuid.
*/
-open_score()
+void open_score()
{
char *homedir = md_getroguedir();
@@ -144,7 +144,7 @@
* Get starting setup for all games
*/
-setup()
+void setup()
{
#ifdef CHECKTIME
int checkout();
@@ -199,7 +199,7 @@
* Get the local tty chars for later use
*/
-getltchars()
+void getltchars()
{
#ifdef TIOCGLTC
ioctl(1, TIOCGLTC, <c);
@@ -245,7 +245,7 @@
* Start the scoring sequence
*/
-start_score()
+void start_score()
{
#ifdef CHECKTIME
signal(SIGALRM, SIG_IGN);
@@ -512,7 +512,7 @@
* Unlock the score file
*/
-unlock_sc()
+void unlock_sc()
{
#ifdef SCOREFILE
if (lfd != -1)
@@ -527,7 +527,7 @@
* Flush typeahead for traps, etc.
*/
-flush_type()
+void flush_type()
{
flushinp();
}
--- rogue-5.4.2/rip.c.orig 2007-07-15 21:40:02.000000000 -0700
+++ rogue-5.4.2/rip.c 2007-07-15 22:00:59.000000000 -0700
@@ -25,7 +25,7 @@
#include <fcntl.h>
#ifdef attron
-int _putchar(char c);
+void _putchar(char c);
# define _puts(s) tputs(s, 0, _putchar);
# define SO enter_standout_mode
# define SE exit_standout_mode
@@ -54,7 +54,7 @@
*/
/* VARARGS2 */
-score(int amount, int flags, char monst)
+void score(int amount, int flags, char monst)
{
SCORE *scp;
int i;
@@ -177,7 +177,7 @@
if (scp->sc_score) {
if (sc2 == scp)
md_raw_standout();
- printf("%2d %5d %s: %s on level %d", scp - top_ten + 1,
+ printf("%2ld %5d %s: %s on level %d", scp - top_ten + 1,
scp->sc_score, scp->sc_name, reason[scp->sc_flags],
scp->sc_level);
if (scp->sc_flags == 0 || scp->sc_flags == 3)
@@ -236,7 +236,7 @@
* Do something really fun when he dies
*/
-death(char monst)
+void death(char monst)
{
char **dp, *killer;
struct tm *lt;
@@ -300,7 +300,7 @@
* Code for a winner
*/
-total_winner()
+void total_winner()
{
THING *obj;
struct obj_info *op;
@@ -362,11 +362,13 @@
op = &ring_info[obj->o_which];
worth = op->oi_worth;
if (obj->o_which == R_ADDSTR || obj->o_which == R_ADDDAM ||
- obj->o_which == R_PROTECT || obj->o_which == R_ADDHIT)
- if (obj->o_arm > 0)
+ obj->o_which == R_PROTECT || obj->o_which == R_ADDHIT) {
+ if (obj->o_arm > 0) {
worth += obj->o_arm * 100;
- else
+ } else {
worth = 10;
+ }
+ }
if (!(obj->o_flags & ISKNOW))
worth /= 2;
obj->o_flags |= ISKNOW;
@@ -404,12 +406,12 @@
char *sp;
bool article;
static struct h_list nlist[] = {
- 'a', "arrow", TRUE,
- 'b', "bolt", TRUE,
- 'd', "dart", TRUE,
- 'h', "hypothermia", FALSE,
- 's', "starvation", FALSE,
- '\0'
+ {'a', "arrow", TRUE},
+ {'b', "bolt", TRUE},
+ {'d', "dart", TRUE},
+ {'h', "hypothermia", FALSE},
+ {'s', "starvation", FALSE},
+ {'\0'}
};
if (isupper(monst))
@@ -457,7 +459,7 @@
}
#ifdef attron
-int
+void
_putchar(char c)
{
putchar(c);
--- rogue-5.4.2/move.c.orig 2007-07-15 21:19:33.000000000 -0700
+++ rogue-5.4.2/move.c 2007-07-15 21:19:26.000000000 -0700
@@ -25,7 +25,7 @@
* Start the hero running
*/
-do_run(char ch)
+void do_run(char ch)
{
running = TRUE;
after = FALSE;
@@ -38,7 +38,7 @@
* consequences (fighting, picking up, etc.)
*/
-do_move(int dy, int dx)
+void do_move(int dy, int dx)
{
char ch, fl;
@@ -217,7 +217,7 @@
* Decide whether to refresh at a passage turning or not
*/
-turnref()
+void turnref()
{
PLACE *pp;
@@ -240,7 +240,7 @@
* that might move.
*/
-door_open(struct room *rp)
+void door_open(struct room *rp)
{
int y, x;
@@ -398,7 +398,7 @@
* aren't wearing a magic ring.
*/
-rust_armor(THING *arm)
+void rust_armor(THING *arm)
{
if (arm == NULL || arm->o_type != ARMOR || arm->o_which == LEATHER ||
arm->o_arm >= 9)
--- rogue-5.4.2/rogue.h.orig 2006-01-03 18:25:10.000000000 -0800
+++ rogue-5.4.2/rogue.h 2007-07-15 22:20:01.000000000 -0700
@@ -501,85 +501,117 @@
/*
* Function types
*/
-int accnt_maze(int y, int x, int ny, int nx);
-int badcheck(char *name, struct obj_info *info, int bound);
-int bounce(THING *weap, char *mname, bool noend);
-int call();
-int check_level();
-int conn(int r1, int r2);
-int current(THING *cur, char *how, char *where);
-int d_level();
-int dig(int y, int x);
-int discard(THING *item);
+void accnt_maze(int y, int x, int ny, int nx);
+void add_str(str_t *sp, int amt);
+void addmsg(char *fmt, ...);
+void _attach(THING **list, THING *item);
+void badcheck(char *name, struct obj_info *info, int bound);
+void bounce(THING *weap, char *mname, bool noend);
+void call();
+void check_level();
+void chg_str(int amt);
+void conn(int r1, int r2);
+void current(THING *cur, char *how, char *where);
+void death(char monst);
+void _detach(THING **list, THING *item);
+void d_level();
+void dig(int y, int x);
+void discard(THING *item);
int do_chase(THING *th);
-int do_maze(struct room *rp);
-int do_motion(THING *obj, int ydelta, int xdelta);
-int do_pot(int type, bool knowit);
-int doadd(char *fmt, va_list args);
-int door(struct room *rm, coord *cp);
-int drain();
-int draw_room(struct room *rp);
+void do_daemons(register int flag);
+void do_maze(struct room *rp);
+void do_motion(THING *obj, int ydelta, int xdelta);
+void do_pot(int type, bool knowit);
+/*void addmsg(char *fmt, va_list args);*/
+int endmsg();
+void doadd(char *fmt, va_list args);
+void door(struct room *rm, coord *cp);
+void do_fuses(register int flag);
+void drain();
+void draw_room(struct room *rp);
size_t encread(char *start, size_t size, int inf);
size_t encwrite(char *start, size_t size, FILE *outf);
-int erase_lamp(coord *pos, struct room *rp);
-int fall(THING *obj, bool pr);
-int fire_bolt(coord *start, coord *dir, char *name);
-int help();
-int hit(char *er, char *ee, bool noend);
-int horiz(struct room *rp, int starty);
-int identify();
-int illcom(int ch);
-int invis_on();
-int killed(THING *tp, bool pr);
-int miss(char *er, char *ee, bool noend);
-int money(int value);
+void enter_room(coord *cp);
+void erase_lamp(coord *pos, struct room *rp);
+void extinguish(void (*func)());
+void fall(THING *obj, bool pr);
+void fire_bolt(coord *start, coord *dir, char *name);
+char floor_at();
+void flush_type();
+void help();
+void hit(char *er, char *ee, bool noend);
+void horiz(struct room *rp, int starty);
+void identify();
+void illcom(int ch);
+void init_weapon(THING *weap, char which);
+void invis_on();
+void killed(THING *tp, bool pr);
+void leave_room(coord *cp);
+void look(bool wakeup);
+int md_unlink(char *file);
+int md_unlink_open_file(char *file, int inf);
+void miss(char *er, char *ee, bool noend);
+void money(int value);
int move_monst(THING *tp);
-int move_msg(THING *obj);
-int nameit(THING *obj, char *type, char *which, struct obj_info *op, char *(*prfunc)(THING *));
-int numpass(int y, int x);
-int passnum();
+void move_msg(THING *obj);
+int msg(char *fmt, ...);
+void nameit(THING *obj, char *type, char *which, struct obj_info *op, char *(*prfunc)(THING *));
+void new_monster(THING *tp, char type, coord *cp);
+void numpass(int y, int x);
+void passnum();
int pr_spec(struct obj_info *info, int nitems);
-int put_bool(void *b);
-int put_inv_t(void *ip);
-int put_str(void *str);
-int put_things();
-int putpass(coord *cp);
-int raise_level();
+void put_bool(void *b);
+void put_inv_t(void *ip);
+void put_str(void *str);
+void put_things();
+void putpass(coord *cp);
+void raise_level();
+int readchar();
void relocate(THING *th, coord *new_loc);
-int remove_mon(coord *mp, THING *tp, bool waskill);
-int reset_last();
-int rust_armor(THING *arm);
-int save_file(FILE *savef);
-int search();
-int set_know(THING *obj, struct obj_info *info);
-int set_oldch(THING *tp, coord *cp);
-int strucpy(char *s1, char *s2, int len);
-int thunk(THING *weap, char *mname, bool noend);
-int treas_room();
-int turnref();
-int u_level();
-int uncurse(THING *obj);
-int vert(struct room *rp, int startx);
-int wait_for(int ch);
-int waste_time();
+void remove_mon(coord *mp, THING *tp, bool waskill);
+void reset_last();
+int rnd(int range);
+int roll(int number, int sides);
+void runto(register coord *runner);
+void rust_armor(THING *arm);
+void save_file(FILE *savef);
+void search();
+void set_know(THING *obj, struct obj_info *info);
+void set_oldch(THING *tp, coord *cp);
+int spread(int nm);
+void strucpy(char *s1, char *s2, int len);
+void thunk(THING *weap, char *mname, bool noend);
+void treas_room();
+void turnref();
+void u_level();
+void uncurse(THING *obj);
+void vert(struct room *rp, int startx);
+void wait_for(int ch);
+void waste_time();
+bool cansee(register int y, register int x);
bool chase(THING *tp, coord *ee);
bool diag_ok(coord *sp, coord *ep);
bool dropcheck(THING *obj);
bool fallpos(coord *pos, coord *newpos);
+bool fight(register coord *mp, register THING *weap, bool thrown);
bool find_floor(struct room *rp, coord *cp, int limit, bool monst);
+bool hit_monster(int y, int x, THING *obj);
bool is_magic(THING *obj);
bool levit_check();
bool pack_room(bool from_floor, THING *obj);
bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl);
+int save(int which);
bool see_monst(THING *mp);
bool seen_stairs();
+bool step_ok(char ch);
bool turn_ok(int y, int x);
bool turn_see(bool turn_off);
char be_trapped(coord *tc);
char floor_ch();
char pack_char();
+char randmonster(bool wander);
char *charge_str(THING *obj);
char *choose_str(char *ts, char *ns);
@@ -612,7 +644,7 @@
extern struct delayed_action {
int d_type;
- int (*d_func)();
+ void (*d_func)();
int d_arg;
int d_time;
} d_list[MAXDAEMONS];
--- rogue-5.4.2/list.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/list.c 2007-07-15 20:56:09.000000000 -0700
@@ -22,7 +22,7 @@
* takes an item out of whatever linked list it might be in
*/
-_detach(THING **list, THING *item)
+void _detach(THING **list, THING *item)
{
if (*list == item)
*list = next(item);
@@ -39,7 +39,7 @@
* add an item to the head of a list
*/
-_attach(THING **list, THING *item)
+void _attach(THING **list, THING *item)
{
if (*list != NULL)
{
@@ -60,7 +60,7 @@
* Throw the whole blamed thing away
*/
-_free_list(THING **ptr)
+void _free_list(THING **ptr)
{
THING *item;
@@ -77,7 +77,7 @@
* Free up an item
*/
-discard(THING *item)
+void discard(THING *item)
{
#ifdef MASTER
total--;
--- rogue-5.4.2/xcrypt.c.orig 2007-07-15 21:16:41.000000000 -0700
+++ rogue-5.4.2/xcrypt.c 2007-07-15 21:51:14.000000000 -0700
@@ -57,6 +57,9 @@
#endif
#define _PASSWORD_EFMT1 '_'
+unsigned long int md_htonl(unsigned long int x);
+unsigned long int md_ntohl(unsigned long int x);
+
static unsigned char IP[64] = {
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
@@ -551,8 +554,8 @@
static int
des_cipher(in, out, salt, count)
- const char *in;
- char *out;
+ const unsigned char *in;
+ unsigned char *out;
int salt;
int count;
{
--- rogue-5.4.2/extern.h.orig 2007-07-15 20:54:32.000000000 -0700
+++ rogue-5.4.2/extern.h 2007-07-15 20:59:13.000000000 -0700
@@ -64,31 +64,31 @@
#include <string.h>
void auto_save(int);
-int come_down();
-int doctor();
-int end_line();
+void come_down();
+void doctor();
+void end_line();
void endit(int sig);
-int fatal();
-int getltchars();
-int land();
+void fatal();
+void getltchars();
+void land();
void leave(int);
-int my_exit();
-int nohaste();
-int playit();
+void my_exit();
+void nohaste();
+void playit();
void playltchars(void);
-int print_disc(char);
+void print_disc(char);
void quit(int);
void resetltchars(void);
-int rollwand();
-int runners();
-int set_order();
-int sight();
-int stomach();
-int swander();
-int tstp();
-int unconfuse();
-int unsee();
-int visuals();
+void rollwand();
+void runners();
+void set_order();
+void sight();
+void stomach();
+void swander();
+void tstp();
+void unconfuse();
+void unsee();
+void visuals();
char add_line(char *fmt, char *arg);
--- rogue-5.4.2/daemons.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/daemons.c 2007-07-15 20:56:09.000000000 -0700
@@ -17,7 +17,7 @@
* doctor:
* A healing daemon that restors hit points after rest
*/
-doctor()
+void doctor()
{
register int lv, ohp;
@@ -48,7 +48,7 @@
* Swander:
* Called when it is time to start rolling for wandering monsters
*/
-swander()
+void swander()
{
start_daemon(rollwand, 0, BEFORE);
}
@@ -58,7 +58,7 @@
* Called to roll to see if a wandering monster starts up
*/
int between = 0;
-rollwand()
+void rollwand()
{
if (++between >= 4)
@@ -77,7 +77,7 @@
* unconfuse:
* Release the poor player from his confusion
*/
-unconfuse()
+void unconfuse()
{
player.t_flags &= ~ISHUH;
msg("you feel less %s now", choose_str("trippy", "confused"));
@@ -87,7 +87,7 @@
* unsee:
* Turn off the ability to see invisible
*/
-unsee()
+void unsee()
{
register THING *th;
@@ -101,7 +101,7 @@
* sight:
* He gets his sight back
*/
-sight()
+void sight()
{
if (on(player, ISBLIND))
{
@@ -118,7 +118,7 @@
* nohaste:
* End the hasting
*/
-nohaste()
+void nohaste()
{
player.t_flags &= ~ISHASTE;
msg("you feel yourself slowing down");
@@ -128,7 +128,7 @@
* stomach:
* Digest the hero's food
*/
-stomach()
+void stomach()
{
register int oldfood;
int orig_hungry = hungry_state;
@@ -182,7 +182,7 @@
* come_down:
* Take the hero down off her acid trip.
*/
-come_down()
+void come_down()
{
register THING *tp;
register bool seemonst;
@@ -229,7 +229,7 @@
* visuals:
* change the characters for the player
*/
-visuals()
+void visuals()
{
register THING *tp;
register bool seemonst;
@@ -276,7 +276,7 @@
* land:
* Land from a levitation potion
*/
-land()
+void land()
{
player.t_flags &= ~ISLEVIT;
msg(choose_str("bummer! You've hit the ground",
--- rogue-5.4.2/command.c.orig 2006-01-29 18:24:39.000000000 -0800
+++ rogue-5.4.2/command.c 2007-07-15 21:28:10.000000000 -0700
@@ -18,7 +18,7 @@
* command:
* Process the user commands
*/
-command()
+void command()
{
register char ch;
register int ntimes = 1; /* Number of player moves */
@@ -453,7 +453,7 @@
* illcom:
* What to do with an illegal command
*/
-illcom(ch)
+void illcom(ch)
int ch;
{
save_msg = FALSE;
@@ -466,7 +466,7 @@
* search:
* player gropes about him to find hidden things.
*/
-search()
+void search()
{
register int y, x;
register char *fp;
@@ -529,7 +529,7 @@
* help:
* Give single character help, or the whole mess if he wants it
*/
-help()
+void help()
{
register struct h_list *strp;
register char helpch;
@@ -598,31 +598,31 @@
* identify:
* Tell the player what a certain thing is.
*/
-identify()
+void identify()
{
register int ch;
register struct h_list *hp;
register char *str;
static struct h_list ident_list[] = {
- '|', "wall of a room", FALSE,
- '-', "wall of a room", FALSE,
- GOLD, "gold", FALSE,
- STAIRS, "a staircase", FALSE,
- DOOR, "door", FALSE,
- FLOOR, "room floor", FALSE,
- PLAYER, "you", FALSE,
- PASSAGE, "passage", FALSE,
- TRAP, "trap", FALSE,
- POTION, "potion", FALSE,
- SCROLL, "scroll", FALSE,
- FOOD, "food", FALSE,
- WEAPON, "weapon", FALSE,
- ' ', "solid rock", FALSE,
- ARMOR, "armor", FALSE,
- AMULET, "the Amulet of Yendor", FALSE,
- RING, "ring", FALSE,
- STICK, "wand or staff", FALSE,
- '\0'
+ {'|', "wall of a room", FALSE},
+ {'-', "wall of a room", FALSE},
+ {GOLD, "gold", FALSE},
+ {STAIRS, "a staircase", FALSE},
+ {DOOR, "door", FALSE},
+ {FLOOR, "room floor", FALSE},
+ {PLAYER, "you", FALSE},
+ {PASSAGE, "passage", FALSE},
+ {TRAP, "trap", FALSE},
+ {POTION, "potion", FALSE},
+ {SCROLL, "scroll", FALSE},
+ {FOOD, "food", FALSE},
+ {WEAPON, "weapon", FALSE},
+ {' ', "solid rock", FALSE},
+ {ARMOR, "armor", FALSE},
+ {AMULET, "the Amulet of Yendor", FALSE},
+ {RING, "ring", FALSE},
+ {STICK, "wand or staff", FALSE},
+ {'\0'}
};
msg("what do you want identified? ");
@@ -652,7 +652,7 @@
* d_level:
* He wants to go down a level
*/
-d_level()
+void d_level()
{
if (levit_check())
return;
@@ -670,7 +670,7 @@
* u_level:
* He wants to go up a level
*/
-u_level()
+void u_level()
{
if (levit_check())
return;
@@ -707,7 +707,7 @@
* call:
* Allow a user to call a potion, scroll, or ring something
*/
-call()
+void call()
{
register THING *obj;
register struct obj_info *op = NULL;
@@ -783,7 +783,7 @@
* current:
* Print the current weapon/armor
*/
-current(cur,how,where)
+void current(cur,how,where)
register THING *cur;
register char *how;
register char *where;
--- rogue-5.4.2/chase.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/chase.c 2007-07-15 21:52:34.000000000 -0700
@@ -21,7 +21,7 @@
* runners:
* Make all the running monsters move.
*/
-runners()
+void runners()
{
register THING *tp;
THING *next;
@@ -58,7 +58,7 @@
* move_monst:
* Execute a single turn of running for a monster
*/
-move_monst(tp)
+int move_monst(tp)
register THING *tp;
{
if (!on(*tp, ISSLOW) || tp->t_turn)
@@ -109,7 +109,7 @@
* do_chase:
* Make one thing chase another.
*/
-do_chase(th)
+int do_chase(th)
register THING *th;
{
register coord *cp;
@@ -229,7 +229,7 @@
* set_oldch:
* Set the oldch character for the monster
*/
-set_oldch(tp, cp)
+void set_oldch(tp, cp)
register THING *tp;
register coord *cp;
{
@@ -240,12 +240,15 @@
sch = tp->t_oldch;
tp->t_oldch = mvinch(cp->y,cp->x);
- if (!on(player, ISBLIND))
+ if (!on(player, ISBLIND)) {
if ((sch == FLOOR || tp->t_oldch == FLOOR) &&
- (tp->t_room->r_flags & ISDARK))
+ (tp->t_room->r_flags & ISDARK)) {
tp->t_oldch = ' ';
- else if (dist_cp(cp, &hero) <= LAMPDIST && see_floor)
+ }
+ else if (dist_cp(cp, &hero) <= LAMPDIST && see_floor) {
tp->t_oldch = chat(cp->y, cp->x);
+ }
+ }
}
/*
@@ -280,7 +283,7 @@
* runto:
* Set a monster running after the hero.
*/
-runto(runner)
+void runto(runner)
register coord *runner;
{
register THING *tp;
--- rogue-5.4.2/things.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/things.c 2007-07-15 21:02:09.000000000 -0700
@@ -139,7 +139,7 @@
* Put something down
*/
-drop()
+void drop()
{
char ch;
THING *obj;
@@ -339,7 +339,7 @@
static char *lastfmt, *lastarg;
-discovered()
+void discovered()
{
char ch;
bool disc_list;
@@ -398,7 +398,7 @@
#define MAX4(a,b,c,d) (a > b ? (a > c ? (a > d ? a : d) : (c > d ? c : d)) : (b > c ? (b > d ? b : d) : (c > d ? c : d)))
-print_disc(char type)
+void print_disc(char type)
{
struct obj_info *info = NULL;
int i, maxnum = 0, num_found;
@@ -445,7 +445,7 @@
* Set up order for list
*/
-set_order(short *order, int numthings)
+void set_order(short *order, int numthings)
{
int i, r, t;
@@ -510,11 +510,13 @@
/*
* if there are lines below, use 'em
*/
- if (LINES > NUMLINES)
- if (NUMLINES + line_cnt > LINES)
+ if (LINES > NUMLINES) {
+ if (NUMLINES + line_cnt > LINES) {
mvwin(tw, LINES - (line_cnt + 1), COLS - maxlen - 3);
- else
+ } else {
mvwin(tw, NUMLINES, 0);
+ }
+ }
touchwin(tw);
wrefresh(tw);
wait_for(' ');
@@ -561,16 +563,17 @@
* End the list of lines
*/
-end_line()
+void end_line()
{
- if (inv_type != INV_SLOW)
+ if (inv_type != INV_SLOW) {
if (line_cnt == 1 && !newpage)
{
mpos = 0;
msg(lastfmt, lastarg);
- }
- else
+ } else {
add_line((char *) NULL, NULL);
+ }
+ }
line_cnt = 0;
newpage = FALSE;
}
@@ -608,7 +611,7 @@
* Give the proper name to a potion, stick, or ring
*/
-nameit(THING *obj, char *type, char *which, struct obj_info *op,
+void nameit(THING *obj, char *type, char *which, struct obj_info *op,
char *(*prfunc)(THING *))
{
char *pb;
--- rogue-5.4.2/armor.c.orig 2005-04-07 17:48:27.000000000 -0700
+++ rogue-5.4.2/armor.c 2007-07-15 20:56:09.000000000 -0700
@@ -16,7 +16,7 @@
* wear:
* The player wants to wear something, so let him/her put it on.
*/
-wear()
+void wear()
{
register THING *obj;
register char *sp;
@@ -50,7 +50,7 @@
* take_off:
* Get the armor off of the players back
*/
-take_off()
+void take_off()
{
register THING *obj;
@@ -77,7 +77,7 @@
* waste_time:
* Do nothing but let other things happen
*/
-waste_time()
+void waste_time()
{
do_daemons(BEFORE);
do_fuses(BEFORE);
--- rogue-5.4.2/scrolls.c.orig 2005-04-07 17:48:27.000000000 -0700
+++ rogue-5.4.2/scrolls.c 2007-07-15 21:55:17.000000000 -0700
@@ -19,7 +19,7 @@
* Read a scroll from the pack and do the appropriate thing
*/
-read_scroll()
+void read_scroll()
{
THING *obj;
PLACE *pp;
@@ -124,15 +124,17 @@
/*
* Or anything else nasty
*/
- else if (step_ok(ch = winat(y, x)))
+ else if (step_ok(ch = winat(y, x))) {
if (ch == SCROLL
- && find_obj(y, x)->o_which == S_SCARE)
+ && find_obj(y, x)->o_which == S_SCARE) {
continue;
+ }
else if (rnd(++i) == 0)
{
mp.y = y;
mp.x = x;
}
+ }
if (i == 0)
msg("you hear a faint cry of anguish in the distance");
else
@@ -318,7 +320,7 @@
* Uncurse an item
*/
-uncurse(THING *obj)
+void uncurse(THING *obj)
{
if (obj != NULL)
obj->o_flags &= ~ISCURSED;
--- rogue-5.4.2/daemon.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/daemon.c 2007-07-15 22:05:27.000000000 -0700
@@ -49,7 +49,7 @@
*/
struct delayed_action *
find_slot(func)
-register int (*func)();
+register void (*func)();
{
register struct delayed_action *dev;
@@ -63,8 +63,9 @@
* start_daemon:
* Start a daemon, takes a function.
*/
-start_daemon(func, arg, type)
-int (*func)(), arg, type;
+void start_daemon(func, arg, type)
+void (*func)();
+int arg, type;
{
register struct delayed_action *dev;
@@ -79,7 +80,7 @@
* kill_daemon:
* Remove a daemon from the list
*/
-kill_daemon(func)
+void kill_daemon(func)
int (*func)();
{
register struct delayed_action *dev;
@@ -97,7 +98,7 @@
* Run all the daemons that are active with the current flag,
* passing the argument to the function.
*/
-do_daemons(flag)
+void do_daemons(flag)
register int flag;
{
register struct delayed_action *dev;
@@ -117,8 +118,9 @@
* fuse:
* Start a fuse to go off in a certain number of turns
*/
-fuse(func, arg, time, type)
-int (*func)(), arg, time, type;
+void fuse(func, arg, time, type)
+void (*func)();
+int arg, time, type;
{
register struct delayed_action *wire;
@@ -133,7 +135,7 @@
* lengthen:
* Increase the time until a fuse goes off
*/
-lengthen(func, xtime)
+void lengthen(func, xtime)
int (*func)();
int xtime;
{
@@ -148,8 +150,8 @@
* extinguish:
* Put out a fuse
*/
-extinguish(func)
-int (*func)();
+void extinguish(func)
+void (*func)();
{
register struct delayed_action *wire;
@@ -162,7 +164,7 @@
* do_fuses:
* Decrement counters and start needed fuses
*/
-do_fuses(flag)
+void do_fuses(flag)
register int flag;
{
register struct delayed_action *wire;
--- rogue-5.4.2/sticks.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/sticks.c 2007-07-15 21:17:41.000000000 -0700
@@ -20,7 +20,7 @@
* Set up a new stick
*/
-fix_stick(THING *cur)
+void fix_stick(THING *cur)
{
if (strcmp(ws_type[cur->o_which], "staff") == 0)
strncpy(cur->o_damage,"2x3",sizeof(cur->o_damage));
@@ -42,7 +42,7 @@
* Perform a zap with a wand
*/
-do_zap()
+void do_zap()
{
THING *obj, *tp;
int y, x;
@@ -243,7 +243,7 @@
* Do drain hit points from player shtick
*/
-drain()
+void drain()
{
THING *mp;
struct room *corp;
@@ -293,7 +293,7 @@
* Fire a bolt in a given direction from a specific starting place
*/
-fire_bolt(coord *start, coord *dir, char *name)
+void fire_bolt(coord *start, coord *dir, char *name)
{
coord *c1, *c2;
THING *tp;
@@ -384,11 +384,13 @@
changed = !changed;
if (!save(VS_MAGIC))
{
- if ((pstats.s_hpt -= roll(6, 6)) <= 0)
- if (start == &hero)
+ if ((pstats.s_hpt -= roll(6, 6)) <= 0) {
+ if (start == &hero) {
death('b');
- else
+ } else {
death(moat(start->y, start->x)->t_type);
+ }
+ }
used = TRUE;
if (terse)
msg("the %s hits", name);
--- rogue-5.4.2/pack.c.orig 2007-07-15 21:30:40.000000000 -0700
+++ rogue-5.4.2/pack.c 2007-07-15 21:35:03.000000000 -0700
@@ -21,7 +21,7 @@
* it off the ground.
*/
-add_pack(THING *obj, bool silent)
+void add_pack(THING *obj, bool silent)
{
THING *op, *lp;
bool from_floor;
@@ -59,23 +59,24 @@
lp = NULL;
for (op = pack; op != NULL; op = next(op))
{
- if (op->o_type != obj->o_type)
+ if (op->o_type != obj->o_type) {
lp = op;
- else
- {
+ } else {
while (op->o_type == obj->o_type && op->o_which != obj->o_which)
{
lp = op;
- if (next(op) == NULL)
+ if (next(op) == NULL) {
break;
- else
+ } else {
op = next(op);
+ }
}
- if (op->o_type == obj->o_type && op->o_which == obj->o_which)
+ if (op->o_type == obj->o_type && op->o_which == obj->o_which) {
if (ISMULT(op->o_type))
{
- if (!pack_room(from_floor, obj))
+ if (!pack_room(from_floor, obj)) {
return;
+ }
op->o_count++;
dump_it:
discard(obj);
@@ -91,10 +92,11 @@
&& op->o_group != obj->o_group)
{
lp = op;
- if (next(op) == NULL)
+ if (next(op) == NULL) {
break;
- else
+ } else {
op = next(op);
+ }
}
if (op->o_type == obj->o_type
&& op->o_which == obj->o_which
@@ -107,17 +109,19 @@
goto dump_it;
}
}
- else
+ else {
lp = op;
+ }
+ }
out:
break;
}
}
- if (lp != NULL)
- if (!pack_room(from_floor, obj))
+ if (lp != NULL) {
+ if (!pack_room(from_floor, obj)) {
return;
- else
+ } else
{
obj->o_packch = pack_char();
next(obj) = next(lp);
@@ -126,6 +130,7 @@
prev(next(lp)) = obj;
next(lp) = obj;
}
+ }
}
obj->o_flags |= ISFOUND;
@@ -285,7 +290,7 @@
* Add something to characters pack.
*/
-pick_up(char ch)
+void pick_up(char ch)
{
THING *obj;
@@ -328,7 +333,7 @@
* Print out the message if you are just moving onto an object
*/
-move_msg(THING *obj)
+void move_msg(THING *obj)
{
if (!terse)
addmsg("you ");
@@ -340,7 +345,7 @@
* Allow player to inventory a single item
*/
-picky_inven()
+void picky_inven()
{
THING *obj;
char mch;
@@ -438,7 +443,7 @@
* Add or subtract gold from the pack
*/
-money(int value)
+void money(int value)
{
purse += value;
mvaddch(hero.y, hero.x, floor_ch());
@@ -484,7 +489,7 @@
* Reset the last command when the current one is aborted
*/
-reset_last()
+void reset_last()
{
last_comm = l_last_comm;
last_dir = l_last_dir;
--- rogue-5.4.2/state.c.orig 2007-07-15 20:53:50.000000000 -0700
+++ rogue-5.4.2/state.c 2007-07-15 20:56:09.000000000 -0700
@@ -97,58 +97,6 @@
}
int
-rs_write_char(FILE *savef, char c)
-{
- if (write_error)
- return(WRITESTAT);
-
- rs_write(savef, &c, 1);
-
- return(WRITESTAT);
-}
-
-int
-rs_read_char(int inf, char *c)
-{
- if (read_error || format_error)
- return(READSTAT);
-
- rs_read(inf, c, 1);
-
- return(READSTAT);
-}
-
-int
-rs_write_chars(FILE *savef, char *c, int count)
-{
- if (write_error)
- return(WRITESTAT);
-
- rs_write_int(savef, count);
- rs_write(savef, c, count);
-
- return(WRITESTAT);
-}
-
-int
-rs_read_chars(int inf, char *i, int count)
-{
- int value = 0;
-
- if (read_error || format_error)
- return(READSTAT);
-
- rs_read_int(inf, &value);
-
- if (value != count)
- format_error = TRUE;
-
- rs_read(inf, i, count);
-
- return(READSTAT);
-}
-
-int
rs_write_int(FILE *savef, int c)
{
unsigned char bytes[4];
@@ -235,6 +183,58 @@
}
int
+rs_write_char(FILE *savef, char c)
+{
+ if (write_error)
+ return(WRITESTAT);
+
+ rs_write(savef, &c, 1);
+
+ return(WRITESTAT);
+}
+
+int
+rs_read_char(int inf, char *c)
+{
+ if (read_error || format_error)
+ return(READSTAT);
+
+ rs_read(inf, c, 1);
+
+ return(READSTAT);
+}
+
+int
+rs_write_chars(FILE *savef, char *c, int count)
+{
+ if (write_error)
+ return(WRITESTAT);
+
+ rs_write_int(savef, count);
+ rs_write(savef, c, count);
+
+ return(WRITESTAT);
+}
+
+int
+rs_read_chars(int inf, char *i, int count)
+{
+ int value = 0;
+
+ if (read_error || format_error)
+ return(READSTAT);
+
+ rs_read_int(inf, &value);
+
+ if (value != count)
+ format_error = TRUE;
+
+ rs_read(inf, i, count);
+
+ return(READSTAT);
+}
+
+int
rs_write_boolean(FILE *savef, bool c)
{
unsigned char buf = (c == 0) ? 0 : 1;
@@ -1860,7 +1860,7 @@
return(READSTAT);
}
-int
+void
rs_fix_thing(THING *t)
{
THING *item;
@@ -1941,7 +1941,7 @@
return(READSTAT);
}
-int
+void
rs_fix_thing_list(THING *list)
{
THING *item;
--- rogue-5.4.2/monsters.c.orig 2006-01-03 16:17:29.000000000 -0800
+++ rogue-5.4.2/monsters.c 2007-07-15 21:58:30.000000000 -0700
@@ -55,7 +55,7 @@
* Pick a new monster and add it to the list
*/
-new_monster(THING *tp, char type, coord *cp)
+void new_monster(THING *tp, char type, coord *cp)
{
struct monster *mp;
int lev_add;
@@ -113,7 +113,7 @@
* Create a new wandering monster and aim it at the player
*/
-wanderer()
+void wanderer()
{
THING *tp;
static coord cp;
@@ -209,7 +209,7 @@
* Give a pack to a monster if it deserves one
*/
-give_pack(THING *tp)
+void give_pack(THING *tp)
{
if (level >= max_level && rnd(100) < monsters[tp->t_type-'A'].m_carry)
attach(tp->t_pack, new_thing());
--- rogue-5.4.2/rings.c.orig 2007-07-15 21:39:17.000000000 -0700
+++ rogue-5.4.2/rings.c 2007-07-15 21:39:58.000000000 -0700
@@ -18,7 +18,7 @@
* Put a ring on a hand
*/
-ring_on()
+void ring_on()
{
THING *obj;
int ring;
@@ -89,7 +89,7 @@
* take off a ring
*/
-ring_off()
+void ring_off()
{
int ring;
THING *obj;