diff xrogue/potions.c @ 239:837044d2c362

Merge the GCC5 and build fix branches. This fixes all warnings produced by GCC 5, except the ones related to system functions. Those could be fixed by including the proper headers, but it would be better to replace the system-dependent code with functions from mdport.c.
author John "Elwin" Edwards
date Fri, 11 Mar 2016 19:47:52 -0500
parents 7c1cb43f346e
children 0250220d8cdd
line wrap: on
line diff
--- a/xrogue/potions.c	Tue Mar 08 19:45:41 2016 -0500
+++ b/xrogue/potions.c	Fri Mar 11 19:47:52 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
 };
@@ -172,7 +172,7 @@
     else {
         msg("You feel yourself moving %sfaster.", blessed ? "much " : "");
         turn_on(player, ISHASTE);
-        fuse(nohaste, (VOID *)NULL, roll(hasttime, hasttime), AFTER);
+        fuse(nohaste, NULL, roll(hasttime, hasttime), AFTER);
     }
 }
 
@@ -232,7 +232,7 @@
             lengthen(noslow, roll(HASTETIME,HASTETIME));
         else {
             turn_on(player, ISSLOW);
-            fuse(noslow, (VOID *)NULL, roll(HASTETIME,HASTETIME), AFTER);
+            fuse(noslow, NULL, roll(HASTETIME,HASTETIME), AFTER);
         }
     }
 }
@@ -353,7 +353,7 @@
                 }
                 else {  /* Just light a fuse for how long player is safe */
                     if (off(player, ISCLEAR)) {
-                        fuse(unclrhead, (VOID *)NULL, CLRDURATION, AFTER);
+                        fuse(unclrhead, NULL, CLRDURATION, AFTER);
                         msg("A faint blue aura surrounds your head.");
                     }
                     else {  /* If we have a fuse lengthen it, else we
@@ -518,7 +518,7 @@
                 {
                     msg("A cloak of darkness falls around you.");
                     turn_on(player, ISBLIND);
-                    fuse(sight, (VOID *)NULL, SEEDURATION, AFTER);
+                    fuse(sight, NULL, SEEDURATION, AFTER);
                     light(&hero);
                 }
                 else
@@ -529,7 +529,7 @@
                 if (off(player, CANSEE)) {
                     turn_on(player, CANSEE);
                     msg("Your eyes begin to tingle.");
-                    fuse(unsee, (VOID *)NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
+                    fuse(unsee, NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
                     light(&hero);
                 }
                 else if (find_slot(unsee) != 0) {
@@ -553,7 +553,7 @@
                 if (on(player, CANINWALL))
                     lengthen(unphase, duration*PHASEDURATION);
                 else {
-                    fuse(unphase, (VOID *)NULL, duration*PHASEDURATION, AFTER);
+                    fuse(unphase, NULL, duration*PHASEDURATION, AFTER);
                     turn_on(player, CANINWALL);
                 }
                 msg("You feel %slight-headed!",
@@ -577,7 +577,7 @@
                 }
             }
             else {
-                fuse(land, (VOID *)NULL, duration*FLYTIME, AFTER);
+                fuse(land, NULL, duration*FLYTIME, AFTER);
                 turn_on(player, ISFLY);
             }
             if (say_message) {
@@ -641,7 +641,7 @@
             if (off(player, ISINVIS)) {
                 turn_on(player, ISINVIS);
                 msg("You have a tingling feeling all over your body");
-                fuse(appear, (VOID *)NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
+                fuse(appear, NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
                 PLAYER = IPLAYER;
                 light(&hero);
             }
@@ -703,7 +703,7 @@
                 if (!find_slot(unskill)) {      /* No skill */
                     pstats.s_lvladj = -2;
                     pstats.s_lvl += pstats.s_lvladj;
-                    fuse(unskill, (VOID *)NULL, SKILLDURATION, AFTER);
+                    fuse(unskill, NULL, SKILLDURATION, AFTER);
                 }
                 else {  /* Has an artifical skill */
                     /* Is the skill beneficial? */
@@ -759,7 +759,7 @@
                 if (!find_slot(unskill)) {
                     pstats.s_lvladj = adjust;
                     pstats.s_lvl += pstats.s_lvladj;
-                    fuse(unskill, (VOID *)NULL, 
+                    fuse(unskill, NULL, 
                          blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER);
                 }
                 else {  /* Has an artifical skill */
@@ -819,7 +819,7 @@
         say_message = FALSE;
         }
             else {
-                fuse(nofire, (VOID *)NULL, duration*FIRETIME, AFTER);
+                fuse(nofire, NULL, duration*FIRETIME, AFTER);
                 turn_on(player, NOFIRE);
             }
             if (say_message)  {
@@ -856,7 +856,7 @@
         say_message = FALSE;
         }
             else {
-                fuse(nocold, (VOID *)NULL, duration*COLDTIME, AFTER);
+                fuse(nocold, NULL, duration*COLDTIME, AFTER);
                 turn_on(player, NOCOLD);
             }
             if (say_message)  {
@@ -890,7 +890,7 @@
         say_message = FALSE;
         }
             else {
-                fuse(nobolt, (VOID *)NULL, duration*BOLTTIME, AFTER);
+                fuse(nobolt, NULL, duration*BOLTTIME, AFTER);
                 turn_on(player, NOBOLT);
             }
             if (say_message) {
@@ -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;
 }