shithub: choc

Download patch

ref: edf7efbea35087a6f56ed71ed6f5db613386d39d
parent: af6ee1723e009ff55e42fd257da03712ba7099f1
author: Simon Howard <fraggle@gmail.com>
date: Tue Sep 28 14:51:07 EDT 2010

Fix compile warnings.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2149

--- a/src/strife/hu_lib.c
+++ b/src/strife/hu_lib.c
@@ -68,7 +68,7 @@
 
             if(c >= 0 && c < HU_FONTSIZE)
             {
-                patch_t *patch = yfont[c];
+                patch_t *patch = yfont[(int) c];
                 int      width = SHORT(patch->width);
 
                 if(x + width <= (SCREENWIDTH - 20))
--- a/src/strife/hu_stuff.c
+++ b/src/strife/hu_stuff.c
@@ -343,7 +343,7 @@
             if(c < 0 || c >= HU_FONTSIZE)
                 width += 4;
             else
-                width += SHORT(hu_font[c]->width);
+                width += SHORT(hu_font[(int) c]->width);
         }
     }
 
@@ -365,7 +365,7 @@
         else
         {
             c -= HU_FONTSTART;
-            width += SHORT(hu_font[c]->width);
+            width += SHORT(hu_font[(int) c]->width);
         }
     }
 
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -1145,8 +1145,11 @@
 
     // Dismiss the dialog if the player is out of alignment, or the thing he was
     // talking to is now engaged in battle.
-    if(angle > ANG45 && angle < (ANG270+ANG45) || dialogtalker->flags & MF_NODIALOG)
+    if ((angle > ANG45 && angle < (ANG270+ANG45))
+     || (dialogtalker->flags & MF_NODIALOG) != 0)
+    {
         P_DialogDoChoice(dialogmenu.numitems - 1);
+    }
 
     dialogtalker->reactiontime = 2;
 
@@ -1466,6 +1469,7 @@
     case 1:
         byetext = DEH_String("Thanks, Bye!");
         break;
+    default:
     case 0:
         byetext = DEH_String("See you later!");
         break;
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -748,10 +748,10 @@
 
                 // Clear target if nothing is visible, or if the target is a
                 // friendly Rebel or the allied player.
-                if(!linetarget ||
-                    actor->target->type == MT_REBEL1 &&
-                    actor->target->miscdata == actor->miscdata ||
-                    actor->target == master)
+                if (linetarget == NULL
+                 || (actor->target->type == MT_REBEL1
+                  && actor->target->miscdata == actor->miscdata)
+                 || actor->target == master)
                 {
                     actor->target = NULL;
                     return false;
@@ -2934,7 +2934,7 @@
     // check for a still living boss
     for(th = thinkercap.next; th != &thinkercap; th = th->next)
     {
-        if(th->function.acp1 == P_MobjThinker)
+        if(th->function.acp1 == (actionf_p1) P_MobjThinker)
         {
             mobj_t *mo = (mobj_t *)th;
 
@@ -2974,7 +2974,7 @@
         // it becomes an undead ghost monster. Then it's a REAL spectre ;)
         for(th = thinkercap.next; th != &thinkercap; th = th->next)
         {
-            if(th->function.acp1 == P_MobjThinker)
+            if(th->function.acp1 == (actionf_p1) P_MobjThinker)
             {
                 mobj_t *mo = (mobj_t *)th;
 
@@ -3071,7 +3071,7 @@
 
     for(th = thinkercap.next; th != &thinkercap; th = th->next)
     {
-        if(th->function.acp1 == P_MobjThinker)
+        if(th->function.acp1 == (actionf_p1) P_MobjThinker)
         {
             mobj_t *mo = (mobj_t *)th;
 
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -544,8 +544,9 @@
             return false;	// mobj must lower itself to fit
 
         // villsa [STRIFE] non-robots are limited to 16 unit step height
-        if(!(thing->flags & MF_NOBLOOD) && tmfloorz - thing->z > (16*FRACUNIT) ||
-            tmfloorz - thing->z > 24*FRACUNIT)
+        if ((thing->flags & MF_NOBLOOD) == 0 && tmfloorz - thing->z > (16*FRACUNIT))
+            return false;
+        if (tmfloorz - thing->z > 24*FRACUNIT)
             return false;       // too big a step up
 
         // villsa [STRIFE] special case for missiles
--- a/src/strife/p_plats.c
+++ b/src/strife/p_plats.c
@@ -136,6 +136,9 @@
                 plat->status = down;
             S_StartSound(&plat->sector->soundorg,sfx_pstart);
         }
+
+    case in_stasis:
+        break;
     }
 }
 
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -559,9 +559,18 @@
 
     // decide on what type of grenade to spawn
     if(player->readyweapon == wp_hegrenade)
+    {
         type = MT_HEGRENADE;
+    }
     else if(player->readyweapon == wp_wpgrenade)
+    {
         type = MT_PGRENADE;
+    }
+    else
+    {
+        type = MT_HEGRENADE;
+        fprintf(stderr, "Warning: A_FireGrenade used on wrong weapon!\n");
+    }
 
     player->ammo[weaponinfo[player->readyweapon].ammo]--;
 
--- a/src/strife/p_telept.c
+++ b/src/strife/p_telept.c
@@ -59,7 +59,7 @@
     int         i;
     int         tag;
     mobj_t*     m;
-    mobj_t*     fog;
+    mobj_t*     fog = NULL;
     unsigned    an;
     thinker_t*  thinker;
     sector_t*   sector;