Super-Rogue: convert to ANSI-style function declarations.

This fixes most of the build warnings.
This commit is contained in:
John "Elwin" Edwards 2016-01-31 13:45:07 -05:00
parent 0f87d5b4d8
commit 59f448e92e
33 changed files with 783 additions and 518 deletions

View file

@ -13,15 +13,15 @@
#include "rogue.h"
#include "rogue.ext"
void updabil(int what, int amt, struct real *pst, int how);
int hungdam(void);
/*
* chg_hpt:
* Changes players hit points
*/
chg_hpt(howmany, alsomax, what)
int howmany;
bool alsomax;
char what;
void
chg_hpt(int howmany, bool alsomax, char what)
{
nochange = FALSE;
if(alsomax)
@ -38,8 +38,8 @@ char what;
* rchg_str:
* Update the players real strength
*/
rchg_str(amt)
int amt;
void
rchg_str(int amt)
{
chg_abil(STR,amt,TRUE);
}
@ -48,8 +48,8 @@ int amt;
* chg_abil:
* Used to modify the hero's abilities
*/
chg_abil(what,amt,how)
int amt, what, how;
void
chg_abil(int what, int amt, int how)
{
if (amt == 0)
return;
@ -66,9 +66,8 @@ int amt, what, how;
* updabil:
* Do the actual abilities updating
*/
updabil(what, amt, pst, how)
struct real *pst;
int what, amt, how;
void
updabil(int what, int amt, struct real *pst, int how)
{
register int *wh, *mx, *mr;
struct real *mst, *msr;
@ -138,8 +137,8 @@ int what, amt, how;
* add_haste:
* add a haste to the player
*/
add_haste(potion)
bool potion;
void
add_haste(bool potion)
{
if (pl_on(ISHASTE)) {
msg("You faint from exhaustion.");
@ -160,9 +159,8 @@ bool potion;
* getpdex:
* Gets players added dexterity for fighting
*/
getpdex(who, heave)
struct stats *who;
bool heave;
int
getpdex(struct stats *who, bool heave)
{
reg int edex;
@ -217,8 +215,8 @@ bool heave;
* getpwis:
* Get a players wisdom for fighting
*/
getpwis(who)
struct stats *who;
int
getpwis(struct stats *who)
{
reg int ewis;
@ -249,8 +247,8 @@ struct stats *who;
* getpcon:
* Get added hit points from players constitution
*/
getpcon(who)
struct stats *who;
int
getpcon(struct stats *who)
{
reg int econ;
@ -282,8 +280,8 @@ struct stats *who;
* str_plus:
* compute bonus/penalties for strength on the "to hit" roll
*/
str_plus(who)
struct stats *who;
int
str_plus(struct stats *who)
{
reg int hitplus, str;
@ -315,8 +313,8 @@ struct stats *who;
* add_dam:
* Compute additional damage done depending on strength
*/
add_dam(who)
struct stats *who;
int
add_dam(struct stats *who)
{
reg int exdam, str;
@ -350,7 +348,8 @@ struct stats *who;
* hungdam:
* Calculate damage depending on players hungry state
*/
hungdam()
int
hungdam(void)
{
switch (hungry_state) {
case F_OKAY:
@ -364,9 +363,8 @@ hungdam()
* heal_self:
* Heal the hero.
*/
heal_self(factor, updmaxhp)
int factor;
bool updmaxhp;
void
heal_self(int factor, bool updmaxhp)
{
him->s_hpt += roll(him->s_lvl + getpcon(him), factor);
if (updmaxhp)