summaryrefslogtreecommitdiffstats
path: root/rogue
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-01-14 00:23:51 +0000
committerdholland <dholland@NetBSD.org>2008-01-14 00:23:51 +0000
commit75ac6f4b4e5cbe8cd70943b174c38771b817c6ff (patch)
treee2b60ebac50f7c8c92ddac55ad7cdf0979731f63 /rogue
parent90a64b5b883e72d7189621a32f110d746d66d666 (diff)
downloadbsdgames-darwin-75ac6f4b4e5cbe8cd70943b174c38771b817c6ff.tar.gz
bsdgames-darwin-75ac6f4b4e5cbe8cd70943b174c38771b817c6ff.tar.zst
bsdgames-darwin-75ac6f4b4e5cbe8cd70943b174c38771b817c6ff.zip
Whitespace/KNF nits.
Diffstat (limited to 'rogue')
-rw-r--r--rogue/hit.c22
-rw-r--r--rogue/init.c32
-rw-r--r--rogue/inventory.c26
-rw-r--r--rogue/level.c10
-rw-r--r--rogue/machdep.c24
-rw-r--r--rogue/main.c6
-rw-r--r--rogue/message.c8
-rw-r--r--rogue/monster.c14
-rw-r--r--rogue/move.c35
-rw-r--r--rogue/object.c24
-rw-r--r--rogue/pack.c31
-rw-r--r--rogue/play.c6
-rw-r--r--rogue/random.c18
-rw-r--r--rogue/ring.c11
-rw-r--r--rogue/room.c22
-rw-r--r--rogue/save.c22
-rw-r--r--rogue/score.c16
-rw-r--r--rogue/spec_hit.c8
-rw-r--r--rogue/throw.c10
-rw-r--r--rogue/trap.c10
-rw-r--r--rogue/use.c12
-rw-r--r--rogue/zap.c26
22 files changed, 198 insertions, 195 deletions
diff --git a/rogue/hit.c b/rogue/hit.c
index 6bc74437..1fa88ff4 100644
--- a/rogue/hit.c
+++ b/rogue/hit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hit.c,v 1.8 2007/12/27 23:52:59 dholland Exp $ */
+/* $NetBSD: hit.c,v 1.9 2008/01/14 00:23:51 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)hit.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: hit.c,v 1.8 2007/12/27 23:52:59 dholland Exp $");
+__RCSID("$NetBSD: hit.c,v 1.9 2008/01/14 00:23:51 dholland Exp $");
#endif
#endif /* not lint */
@@ -98,12 +98,12 @@ mon_hit(monster)
if (!(monster->m_flags & STATIONARY)) {
damage = get_damage(monster->m_damage, 1);
if (cur_level >= (AMULET_LEVEL * 2)) {
- minus = (float) ((AMULET_LEVEL * 2) - cur_level);
+ minus = (float)((AMULET_LEVEL * 2) - cur_level);
} else {
- minus = (float) get_armor_class(rogue.armor) * 3.00;
- minus = minus/100.00 * (float) damage;
+ minus = (float)get_armor_class(rogue.armor) * 3.00;
+ minus = minus/100.00 * (float)damage;
}
- damage -= (short) minus;
+ damage -= (short)minus;
} else {
damage = monster->stationary_damage++;
}
@@ -136,7 +136,7 @@ rogue_hit(monster, force_hit)
}
if (!rand_percent(hit_chance)) {
if (!fight_monster) {
- (void) strlcpy(hit_message, "you miss ",
+ (void)strlcpy(hit_message, "you miss ",
sizeof(hit_message));
}
goto RET;
@@ -150,7 +150,7 @@ rogue_hit(monster, force_hit)
}
if (mon_damage(monster, damage)) { /* still alive? */
if (!fight_monster) {
- (void) strlcpy(hit_message, "you hit ",
+ (void)strlcpy(hit_message, "you hit ",
sizeof(hit_message));
}
}
@@ -231,7 +231,7 @@ get_w_damage(obj)
}
tmp_damage = get_number(obj->damage + i) + obj->d_enchant;
- snprintf(new_damage, sizeof(new_damage), "%dd%d",
+ snprintf(new_damage, sizeof(new_damage), "%dd%d",
tmp_to_hit, tmp_damage);
return(get_damage(new_damage, 1));
@@ -320,7 +320,7 @@ mon_damage(monster, damage)
row = monster->row;
col = monster->col;
dungeon[row][col] &= ~MONSTER;
- mvaddch(row, col, (int) get_dungeon_char(row, col));
+ mvaddch(row, col, (int)get_dungeon_char(row, col));
fight_monster = 0;
cough_up(monster);
@@ -379,7 +379,7 @@ fight(to_the_death)
possible_damage = fight_monster->stationary_damage - 1;
}
while (fight_monster) {
- (void) one_move_rogue(ch, 0);
+ (void)one_move_rogue(ch, 0);
if (((!to_the_death) && (rogue.hp_current <= possible_damage)) ||
interrupted || (!(dungeon[row][col] & MONSTER))) {
fight_monster = 0;
diff --git a/rogue/init.c b/rogue/init.c
index 51a09752..57a73c4d 100644
--- a/rogue/init.c
+++ b/rogue/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.15 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: init.c,v 1.16 2008/01/14 00:23:51 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: init.c,v 1.15 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: init.c,v 1.16 2008/01/14 00:23:51 dholland Exp $");
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ __RCSID("$NetBSD: init.c,v 1.15 2007/12/27 23:53:00 dholland Exp $");
#include "rogue.h"
char login_name[MAX_OPT_LEN];
-char *nick_name = (char *) 0;
+char *nick_name = (char *)0;
char *rest_file = 0;
boolean cant_int = 0;
boolean did_int = 0;
@@ -97,7 +97,7 @@ init(argc, argv)
clean_up("Hey! Who are you?");
}
/* LOGIN_NAME_SIZE == MAX_OPT_LEN now, but just in case... */
- (void) strlcpy(login_name, pn, sizeof(login_name));
+ (void)strlcpy(login_name, pn, sizeof(login_name));
do_args(argc, argv);
do_opts();
@@ -118,10 +118,10 @@ init(argc, argv)
md_heed_signals();
if (score_only) {
- put_scores((object *) 0, 0);
+ put_scores((object *)0, 0);
}
seed = md_gseed();
- (void) srrandom(seed);
+ (void)srrandom(seed);
if (rest_file) {
restore(rest_file);
return(1);
@@ -130,8 +130,8 @@ init(argc, argv)
get_wand_and_ring_materials();
make_scroll_titles();
- level_objects.next_object = (object *) 0;
- level_monsters.next_monster = (object *) 0;
+ level_objects.next_object = (object *)0;
+ level_monsters.next_monster = (object *)0;
player_init();
ring_stats(0);
return(0);
@@ -142,11 +142,11 @@ player_init()
{
object *obj;
- rogue.pack.next_object = (object *) 0;
+ rogue.pack.next_object = (object *)0;
obj = alloc_object();
get_food(obj, 1);
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
obj = alloc_object(); /* initial armor */
obj->what_is = ARMOR;
@@ -154,7 +154,7 @@ player_init()
obj->class = RINGMAIL+2;
obj->is_protected = 0;
obj->d_enchant = 1;
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
do_wear(obj);
obj = alloc_object(); /* initial weapons */
@@ -163,7 +163,7 @@ player_init()
obj->damage = "2d3";
obj->hit_enchant = obj->d_enchant = 1;
obj->identified = 1;
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
do_wield(obj);
obj = alloc_object();
@@ -173,7 +173,7 @@ player_init()
obj->hit_enchant = 1;
obj->d_enchant = 0;
obj->identified = 1;
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
obj = alloc_object();
obj->what_is = WEAPON;
@@ -183,7 +183,7 @@ player_init()
obj->hit_enchant = 0;
obj->d_enchant = 0;
obj->identified = 1;
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
}
void
@@ -346,7 +346,7 @@ env_get_value(s, e, add_blank)
*s = md_malloc(MAX_OPT_LEN + 2);
if (*s == NULL)
clean_up("out of memory");
- (void) strncpy(*s, t, i);
+ (void)strncpy(*s, t, i);
if (add_blank) {
(*s)[i++] = ' ';
}
@@ -363,6 +363,6 @@ init_str(str, dflt)
*str = md_malloc(MAX_OPT_LEN + 2);
if (*str == NULL)
clean_up("out of memory");
- (void) strlcpy(*str, dflt, MAX_OPT_LEN + 2);
+ (void)strlcpy(*str, dflt, MAX_OPT_LEN + 2);
}
}
diff --git a/rogue/inventory.c b/rogue/inventory.c
index 0fcfe85f..1b9230f6 100644
--- a/rogue/inventory.c
+++ b/rogue/inventory.c
@@ -1,4 +1,4 @@
-/* $NetBSD: inventory.c,v 1.11 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: inventory.c,v 1.12 2008/01/14 00:23:51 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: inventory.c,v 1.11 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: inventory.c,v 1.12 2008/01/14 00:23:51 dholland Exp $");
#endif
#endif /* not lint */
@@ -225,7 +225,7 @@ inventory(pack, mask)
short letter;
short sepchar;
char desc[DCOLS];
- char savebuf[DCOLS+8];
+ char savebuf[DCOLS+8];
} descs[MAX_PACK_COUNT+1];
@@ -260,8 +260,8 @@ inventory(pack, mask)
}
descs[row].savebuf[j-col] = 0;
if (row < i) {
- mvprintw(row, col, " %c%c %s",
- descs[row].letter, descs[row].sepchar,
+ mvprintw(row, col, " %c%c %s",
+ descs[row].letter, descs[row].sepchar,
descs[row].desc);
}
else {
@@ -416,7 +416,7 @@ pr_motion_char(ch)
ch += 32;
until = "";
}
- (void) get_com_id(&n, ch);
+ (void)get_com_id(&n, ch);
check_message();
messagef(0, "run %s%s", com_id_tab[n].com_desc + 8, until);
return(1);
@@ -450,18 +450,18 @@ make_scroll_titles()
for (i = 0; i < SCROLS; i++) {
sylls = get_rand(2, 5);
- (void) strlcpy(id_scrolls[i].title, "'", maxlen);
+ (void)strlcpy(id_scrolls[i].title, "'", maxlen);
for (j = 0; j < sylls; j++) {
s = get_rand(1, (MAXSYLLABLES-1));
- (void) strlcat(id_scrolls[i].title, syllables[s],
+ (void)strlcat(id_scrolls[i].title, syllables[s],
maxlen);
}
/* trim trailing space */
n = strlen(id_scrolls[i].title);
id_scrolls[i].title[n-1] = 0;
- (void) strlcat(id_scrolls[i].title, "' ", maxlen);
+ (void)strlcat(id_scrolls[i].title, "' ", maxlen);
}
}
@@ -553,7 +553,7 @@ get_desc(obj, desc, desclen)
unsigned short objtype_id_status;
if (obj->what_is == AMULET) {
- (void) strlcpy(desc, "the amulet of Yendor ", desclen);
+ (void)strlcpy(desc, "the amulet of Yendor ", desclen);
return;
}
@@ -703,7 +703,7 @@ get_wand_and_ring_materials()
j = get_rand(0, WAND_MATERIALS-1);
} while (used[j]);
used[j] = 1;
- (void) strlcpy(id_wands[i].title, wand_materials[j],
+ (void)strlcpy(id_wands[i].title, wand_materials[j],
sizeof(id_wands[i].title));
is_wood[i] = (j > MAX_METAL);
}
@@ -715,7 +715,7 @@ get_wand_and_ring_materials()
j = get_rand(0, GEMS-1);
} while (used[j]);
used[j] = 1;
- (void) strlcpy(id_rings[i].title, gems[j],
+ (void)strlcpy(id_rings[i].title, gems[j],
sizeof(id_rings[i].title));
}
}
@@ -760,7 +760,7 @@ get_id_table(obj)
case ARMOR:
return(id_armors);
}
- return((struct id *) 0);
+ return((struct id *)0);
}
void
diff --git a/rogue/level.c b/rogue/level.c
index 5d9da622..26029918 100644
--- a/rogue/level.c
+++ b/rogue/level.c
@@ -1,4 +1,4 @@
-/* $NetBSD: level.c,v 1.8 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: level.c,v 1.9 2008/01/14 00:23:51 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)level.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: level.c,v 1.8 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: level.c,v 1.9 2008/01/14 00:23:51 dholland Exp $");
#endif
#endif /* not lint */
@@ -159,10 +159,10 @@ make_level()
i = random_rooms[j];
if (i < (MAXROOMS-1)) {
- (void) connect_rooms(i, i+1);
+ (void)connect_rooms(i, i+1);
}
if (i < (MAXROOMS-3)) {
- (void) connect_rooms(i, i+3);
+ (void)connect_rooms(i, i+3);
}
if (i < (MAXROOMS-2)) {
if (rooms[i+1].is_room & R_NOTHING) {
@@ -879,7 +879,7 @@ show_average_hp()
} else {
real_average = (float)
((rogue.hp_max - extra_hp - INIT_HP) + less_hp) / (rogue.exp - 1);
- effective_average = (float) (rogue.hp_max - INIT_HP) / (rogue.exp - 1);
+ effective_average = (float)(rogue.hp_max - INIT_HP) / (rogue.exp - 1);
}
messagef(0, "R-Hp: %.2f, E-Hp: %.2f (!: %d, V: %d)", real_average,
diff --git a/rogue/machdep.c b/rogue/machdep.c
index 747eae0a..28be23b4 100644
--- a/rogue/machdep.c
+++ b/rogue/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.15 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: machdep.c,v 1.16 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: machdep.c,v 1.15 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: machdep.c,v 1.16 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -63,7 +63,7 @@ __RCSID("$NetBSD: machdep.c,v 1.15 2007/12/27 23:53:00 dholland Exp $");
*
* All UNIX code should be included between the single "#ifdef UNIX" at the
* top of this file, and the "#endif" at the bottom.
- *
+ *
* To change a routine to include a new UNIX system, simply #ifdef the
* existing routine, as in the following example:
*
@@ -195,7 +195,7 @@ md_get_file_id(fname)
if (stat(fname, &sbuf)) {
return(-1);
}
- return((int) sbuf.st_ino);
+ return((int)sbuf.st_ino);
}
/* md_link_count():
@@ -213,7 +213,7 @@ md_link_count(fname)
struct stat sbuf;
stat(fname, &sbuf);
- return((int) sbuf.st_nlink);
+ return((int)sbuf.st_nlink);
}
/* md_gct(): (Get Current Time)
@@ -227,7 +227,7 @@ md_link_count(fname)
* system doesn't provide all of the time units requested here, then you
* can provide only those that it does, and return zeros for the others.
* If you cannot provide good time values, then users may be able to copy
- * saved-game files and play them.
+ * saved-game files and play them.
*/
void
@@ -259,7 +259,7 @@ md_gct(rt_buf)
* exactly the same here.
* Or if md_gct() is implemented correctly, but your system does not provide
* file modification dates, you may return some date far in the past so
- * that the program will never know that a saved-game file being modified.
+ * that the program will never know that a saved-game file being modified.
* You may also do this if you wish to be able to restore games from
* saved-games that have been modified.
*/
@@ -274,7 +274,7 @@ md_gfmt(fname, rt_buf)
struct tm *t;
stat(fname, &sbuf);
- seconds = (long) sbuf.st_mtime;
+ seconds = (long)sbuf.st_mtime;
t = localtime(&seconds);
rt_buf->year = t->tm_year;
@@ -338,7 +338,7 @@ void
md_sleep(nsecs)
int nsecs;
{
- (void) sleep(nsecs);
+ (void)sleep(nsecs);
}
/* md_getenv()
@@ -404,7 +404,7 @@ md_malloc(n)
* You need to find some single random integer, such as:
* process id.
* current time (minutes + seconds) returned from md_gct(), if implemented.
- *
+ *
* It will not help to return "get_rand()" or "rand()" or the return value of
* any pseudo-RNG. If you don't have a random number, you can just return 1,
* but this means your games will ALWAYS start the same way, and will play
@@ -417,7 +417,7 @@ md_gseed()
time_t seconds;
time(&seconds);
- return((int) seconds);
+ return((int)seconds);
}
/* md_exit():
@@ -493,7 +493,7 @@ md_shell(shell)
case -1:
break;
case 0:
- execl(shell, shell, (char *) 0);
+ execl(shell, shell, (char *)0);
_exit(255);
default:
waitpid(pid, &w, 0);
diff --git a/rogue/main.c b/rogue/main.c
index 3bd75fe6..52d5135e 100644
--- a/rogue/main.c
+++ b/rogue/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: main.c,v 1.7 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.6 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -80,7 +80,7 @@ main(argc, argv)
put_mons();
put_player(party_room);
print_stats(STAT_ALL);
-PL:
+PL:
play_level();
free_stuff(&level_objects);
free_stuff(&level_monsters);
diff --git a/rogue/message.c b/rogue/message.c
index 46327720..09cbf3a6 100644
--- a/rogue/message.c
+++ b/rogue/message.c
@@ -1,4 +1,4 @@
-/* $NetBSD: message.c,v 1.11 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: message.c,v 1.12 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: message.c,v 1.11 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: message.c,v 1.12 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -90,7 +90,7 @@ message(msg, intrpt)
}
if (!rmsg) {
imsg = (imsg + 1) % NMESSAGES;
- (void) strlcpy(msgs[imsg], msg, sizeof(msgs[imsg]));
+ (void)strlcpy(msgs[imsg], msg, sizeof(msgs[imsg]));
}
mvaddstr(MIN_ROW-1, 0, msg);
addch(' ');
@@ -165,7 +165,7 @@ get_input_line(prompt, insert, buf, buflen, if_cancelled, add_blank, do_echo)
if (insert[0]) {
mvaddstr(0, n + 1, insert);
- (void) strlcpy(buf, insert, buflen);
+ (void)strlcpy(buf, insert, buflen);
i = strlen(buf);
move(0, (n + i + 1));
refresh();
diff --git a/rogue/monster.c b/rogue/monster.c
index bca5eb1c..518a9112 100644
--- a/rogue/monster.c
+++ b/rogue/monster.c
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.12 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: monster.c,v 1.13 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)monster.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: monster.c,v 1.12 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: monster.c,v 1.13 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -131,7 +131,7 @@ put_mons()
n = get_rand(4, 6);
for (i = 0; i < n; i++) {
- monster = gr_monster((object *) 0, 0);
+ monster = gr_monster((object *)0, 0);
if ((monster->m_flags & WANDERS) && coin_toss()) {
wake_up(monster);
}
@@ -253,7 +253,7 @@ party_monsters(rn, n)
}
}
if (found) {
- monster = gr_monster((object *) 0, 0);
+ monster = gr_monster((object *)0, 0);
if (!(monster->m_flags & IMITATES)) {
monster->m_flags |= WAKENS;
}
@@ -632,7 +632,7 @@ wanderer()
monster = NULL; /* XXXGCC -Wuninitialized [powerpc] */
for (i = 0; ((i < 15) && (!found)); i++) {
- monster = gr_monster((object *) 0, 0);
+ monster = gr_monster((object *)0, 0);
if (!(monster->m_flags & (WAKENS | WANDERS))) {
free_object(monster);
} else {
@@ -702,7 +702,7 @@ create_monster()
}
}
if (found) {
- monster = gr_monster((object *) 0, 0);
+ monster = gr_monster((object *)0, 0);
put_m_at(row, col, monster);
mvaddch(row, col, gmc(monster));
if (monster->m_flags & (WANDERS | WAKENS)) {
@@ -722,7 +722,7 @@ put_m_at(row, col, monster)
monster->col = col;
dungeon[row][col] |= MONSTER;
monster->trail_char = mvinch(row, col);
- (void) add_to_pack(monster, &level_monsters, 0);
+ (void)add_to_pack(monster, &level_monsters, 0);
aim_monster(monster);
}
diff --git a/rogue/move.c b/rogue/move.c
index 91adf0f1..e518f1ae 100644
--- a/rogue/move.c
+++ b/rogue/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.9 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: move.c,v 1.10 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.9 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: move.c,v 1.10 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -74,7 +74,7 @@ one_move_rogue(dirch, pickup)
if (confused) {
dirch = gr_dir();
}
- (void) is_direction(dirch, &d);
+ (void)is_direction(dirch, &d);
get_dir_rc(d, &row, &col, 1);
if (!can_move(rogue.row, rogue.col, row, col)) {
@@ -86,7 +86,7 @@ one_move_rogue(dirch, pickup)
messagef(1, "you are being held");
} else {
messagef(0, "you are still stuck in the bear trap");
- (void) reg_move();
+ (void)reg_move();
}
return(MOVE_FAILED);
}
@@ -99,7 +99,7 @@ one_move_rogue(dirch, pickup)
}
if (dungeon[row][col] & MONSTER) {
rogue_hit(object_at(&level_monsters, row, col), 0);
- (void) reg_move();
+ (void)reg_move();
return(MOVE_FAILED);
}
if (dungeon[row][col] & DOOR) {
@@ -155,14 +155,14 @@ MOVE_ON:
}
messagef(1, "%s(%c)", desc, obj->ichar);
NOT_IN_PACK:
- (void) reg_move();
+ (void)reg_move();
return(STOPPED_ON_SOMETHING);
}
if (dungeon[row][col] & (DOOR | STAIRS | TRAP)) {
if ((!levitate) && (dungeon[row][col] & TRAP)) {
trap_player(row, col);
}
- (void) reg_move();
+ (void)reg_move();
return(STOPPED_ON_SOMETHING);
}
MVED: if (reg_move()) { /* fainted from hunger */
@@ -209,7 +209,8 @@ multiple_move_rogue(dirch)
case 'Y':
case 'U':
case 'N':
- while ((!interrupted) && (one_move_rogue((dirch + 32), 1) == MOVED)) ;
+ while ((!interrupted) && (one_move_rogue((dirch + 32), 1) == MOVED))
+ ;
if ( (!interrupted) && passgo &&
(dungeon[rogue.row][rogue.col] & TUNNEL)) {
@@ -296,7 +297,7 @@ next_to_something(drow, dcol)
}
boolean
-can_move(row1, col1, row2, col2)
+can_move(row1, col1, row2, col2)
int row1, col1, row2, col2;
{
if (!is_passable(row2, col2)) {
@@ -328,7 +329,7 @@ move_onto()
}
check_message();
if (ch != CANCEL) {
- (void) one_move_rogue(ch, 0);
+ (void)one_move_rogue(ch, 0);
}
}
@@ -378,18 +379,18 @@ check_hunger(msg_only)
boolean fainted = 0;
if (rogue.moves_left == HUNGRY) {
- (void) strlcpy(hunger_str, "hungry", sizeof(hunger_str));
+ (void)strlcpy(hunger_str, "hungry", sizeof(hunger_str));
messagef(0, "%s", hunger_str);
print_stats(STAT_HUNGER);
}
if (rogue.moves_left == WEAK) {
- (void) strlcpy(hunger_str, "weak", sizeof(hunger_str));
+ (void)strlcpy(hunger_str, "weak", sizeof(hunger_str));
messagef(1, "%s", hunger_str);
print_stats(STAT_HUNGER);
}
if (rogue.moves_left <= FAINT) {
if (rogue.moves_left == FAINT) {
- (void) strlcpy(hunger_str, "faint", sizeof(hunger_str));
+ (void)strlcpy(hunger_str, "faint", sizeof(hunger_str));
messagef(1, "%s", hunger_str);
print_stats(STAT_HUNGER);
}
@@ -412,7 +413,7 @@ check_hunger(msg_only)
return(fainted);
}
if (rogue.moves_left <= STARVE) {
- killed_by((object *) 0, STARVATION);
+ killed_by((object *)0, STARVATION);
}
switch(e_rings) {
@@ -427,12 +428,12 @@ check_hunger(msg_only)
break;
case 1:
rogue.moves_left--;
- (void) check_hunger(1);
+ (void)check_hunger(1);
rogue.moves_left -= (rogue.moves_left % 2);
break;
case 2:
rogue.moves_left--;
- (void) check_hunger(1);
+ (void)check_hunger(1);
rogue.moves_left--;
break;
}
@@ -508,7 +509,7 @@ rest(count)
if (interrupted) {
break;
}
- (void) reg_move();
+ (void)reg_move();
}
}
diff --git a/rogue/object.c b/rogue/object.c
index 0ceb339e..deb37333 100644
--- a/rogue/object.c
+++ b/rogue/object.c
@@ -1,4 +1,4 @@
-/* $NetBSD: object.c,v 1.11 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: object.c,v 1.12 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)object.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: object.c,v 1.11 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: object.c,v 1.12 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -58,8 +58,8 @@ __RCSID("$NetBSD: object.c,v 1.11 2007/12/27 23:53:00 dholland Exp $");
object level_objects;
unsigned short dungeon[DROWS][DCOLS];
short foods = 0;
-object *free_list = (object *) 0;
-char *fruit = (char *) 0;
+object *free_list = (object *)0;
+char *fruit = (char *)0;
fighter rogue = {
INIT_AW, /* armor */
@@ -229,7 +229,7 @@ plant_gold(row, col, is_maze)
obj->quantity += obj->quantity / 2;
}
dungeon[row][col] |= OBJECT;
- (void) add_to_pack(obj, &level_objects, 0);
+ (void)add_to_pack(obj, &level_objects, 0);
}
void
@@ -240,7 +240,7 @@ place_at(obj, row, col)
obj->row = row;
obj->col = col;
dungeon[row][col] |= OBJECT;
- (void) add_to_pack(obj, &level_objects, 0);
+ (void)add_to_pack(obj, &level_objects, 0);
}
object *
@@ -248,7 +248,7 @@ object_at(pack, row, col)
object *pack;
short row, col;
{
- object *obj = (object *) 0;
+ object *obj = (object *)0;
if (dungeon[row][col] & (MONSTER | OBJECT)) {
obj = pack->next_object;
@@ -636,7 +636,7 @@ alloc_object()
if (free_list) {
obj = free_list;
free_list = free_list->next_object;
- } else if (!(obj = (object *) md_malloc(sizeof(object)))) {
+ } else if (!(obj = (object *)md_malloc(sizeof(object)))) {
messagef(0, "cannot allocate object, saving game");
save_into_file(error_file);
clean_up("alloc_object: save failed");
@@ -704,7 +704,7 @@ show_objects()
while (monster) {
if (monster->m_flags & IMITATES) {
- mvaddch(monster->row, monster->col, (int) monster->disguise);
+ mvaddch(monster->row, monster->col, (int)monster->disguise);
}
monster = monster->next_monster;
}
@@ -738,7 +738,7 @@ c_object_for_wizard()
char buf[80];
max = 0;
- if (pack_count((object *) 0) >= MAX_PACK_COUNT) {
+ if (pack_count((object *)0) >= MAX_PACK_COUNT) {
messagef(0, "pack full");
return;
}
@@ -791,7 +791,7 @@ GIL:
if (get_input_line("which kind?", "", buf, sizeof(buf), "", 0, 1)) {
wk = get_number(buf);
if ((wk >= 0) && (wk <= max)) {
- obj->which_kind = (unsigned short) wk;
+ obj->which_kind = (unsigned short)wk;
if (obj->what_is == RING) {
gr_ring(obj, 0);
}
@@ -806,5 +806,5 @@ GIL:
}
get_desc(obj, buf, sizeof(buf));
messagef(0, "%s", buf);
- (void) add_to_pack(obj, &rogue.pack, 1);
+ (void)add_to_pack(obj, &rogue.pack, 1);
}
diff --git a/rogue/pack.c b/rogue/pack.c
index ee091384..793bf1f0 100644
--- a/rogue/pack.c
+++ b/rogue/pack.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pack.c,v 1.8 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: pack.c,v 1.9 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pack.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pack.c,v 1.8 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: pack.c,v 1.9 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -111,7 +111,7 @@ pick_up(row, col, status)
if (levitate) {
messagef(0, "you're floating in the air!");
- return((object *) 0);
+ return((object *)0);
}
obj = object_at(&level_objects, row, col);
if (!obj) {
@@ -128,7 +128,7 @@ pick_up(row, col, status)
if (id_scrolls[SCARE_MONSTER].id_status == UNIDENTIFIED) {
id_scrolls[SCARE_MONSTER].id_status = IDENTIFIED;
}
- return((object *) 0);
+ return((object *)0);
}
if (obj->what_is == GOLD) {
rogue.gold += obj->quantity;
@@ -139,7 +139,7 @@ pick_up(row, col, status)
}
if (pack_count(obj) >= MAX_PACK_COUNT) {
messagef(1, "pack too full");
- return((object *) 0);
+ return((object *)0);
}
dungeon[row][col] &= ~(OBJECT);
take_from_pack(obj, &level_objects);
@@ -207,7 +207,7 @@ drop()
place_at(obj, rogue.row, rogue.col);
get_desc(obj, desc, sizeof(desc));
messagef(0, "dropped %s", desc);
- (void) reg_move();
+ (void)reg_move();
}
object *
@@ -225,7 +225,7 @@ check_duplicate(obj, pack)
op = pack->next_object;
while (op) {
- if ((op->what_is == obj->what_is) &&
+ if ((op->what_is == obj->what_is) &&
(op->which_kind == obj->which_kind)) {
if ((obj->what_is != WEAPON) ||
@@ -272,7 +272,8 @@ next_avail_ichar()
void
wait_for_ack()
{
- while (rgetchar() != ' ') ;
+ while (rgetchar() != ' ')
+ ;
}
short
@@ -329,7 +330,7 @@ take_off()
get_desc(obj, desc, sizeof(desc));
messagef(0, "was wearing %s", desc);
print_stats(STAT_ARMOR);
- (void) reg_move();
+ (void)reg_move();
}
} else {
messagef(0, "not wearing any");
@@ -365,7 +366,7 @@ wear()
messagef(0, "wearing %s", desc);
do_wear(obj);
print_stats(STAT_ARMOR);
- (void) reg_move();
+ (void)reg_move();
}
void
@@ -375,7 +376,7 @@ unwear(obj)
if (obj) {
obj->in_use_flags &= (~BEING_WORN);
}
- rogue.armor = (object *) 0;
+ rogue.armor = (object *)0;
}
void
@@ -419,7 +420,7 @@ wield()
get_desc(obj, desc, sizeof(desc));
messagef(0, "wielding %s", desc);
do_wield(obj);
- (void) reg_move();
+ (void)reg_move();
}
}
@@ -438,7 +439,7 @@ unwield(obj)
if (obj) {
obj->in_use_flags &= (~BEING_WIELDED);
}
- rogue.weapon = (object *) 0;
+ rogue.weapon = (object *)0;
}
void
@@ -467,7 +468,7 @@ call_it()
if (get_input_line("call it:", "", buf, sizeof(buf),
id_table[obj->which_kind].title, 1, 1)) {
id_table[obj->which_kind].id_status = CALLED;
- (void) strlcpy(id_table[obj->which_kind].title, buf,
+ (void)strlcpy(id_table[obj->which_kind].title, buf,
sizeof(id_table[obj->which_kind].title));
}
}
@@ -579,7 +580,7 @@ kick_into_pack()
}
}
if (obj || (!stat)) {
- (void) reg_move();
+ (void)reg_move();
}
}
}
diff --git a/rogue/play.c b/rogue/play.c
index 0ede8ad7..1e14754d 100644
--- a/rogue/play.c
+++ b/rogue/play.c
@@ -1,4 +1,4 @@
-/* $NetBSD: play.c,v 1.7 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: play.c,v 1.8 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: play.c,v 1.7 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: play.c,v 1.8 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -106,7 +106,7 @@ CH:
case 'u':
case 'n':
case 'b':
- (void) one_move_rogue(ch, 1);
+ (void)one_move_rogue(ch, 1);
break;
case 'H':
case 'J':
diff --git a/rogue/random.c b/rogue/random.c
index eee5c114..4133fde9 100644
--- a/rogue/random.c
+++ b/rogue/random.c
@@ -1,4 +1,4 @@
-/* $NetBSD: random.c,v 1.5 2003/08/07 09:37:39 agc Exp $ */
+/* $NetBSD: random.c,v 1.6 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)random.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: random.c,v 1.5 2003/08/07 09:37:39 agc Exp $");
+__RCSID("$NetBSD: random.c,v 1.6 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -56,11 +56,11 @@ __RCSID("$NetBSD: random.c,v 1.5 2003/08/07 09:37:39 agc Exp $");
*/
static long rntb[32] = {
- 3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
+ 3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, 0x7449e56b,
0xbeb1dbb0, 0xab5c5918, 0x946554fd, 0x8c2e680f, 0xeb3d799f,
0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, 0xe369735d,
- 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
+ 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e,
0x8999220b, 0x27fb47b9
};
@@ -79,7 +79,7 @@ srrandom(x)
{
int i;
- state[0] = (long) x;
+ state[0] = (long)x;
if (rand_type != 0) {
for (i = 1; i < rand_deg; i++) {
state[i] = 1103515245 * state[i - 1] + 12345;
@@ -87,7 +87,7 @@ srrandom(x)
fptr = &state[rand_sep];
rptr = &state[0];
for (i = 0; i < 10 * rand_deg; i++) {
- (void) rrandom();
+ (void)rrandom();
}
}
}
@@ -96,7 +96,7 @@ long
rrandom()
{
long i;
-
+
if (rand_type == 0) {
i = state[0] = (state[0]*1103515245 + 12345) & 0x7fffffff;
} else {
@@ -127,8 +127,8 @@ get_rand(x, y)
x = t;
}
lr = rrandom();
- lr &= (long) 0x00003fff;
- r = (int) lr;
+ lr &= (long)0x00003fff;
+ r = (int)lr;
r = (r % ((y - x) + 1)) + x;
return(r);
}
diff --git a/rogue/ring.c b/rogue/ring.c
index 321fd493..11f3bbd6 100644
--- a/rogue/ring.c
+++ b/rogue/ring.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ring.c,v 1.7 2007/12/27 23:53:00 dholland Exp $ */
+/* $NetBSD: ring.c,v 1.8 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: ring.c,v 1.7 2007/12/27 23:53:00 dholland Exp $");
+__RCSID("$NetBSD: ring.c,v 1.8 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -122,7 +122,7 @@ put_on_ring()
check_message();
get_desc(ring, desc, sizeof(desc));
messagef(0, "%s", desc);
- (void) reg_move();
+ (void)reg_move();
}
/*
@@ -189,7 +189,7 @@ remove_ring()
un_put_on(ring);
get_desc(ring, buf, sizeof(buf));
messagef(0, "removed %s", buf);
- (void) reg_move();
+ (void)reg_move();
}
}
}
@@ -241,7 +241,8 @@ gr_ring(ring, assign_wk)
break;
case ADD_STRENGTH:
case DEXTERITY:
- while ((ring->class = (get_rand(0, 4) - 2)) == 0) ;
+ while ((ring->class = (get_rand(0, 4) - 2)) == 0)
+ ;
ring->is_cursed = (ring->class < 0);
break;
case ADORNMENT:
diff --git a/rogue/room.c b/rogue/room.c
index f81106bd..01bc4b4a 100644
--- a/rogue/room.c
+++ b/rogue/room.c
@@ -1,4 +1,4 @@
-/* $NetBSD: room.c,v 1.10 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: room.c,v 1.11 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: room.c,v 1.10 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: room.c,v 1.11 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -68,31 +68,31 @@ const struct option {
} options[NOPTS] = {
{
"Show position only at end of run (\"jump\"): ",
- 1, (char **) 0, &jump
+ 1, (char **)0, &jump
},
{
"Follow turnings in passageways (\"passgo\"): ",
- 1, (char **) 0, &passgo
+ 1, (char **)0, &passgo
},
{
"Don't print skull when killed (\"noskull\" or \"notombstone\"): ",
- 1, (char **) 0, &no_skull
+ 1, (char **)0, &no_skull
},
{
"Ask player before saying 'Okay, bye-bye!' (\"askquit\"): ",
- 1, (char **) 0, &ask_quit
+ 1, (char **)0, &ask_quit
},
{
"Name (\"name\"): ",
- 0, &nick_name, (boolean *) 0
+ 0, &nick_name, (boolean *)0
},
{
"Fruit (\"fruit\"): ",
- 0, &fruit, (boolean *) 0
+ 0, &fruit, (boolean *)0
},
{
"Save file (\"file\"): ",
- 0, &save_file, (boolean *) 0
+ 0, &save_file, (boolean *)0
}
};
@@ -604,10 +604,10 @@ CH:
if (j != 0) {
/*
* We rely on the option string being
- * allocated to hold MAX_OPT_LEN+2
+ * allocated to hold MAX_OPT_LEN+2
* bytes. This is arranged in init.c.
*/
- (void) strcpy(*(options[i].strval), buf);
+ (void)strcpy(*(options[i].strval), buf);
}
opt_show(i);
goto CH;
diff --git a/rogue/save.c b/rogue/save.c
index 9e91bae1..59aa6f26 100644
--- a/rogue/save.c
+++ b/rogue/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.11 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: save.c,v 1.12 2008/01/14 00:23:52 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.11 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: save.c,v 1.12 2008/01/14 00:23:52 dholland Exp $");
#endif
#endif /* not lint */
@@ -57,7 +57,7 @@ __RCSID("$NetBSD: save.c,v 1.11 2007/12/27 23:53:01 dholland Exp $");
#include "rogue.h"
short write_failed = 0;
-char *save_file = (char *) 0;
+char *save_file = (char *)0;
void
save_game()
@@ -93,11 +93,11 @@ save_into_file(sfile)
"out of memory for save file name");
sfile = error_file;
} else {
- (void) strcpy(name_buffer, hptr);
- (void) strcat(name_buffer, sfile+1);
+ (void)strcpy(name_buffer, hptr);
+ (void)strcat(name_buffer, sfile+1);
sfile = name_buffer;
}
- /*
+ /*
* Note: name_buffer gets leaked. But it's small,
* and in the common case we're about to exit.
*/
@@ -112,7 +112,7 @@ save_into_file(sfile)
}
md_ignore_signals();
write_failed = 0;
- (void) xxx(1);
+ (void)xxx(1);
r_write(fp, (char *) &detect_monster, sizeof(detect_monster));
r_write(fp, (char *) &cur_level, sizeof(cur_level));
r_write(fp, (char *) &max_level, sizeof(max_level));
@@ -152,7 +152,7 @@ save_into_file(sfile)
fclose(fp);
if (write_failed) {
- (void) md_df(sfile); /* delete file */
+ (void)md_df(sfile); /* delete file */
} else {
clean_up("");
}
@@ -176,13 +176,13 @@ restore(fname)
if (md_link_count(fname) > 1) {
clean_up("file has link");
}
- (void) xxx(1);
+ (void)xxx(1);
r_read(fp, (char *) &detect_monster, sizeof(detect_monster));
r_read(fp, (char *) &cur_level, sizeof(cur_level));
r_read(fp, (char *) &max_level, sizeof(max_level));
read_string(hunger_str, fp, sizeof hunger_str);
- (void) strlcpy(tbuf, login_name, sizeof tbuf);
+ (void)strlcpy(tbuf, login_name, sizeof tbuf);
read_string(login_name, fp, sizeof login_name);
if (strcmp(tbuf, login_name)) {
clean_up("you're not the original player");
@@ -265,7 +265,7 @@ read_pack(pack, fp, is_rogue)
for (;;) {
r_read(fp, (char *) &read_obj, sizeof(object));
if (read_obj.ichar == 0) {
- pack->next_object = (object *) 0;
+ pack->next_object = (object *)0;
break;
}
new_obj = alloc_object();
diff --git a/rogue/score.c b/rogue/score.c
index bb6b5461..638b5fb7 100644
--- a/rogue/score.c
+++ b/rogue/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.12 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: score.c,v 1.13 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.12 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: score.c,v 1.13 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -153,7 +153,7 @@ win()
messagef(0, "%s", ""); /* gcc objects to just "" */
id_all();
sell_pack();
- put_scores((object *) 0, WIN);
+ put_scores((object *)0, WIN);
}
void
@@ -197,7 +197,7 @@ quit(from_intrpt)
clean_up(byebye_string);
}
check_message();
- killed_by((object *) 0, QUIT);
+ killed_by((object *)0, QUIT);
}
/*
@@ -364,7 +364,7 @@ put_scores(monster, other)
}
setegid(gid);
rewind(fp);
- (void) xxx(1);
+ (void)xxx(1);
for (numscores = 0; numscores < NUM_SCORE_ENTRIES; numscores++) {
if (read_score_entry(&scores[numscores], fp) == 0) {
@@ -424,7 +424,7 @@ put_scores(monster, other)
md_ignore_signals();
rewind(fp);
- (void) xxx(1);
+ (void)xxx(1);
for (i = 0; i < numscores; i++) {
write_score_entry(&scores[i], i, fp);
@@ -509,7 +509,7 @@ make_score(se, monster, other)
} else {
article = "a";
}
-
+
snprintf(deathbuf, sizeof(deathbuf),
"killed by %s %s", article, mn);
death = deathbuf;
@@ -652,7 +652,7 @@ xxxx(buf, n)
for (i = 0; i < n; i++) {
/* It does not matter if accuracy is lost during this assignment */
- c = (unsigned char) xxx(0);
+ c = (unsigned char)xxx(0);
buf[i] ^= c;
}
diff --git a/rogue/spec_hit.c b/rogue/spec_hit.c
index 9e842511..73748551 100644
--- a/rogue/spec_hit.c
+++ b/rogue/spec_hit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spec_hit.c,v 1.6 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: spec_hit.c,v 1.7 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)spec_hit.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: spec_hit.c,v 1.6 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: spec_hit.c,v 1.7 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -253,7 +253,7 @@ cough_up(monster)
obj->what_is = GOLD;
obj->quantity = get_rand((cur_level * 15), (cur_level * 30));
} else {
- if (!rand_percent((int) monster->drop_percent)) {
+ if (!rand_percent((int)monster->drop_percent)) {
return;
}
obj = gr_object();
@@ -475,7 +475,7 @@ m_confuse(monster)
}
if (rand_percent(55)) {
monster->m_flags &= (~CONFUSES);
- messagef(1, "the gaze of the %s has confused you",
+ messagef(1, "the gaze of the %s has confused you",
mon_name(monster));
cnfs();
return(1);
diff --git a/rogue/throw.c b/rogue/throw.c
index 0312503c..ac380c6e 100644
--- a/rogue/throw.c
+++ b/rogue/throw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: throw.c,v 1.9 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)throw.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: throw.c,v 1.9 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -146,12 +146,12 @@ throw_at_monster(monster, weapon)
weapon->quantity = t;
if (!rand_percent(hit_chance)) {
- (void) strlcat(hit_message, "misses ", HIT_MESSAGE_SIZE);
+ (void)strlcat(hit_message, "misses ", HIT_MESSAGE_SIZE);
return(0);
}
s_con_mon(monster);
- (void) strlcat(hit_message, "hit ", HIT_MESSAGE_SIZE);
- (void) mon_damage(monster, damage);
+ (void)strlcat(hit_message, "hit ", HIT_MESSAGE_SIZE);
+ (void)mon_damage(monster, damage);
return(1);
}
diff --git a/rogue/trap.c b/rogue/trap.c
index e0987cb0..2568ac56 100644
--- a/rogue/trap.c
+++ b/rogue/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.7 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: trap.c,v 1.8 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)trap.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: trap.c,v 1.7 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: trap.c,v 1.8 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ trap_player(row, col)
}
print_stats(STAT_HP | STAT_STRENGTH);
if (rogue.hp_current <= 0) {
- killed_by((object *) 0, POISON_DART);
+ killed_by((object *)0, POISON_DART);
}
break;
case SLEEPING_GAS_TRAP:
@@ -136,7 +136,7 @@ trap_player(row, col)
break;
case RUST_TRAP:
messagef(1, "%s", trap_strings[(t*2)+1]);
- rust((object *) 0);
+ rust((object *)0);
break;
}
}
@@ -280,7 +280,7 @@ search(n, is_auto)
}
}
if ((!is_auto) && (reg_search = !reg_search)) {
- (void) reg_move();
+ (void)reg_move();
}
}
}
diff --git a/rogue/use.c b/rogue/use.c
index 904680b2..21136aa3 100644
--- a/rogue/use.c
+++ b/rogue/use.c
@@ -1,4 +1,4 @@
-/* $NetBSD: use.c,v 1.7 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: use.c,v 1.8 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)use.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: use.c,v 1.7 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: use.c,v 1.8 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -162,7 +162,7 @@ quaff()
}
break;
case SEE_INVISIBLE:
- messagef(0, "hmm, this potion tastes like %sjuice",
+ messagef(0, "hmm, this potion tastes like %sjuice",
fruit);
if (blind) {
unblind();
@@ -273,7 +273,7 @@ read_scroll()
break;
case CON_MON:
con_mon = 1;
- messagef(0, "your hands glow %sfor a moment",
+ messagef(0, "your hands glow %sfor a moment",
get_ench_color());
break;
}
@@ -307,7 +307,7 @@ vanish(obj, rm, pack)
free_object(obj);
}
if (rm) {
- (void) reg_move();
+ (void)reg_move();
}
}
@@ -589,7 +589,7 @@ get_ench_color()
return(id_potions[get_rand(0, POTIONS-1)].title);
} else if (con_mon) {
return("red ");
- }
+ }
return("blue ");
}
diff --git a/rogue/zap.c b/rogue/zap.c
index 312de30c..8280190a 100644
--- a/rogue/zap.c
+++ b/rogue/zap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zap.c,v 1.7 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: zap.c,v 1.8 2008/01/14 00:23:53 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)zap.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: zap.c,v 1.7 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: zap.c,v 1.8 2008/01/14 00:23:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -96,7 +96,7 @@ zapp()
wand->class--;
row = rogue.row; col = rogue.col;
if ((wand->which_kind == COLD) || (wand->which_kind == FIRE)) {
- bounce((short) wand->which_kind, d, row, col, 0);
+ bounce((short)wand->which_kind, d, row, col, 0);
} else {
monster = get_zapped_monster(d, &row, &col);
if (wand->which_kind == DRAIN_LIFE) {
@@ -109,7 +109,7 @@ zapp()
}
}
}
- (void) reg_move();
+ (void)reg_move();
}
object *
@@ -175,7 +175,7 @@ zap_monster(monster, kind)
}
nm = monster->next_monster;
tc = monster->trail_char;
- (void) gr_monster(monster, get_rand(0, MONSTERS-1));
+ (void)gr_monster(monster, get_rand(0, MONSTERS-1));
monster->row = row;
monster->col = col;
monster->next_monster = nm;
@@ -234,7 +234,7 @@ wizardize()
} else {
if (get_input_line("wizard's password:", "", buf, sizeof(buf),
"", 0, 0)) {
- (void) xxx(1);
+ (void)xxx(1);
xxxx(buf, strlen(buf));
if (!strncmp(buf, "\247\104\126\272\115\243\027", 7)) {
wizard = 1;
@@ -263,14 +263,14 @@ wdrain_life(monster)
nm = lmon->next_monster;
if (get_room_number(lmon->row, lmon->col) == cur_room) {
wake_up(lmon);
- (void) mon_damage(lmon, hp);
+ (void)mon_damage(lmon, hp);
}
lmon = nm;
}
} else {
if (monster) {
wake_up(monster);
- (void) mon_damage(monster, hp);
+ (void)mon_damage(monster, hp);
}
}
print_stats(STAT_HP);
@@ -335,7 +335,7 @@ bounce(ball, dir, row, col, r)
wake_up(monster);
if (rand_percent(33)) {
- messagef(0, "the %s misses the %s", s,
+ messagef(0, "the %s misses the %s", s,
mon_name(monster));
goto ND;
}
@@ -353,7 +353,7 @@ bounce(ball, dir, row, col, r)
}
messagef(0, "the %s hits the %s", s,
mon_name(monster));
- (void) mon_damage(monster, damage);
+ (void)mon_damage(monster, damage);
} else {
damage = -1;
if (!(monster->m_flags & FREEZES)) {
@@ -368,9 +368,9 @@ bounce(ball, dir, row, col, r)
damage = -2;
}
if (damage != -1) {
- messagef(0, "the %s hits the %s", s,
+ messagef(0, "the %s hits the %s", s,
mon_name(monster));
- (void) mon_damage(monster, damage);
+ (void)mon_damage(monster, damage);
}
}
} else if ((row == rogue.row) && (col == rogue.col)) {
@@ -383,7 +383,7 @@ bounce(ball, dir, row, col, r)
damage = (damage * 3) / 2;
damage -= get_armor_class(rogue.armor);
}
- rogue_damage(damage, (object *) 0,
+ rogue_damage(damage, (object *)0,
((ball == FIRE) ? KFIRE : HYPOTHERMIA));
messagef(0, "the %s hits", s);
}