XRogue: convert to ANSI-style function declarations.

This commit is contained in:
John "Elwin" Edwards 2016-03-02 21:13:26 -05:00
parent e8e6e604c3
commit 2853120387
41 changed files with 1281 additions and 908 deletions

View file

@ -24,12 +24,21 @@
#include "mach_dep.h"
#include "rogue.h"
void display(void);
void d_level(void);
void u_level(void);
void shell(void);
void nameit(void);
void namemonst(void);
void count_gold(void);
/*
* command:
* Process the user commands
*/
command()
void
command(void)
{
unsigned int ch;
struct linked_list *item;
@ -288,7 +297,7 @@ command()
else {
after = FALSE;
player.t_action = A_NIL;
fright();
fright(NULL);
}
when 'g' : /* Give command: give slime-molds to monsters */
if (player.t_action == A_NIL) {
@ -298,7 +307,7 @@ command()
else {
after = FALSE;
player.t_action = A_NIL;
give();
give(NULL);
}
when 'G' :
if (player.t_action == A_NIL) {
@ -357,14 +366,14 @@ command()
/* when '\\' : after = FALSE; ident_hero(); */
when '\\' : msg("Charon (the Boatman) looks at you... ");
when '/' : after = FALSE; identify(NULL);
when '/' : after = FALSE; identify('\0');
when C_COUNT : count_gold();
when C_DIP : dip_it();
when C_DROP : player.t_action = C_DROP;
drop((struct linked_list *)NULL);
when C_EAT : eat();
when C_QUAFF : quaff(-1, NULL, NULL, TRUE);
when C_READ : read_scroll(-1, NULL, TRUE);
when C_QUAFF : quaff(-1, 0, 0, TRUE);
when C_READ : read_scroll(-1, 0, TRUE);
when C_SETTRAP : set_trap(&player, hero.y, hero.x);
when C_SEARCH :
if (player.t_action == A_NIL) {
@ -379,7 +388,7 @@ command()
when C_USE : use_mm(-1);
when C_WEAR : wear();
when C_WIELD : wield();
when C_ZAP : if (!player_zap(NULL, FALSE)) after=FALSE;
when C_ZAP : if (!player_zap(0, FALSE)) after=FALSE;
when C_CAST : cast();
when C_CHANT : chant();
when C_PRAY : pray();
@ -638,7 +647,8 @@ command()
* tell the player what is at a certain coordinates assuming
* it can be seen.
*/
display()
void
display(void)
{
coord c;
struct linked_list *item;
@ -673,8 +683,7 @@ display()
/*UNUSED*/
void
quit(sig)
int sig;
quit(int sig)
{
register int oy, ox;
@ -727,8 +736,8 @@ int sig;
* killed by a program bug instead of voluntarily.
*/
bugkill(sig)
int sig;
void
bugkill(int sig)
{
signal(sig, quit); /* If we get it again, give up */
if (levtype == OUTSIDE) {
@ -748,8 +757,8 @@ int sig;
* Player gropes about him to find hidden things.
*/
search(is_thief, door_chime)
register bool is_thief, door_chime;
void
search(bool is_thief, bool door_chime)
{
register int x, y;
register char ch, /* The trap or door character */
@ -861,7 +870,8 @@ register bool is_thief, door_chime;
* He wants to go down a level
*/
d_level()
void
d_level(void)
{
bool no_phase=FALSE;
char position = winat(hero.y, hero.x);
@ -962,7 +972,8 @@ d_level()
* He wants to go up a level
*/
u_level()
void
u_level(void)
{
bool no_phase = FALSE;
register struct linked_list *item;
@ -1053,7 +1064,8 @@ u_level()
* Let him escape for a while
*/
shell()
void
shell(void)
{
/*
* Set the terminal back to original mode
@ -1079,7 +1091,8 @@ shell()
/*
* see what we want to name -- an item or a monster.
*/
nameit()
void
nameit(void)
{
char answer;
@ -1103,9 +1116,8 @@ nameit()
* allow a user to call a potion, scroll, or ring something
*/
nameitem(item, mark)
struct linked_list *item;
bool mark;
void
nameitem(struct linked_list *item, bool mark)
{
register struct object *obj;
register char **guess = NULL, *elsewise = NULL;
@ -1191,7 +1203,8 @@ bool mark;
/* Name a monster */
namemonst()
void
namemonst(void)
{
register struct thing *tp;
struct linked_list *item;
@ -1236,7 +1249,8 @@ namemonst()
msg("There is no monster there to name.");
}
count_gold()
void
count_gold(void)
{
if (player.t_action != C_COUNT) {
msg("You take a break to count your money.. ");
@ -1259,7 +1273,8 @@ count_gold()
* Teleport somewhere, anywhere...
*/
do_teleport()
void
do_teleport(void)
{
int tlev;
prbuf[0] = '\0';