Mercurial > hg > early-roguelike
diff srogue/pstats.c @ 217:94a0d9dd5ce1
Super-Rogue: convert to ANSI-style function declarations.
This fixes most of the build warnings.
author | John "Elwin" Edwards |
---|---|
date | Sun, 31 Jan 2016 13:45:07 -0500 |
parents | 2128c7dc8a40 |
children | b49d8b963df3 |
line wrap: on
line diff
--- a/srogue/pstats.c Thu Jan 28 18:55:47 2016 -0500 +++ b/srogue/pstats.c Sun Jan 31 13:45:07 2016 -0500 @@ -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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * getpwis: * Get a players wisdom for fighting */ -getpwis(who) -struct stats *who; +int +getpwis(struct stats *who) { reg int ewis; @@ -249,8 +247,8 @@ * 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 @@ * 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 @@ * 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 @@ * hungdam: * Calculate damage depending on players hungry state */ -hungdam() +int +hungdam(void) { switch (hungry_state) { case F_OKAY: @@ -364,9 +363,8 @@ * 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)