diff xrogue/potions.c @ 228:b67b99f6c92b

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.
author John "Elwin" Edwards
date Sat, 05 Mar 2016 20:49:37 -0500
parents f54901b9c39b
children 7c1cb43f346e
line wrap: on
line diff
--- a/xrogue/potions.c	Sat Mar 05 12:10:20 2016 -0500
+++ b/xrogue/potions.c	Sat Mar 05 20:49:37 2016 -0500
@@ -27,11 +27,11 @@
 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 @@
  * 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 @@
  *      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 @@
         pstats.s_dext += ring_str;
         max_stats.s_dext = save_max;
     }
-    return(0);
+    return;
 }
 
 /*
@@ -978,13 +978,13 @@
  *      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 @@
         pstats.s_intel += ring_str;
         max_stats.s_intel = save_max;
     }
-    return(0);
+    return;
 }
 
 /*
@@ -1006,13 +1006,13 @@
  *      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 @@
         pstats.s_wisdom += ring_str;
         max_stats.s_wisdom = save_max;
     }
-    return(0);
+    return;
 }
 
 /*
@@ -1034,13 +1034,13 @@
  *      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 @@
  *      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;
 }