Daemons and fuses now return void.
Functions for starting and stopping daemons and fuses now expect the type 'void (*func)()'. Only a few functions in XRogue needed to be modified to fit. Determining the type of the argument is left for a later date. Building with GCC5 should now produce less than 200 lines of warnings per game.
This commit is contained in:
parent
6dfde944f0
commit
0a354903e0
14 changed files with 91 additions and 96 deletions
|
|
@ -27,11 +27,11 @@ int add_intelligence(int change);
|
|||
int add_strength(int change);
|
||||
int add_wisdom(int change);
|
||||
|
||||
int res_charisma(int howmuch);
|
||||
int res_constitution(int howmuch);
|
||||
int res_dexterity(int howmuch);
|
||||
int res_intelligence(int howmuch);
|
||||
int res_wisdom(int howmuch);
|
||||
void res_charisma(int howmuch);
|
||||
void res_constitution(int howmuch);
|
||||
void res_dexterity(int howmuch);
|
||||
void res_intelligence(int howmuch);
|
||||
void res_wisdom(int howmuch);
|
||||
|
||||
/*
|
||||
* add_abil is an array of functions used to change attributes. It must be
|
||||
|
|
@ -48,7 +48,7 @@ int (*add_abil[NUMABILITIES])() = {
|
|||
* ordered according to the attribute definitions in rogue.h.
|
||||
*/
|
||||
|
||||
int (*res_abil[NUMABILITIES])() = {
|
||||
void (*res_abil[NUMABILITIES])() = {
|
||||
res_intelligence, res_strength, res_wisdom, res_dexterity,
|
||||
res_constitution, res_charisma
|
||||
};
|
||||
|
|
@ -945,13 +945,13 @@ quaff(int which, int kind, int flags, bool is_potion)
|
|||
* if called with zero the restore fully
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
res_dexterity(int howmuch)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
||||
if (howmuch < 0) return(0);
|
||||
if (howmuch < 0) return;
|
||||
|
||||
/* Discount the ring value */
|
||||
ring_str = ring_value(R_ADDHIT);
|
||||
|
|
@ -970,7 +970,7 @@ res_dexterity(int howmuch)
|
|||
pstats.s_dext += ring_str;
|
||||
max_stats.s_dext = save_max;
|
||||
}
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -978,13 +978,13 @@ res_dexterity(int howmuch)
|
|||
* Restore player's intelligence
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
res_intelligence(int howmuch)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
||||
if (howmuch <= 0) return(0);
|
||||
if (howmuch <= 0) return;
|
||||
|
||||
/* Discount the ring value */
|
||||
ring_str = ring_value(R_ADDINTEL);
|
||||
|
|
@ -998,7 +998,7 @@ res_intelligence(int howmuch)
|
|||
pstats.s_intel += ring_str;
|
||||
max_stats.s_intel = save_max;
|
||||
}
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1006,13 +1006,13 @@ res_intelligence(int howmuch)
|
|||
* Restore player's wisdom
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
res_wisdom(int howmuch)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
||||
if (howmuch <= 0) return(0);
|
||||
if (howmuch <= 0) return;
|
||||
|
||||
/* Discount the ring value */
|
||||
ring_str = ring_value(R_ADDWISDOM);
|
||||
|
|
@ -1026,7 +1026,7 @@ res_wisdom(int howmuch)
|
|||
pstats.s_wisdom += ring_str;
|
||||
max_stats.s_wisdom = save_max;
|
||||
}
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1034,13 +1034,13 @@ res_wisdom(int howmuch)
|
|||
* Restore the players constitution.
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
res_constitution(int howmuch)
|
||||
{
|
||||
if (howmuch > 0)
|
||||
pstats.s_const = min(pstats.s_const + howmuch, max_stats.s_const);
|
||||
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1048,12 +1048,12 @@ res_constitution(int howmuch)
|
|||
* Restore the players charisma.
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
res_charisma(int howmuch)
|
||||
{
|
||||
if (howmuch > 0)
|
||||
pstats.s_charisma =
|
||||
min(pstats.s_charisma + howmuch, max_stats.s_charisma);
|
||||
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue