foxygit / doom Log in
commit edf7efbea35087a6f56ed71ed6f5db613386d39d
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Tue Sep 28 18:51:07 2010 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Tue Sep 28 18:51:07 2010 +0000

    Fix compile warnings.

    Subversion-branch: /branches/strife-branch
    Subversion-revision: 2149
---
 src/strife/hu_lib.c   |  2 +-
 src/strife/hu_stuff.c |  4 ++--
 src/strife/p_dialog.c |  6 +++++-
 src/strife/p_enemy.c  | 14 +++++++-------
 src/strife/p_map.c    |  5 +++--
 src/strife/p_plats.c  |  3 +++
 src/strife/p_pspr.c   |  9 +++++++++
 src/strife/p_telept.c |  2 +-
 8 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/src/strife/hu_lib.c b/src/strife/hu_lib.c
index 989c921b..2033c7b5 100644
--- a/src/strife/hu_lib.c
+++ b/src/strife/hu_lib.c
@@ -68,7 +68,7 @@ void HUlib_drawYellowText(int x, int y, char *text)

             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))
diff --git a/src/strife/hu_stuff.c b/src/strife/hu_stuff.c
index 22d7b4f7..42a9dbb1 100644
--- a/src/strife/hu_stuff.c
+++ b/src/strife/hu_stuff.c
@@ -343,7 +343,7 @@ void HU_addMessage(char *prefix, char *message)
             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 @@ void HU_addMessage(char *prefix, char *message)
         else
         {
             c -= HU_FONTSTART;
-            width += SHORT(hu_font[c]->width);
+            width += SHORT(hu_font[(int) c]->width);
         }
     }

diff --git a/src/strife/p_dialog.c b/src/strife/p_dialog.c
index 7b993f8d..a3a3b6e3 100644
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -1145,8 +1145,11 @@ static void P_DialogDrawer(void)

     // 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 @@ void P_DialogStart(player_t *player)
     case 1:
         byetext = DEH_String("Thanks, Bye!");
         break;
+    default:
     case 0:
         byetext = DEH_String("See you later!");
         break;
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index 7c5c9117..09cd4dfc 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -748,10 +748,10 @@ P_LookForPlayers

                 // 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 @@ void A_BossDeath (mobj_t* actor)
     // 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 @@ void A_BossDeath (mobj_t* actor)
         // 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 @@ void A_AcolyteSpecial(mobj_t* actor)

     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;

diff --git a/src/strife/p_map.c b/src/strife/p_map.c
index 44f12689..99ae3d40 100644
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -544,8 +544,9 @@ P_TryMove
             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
diff --git a/src/strife/p_plats.c b/src/strife/p_plats.c
index 5d10670d..51424760 100644
--- a/src/strife/p_plats.c
+++ b/src/strife/p_plats.c
@@ -136,6 +136,9 @@ void T_PlatRaise(plat_t* plat)
                 plat->status = down;
             S_StartSound(&plat->sector->soundorg,sfx_pstart);
         }
+
+    case in_stasis:
+        break;
     }
 }

diff --git a/src/strife/p_pspr.c b/src/strife/p_pspr.c
index fb6d3990..4794ecc2 100644
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -559,9 +559,18 @@ void A_FireGrenade(player_t* player, pspdef_t* pspr)

     // 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]--;

diff --git a/src/strife/p_telept.c b/src/strife/p_telept.c
index f947a9d9..390951a0 100644
--- a/src/strife/p_telept.c
+++ b/src/strife/p_telept.c
@@ -59,7 +59,7 @@ EV_Teleport
     int         i;
     int         tag;
     mobj_t*     m;
-    mobj_t*     fog;
+    mobj_t*     fog = NULL;
     unsigned    an;
     thinker_t*  thinker;
     sector_t*   sector;