shithub: choc

Download patch

ref: 5de507694b0ca43739033d75cf20fcf7ea31a2dd
parent: bf215f516ed4742fd19b920d8a5d3f6738375168
author: James Haley <haleyjd@hotmail.com>
date: Sat Sep 18 13:35:57 EDT 2010

Tons of warnings fixed - now only 7 warnings at warning level 3, and
most of those are outside of our own code (get on those signed/unsigned
mismatches in the midi code, fraggle ;)

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

--- a/msvc/strife.vcproj
+++ b/msvc/strife.vcproj
@@ -51,7 +51,7 @@
 				UsePrecompiledHeader="0"
 				ExpandAttributedSource="true"
 				AssemblerOutput="2"
-				WarningLevel="2"
+				WarningLevel="3"
 				DebugInformationFormat="4"
 				CompileAs="1"
 			/>
--- a/src/m_controls.c
+++ b/src/m_controls.c
@@ -355,8 +355,8 @@
 
 void M_BindChatControls(unsigned int num_players)
 {
-    char name[32]; // haleyjd: 20 not large enough - Thank you, come again!
-    int i;
+    char name[32];  // haleyjd: 20 not large enough - Thank you, come again!
+    unsigned int i; // haleyjd: signedness conflict
 
     M_BindVariable("key_multi_msg",     &key_multi_msg);
 
--- a/src/strife/f_finale.c
+++ b/src/strife/f_finale.c
@@ -69,9 +69,9 @@
 unsigned int finalecount;
 
 // haleyjd 09/12/10: [STRIFE] Slideshow variables
-char *slideshow_panel;
-int   slideshow_tics;
-int   slideshow_state;
+char         *slideshow_panel;
+unsigned int  slideshow_tics;
+int           slideshow_state;
 
 // haleyjd 09/13/10: [STRIFE] All this is unused.
 /*
@@ -174,7 +174,6 @@
 void F_StartFinale (void)
 {
     patch_t *panel;
-    size_t i;
 
     gameaction = ga_nothing;
     gamestate = GS_FINALE;
@@ -903,8 +902,6 @@
     int         x;
     patch_t*    p1;
     patch_t*    p2;
-    char        name[10];
-    int         stage;
     static int  laststage;
 
     p1 = W_CacheLumpName (DEH_String("credit"),  PU_LEVEL);
--- a/src/strife/m_menu.h
+++ b/src/strife/m_menu.h
@@ -99,6 +99,9 @@
 // haleyjd 09/04/10: [STRIFE] New function.
 void M_DialogDimMsg(int x, int y, char *str, boolean useyfont);
 
+// haleyjd [STRIFE] Externalized
+void M_ClearMenus (int choice);
+
 extern int detailLevel;
 extern int screenblocks;
 
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -28,6 +28,8 @@
 //
 //-----------------------------------------------------------------------------
 
+#include <stdlib.h>
+
 #include "z_zone.h"
 #include "w_wad.h"
 #include "deh_str.h"
@@ -41,6 +43,9 @@
 #include "p_local.h"
 #include "sounds.h"
 #include "p_dialog.h"
+#include "s_sound.h"
+#include "p_local.h"
+#include "p_inter.h"
 
 //
 // Defines and Macros
@@ -1221,7 +1226,7 @@
 
     dialogtalker->angle = dialogtalkerangle;
     dialogplayer->st_update = true;
-    M_ClearMenus();
+    M_ClearMenus(0);
 
     if(nextdialog >= 0 || gameaction == ga_victory) // Macil hack
         menuindialog = false;
@@ -1251,7 +1256,6 @@
     int j = 0;
     int pic;
     int rnd = 0;
-    mapdialog_t* dialog;
     char* byetext;
     int jumptoconv;
 
--- a/src/strife/p_dialog.h
+++ b/src/strife/p_dialog.h
@@ -89,13 +89,15 @@
     mapdlgchoice_t choices[MDLG_MAXCHOICES];
 } mapdialog_t;
 
-void            P_DialogLoad(void);
-void            P_DialogStart(player_t *player);
-void            P_DialogDoChoice(int choice);
-boolean         P_GiveItemToPlayer(player_t *player, int sprnum, mobjtype_t type);
-void            P_DialogStartP1(void);
-mapdialog_t*    P_DialogFind(mobjtype_t type, int jumptoconv);
-int             P_PlayerHasItem(player_t *player, mobjtype_t type);
+void         P_DialogLoad(void);
+void         P_DialogStart(player_t *player);
+void         P_DialogDoChoice(int choice);
+boolean      P_GiveItemToPlayer(player_t *player, int sprnum, mobjtype_t type);
+boolean      P_GiveInventoryItem(player_t *player, int sprnum, mobjtype_t type);
+boolean      P_UseInventoryItem(player_t* player, int item);
+void         P_DialogStartP1(void);
+mapdialog_t* P_DialogFind(mobjtype_t type, int jumptoconv);
+int          P_PlayerHasItem(player_t *player, mobjtype_t type);
 
 #endif
 
--- a/src/strife/p_doors.c
+++ b/src/strife/p_doors.c
@@ -43,6 +43,7 @@
 
 // [STRIFE]
 #include "p_dialog.h"
+#include "i_system.h"
 
 
 //
@@ -1236,7 +1237,6 @@
 {
     int		    secnum;
     sector_t*       sec;
-    slidedoor_t*    door;
     int             i;
     int             rtn;
     line_t*         secline;
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -47,6 +47,9 @@
 // [STRIFE] Dialog / Inventory
 #include "p_dialog.h"
 #include "deh_str.h"
+#include "w_wad.h"
+#include "f_finale.h"
+#include "p_inter.h"
 
 // Forward Declarations:
 void A_RandomWalk(mobj_t *);
@@ -2531,7 +2534,6 @@
     mobj_t *subentity;
     angle_t an;
     fixed_t dist;
-    fixed_t momx, momy;
 
     dist = 2 * mobjinfo[MT_SUBENTITY].radius;
 
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -41,10 +41,17 @@
 #include "p_dialog.h"   // villsa [STRIFE]
 #include "s_sound.h"
 #include "p_inter.h"
+
 #include "hu_stuff.h"   // villsa [STRIFE]
 #include "z_zone.h"     // villsa [STRIFE]
 
+// haleyjd [STRIFE]
+#include "w_wad.h"
+#include "p_pspr.h"
+#include "p_dialog.h"
+#include "f_finale.h"
 
+
 #define BONUSADD	6
 
 
@@ -112,31 +119,34 @@
 
     // villsa [STRIFE] ammo update
     // where's the check for grenades? - haleyjd: verified no switch to grenades
-    switch(ammo && !player->readyweapon)
+    if(!player->readyweapon)
     {
-    case am_bullets:
-        if(player->weaponowned[wp_rifle])
-            player->pendingweapon = wp_rifle;
-        break;
+        switch(ammo)
+        {
+        case am_bullets:
+            if(player->weaponowned[wp_rifle])
+                player->pendingweapon = wp_rifle;
+            break;
 
-    case am_elecbolts:
-    case am_poisonbolts:
-        if(player->weaponowned[wp_elecbow])
-            player->pendingweapon = wp_elecbow;
-        break;
+        case am_elecbolts:
+        case am_poisonbolts:
+            if(player->weaponowned[wp_elecbow])
+                player->pendingweapon = wp_elecbow;
+            break;
 
-    case am_cell:
-        if(player->weaponowned[wp_mauler])
-            player->pendingweapon = wp_mauler;
-        break;
+        case am_cell:
+            if(player->weaponowned[wp_mauler])
+                player->pendingweapon = wp_mauler;
+            break;
 
-    case am_missiles:
-        if(player->weaponowned[wp_missile])
-            player->pendingweapon = wp_missile;
-        break;
+        case am_missiles:
+            if(player->weaponowned[wp_missile])
+                player->pendingweapon = wp_missile;
+            break;
 
-    default:
-        break;
+        default:
+            break;
+        }
     }
 
     return true;
--- a/src/strife/p_inter.h
+++ b/src/strife/p_inter.h
@@ -28,11 +28,13 @@
 #ifndef __P_INTER__
 #define __P_INTER__
 
-
-
-
-boolean	P_GivePower(player_t*, powertype_t);
-
-
+// haleyjd [STRIFE]: Multiple externals added
+boolean P_GiveCard(player_t* player, card_t card);
+boolean P_GiveBody(player_t* player, int num);
+boolean P_GiveArmor(player_t* player, int armortype);
+boolean P_GivePower(player_t* player, powertype_t power);
+boolean P_GiveAmmo(player_t* player, ammotype_t ammo, int num);
+boolean P_GiveWeapon(player_t* player, weapontype_t weapon, boolean dropped);
+void    P_KillMobj(mobj_t* source, mobj_t* target);
 
 #endif
--- a/src/strife/p_local.h
+++ b/src/strife/p_local.h
@@ -147,7 +147,9 @@
 //
 void P_NoiseAlert (mobj_t* target, mobj_t* emmiter);
 void P_DoPunchAlert(mobj_t *puncher, mobj_t *punchee);  // villsa [STRIFE]
-
+void A_BodyParts(mobj_t *actor);                        // haleyjd: [STRIFE]
+void A_AlertSpectreC(mobj_t* actor);
+void A_FaceTarget (mobj_t* actor);
 
 //
 // P_MAPUTL
--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -1469,14 +1469,14 @@
 boolean PIT_ChangeSector (mobj_t*	thing)
 {
     mobj_t*	mo;
-	
+
     if (P_ThingHeightClip (thing))
     {
-	// keep checking
-	return true;
+        // keep checking
+        return true;
     }
-    
 
+
     // crunch bodies to giblets
     if (thing->health <= 0)
     {
@@ -1486,30 +1486,30 @@
             nofit = true;
             return false;
         }
-	//P_SetMobjState (thing, S_GIBS);   // villsa [STRIFE] unused
+        //P_SetMobjState (thing, S_GIBS);   // villsa [STRIFE] unused
 
         A_BodyParts(thing); // villsa [STRIFE] spit out meat/junk stuff
-	thing->flags &= ~MF_SOLID;
-	thing->height = 0;
-	thing->radius = 0;
+        thing->flags &= ~MF_SOLID;
+        thing->height = 0;
+        thing->radius = 0;
 
-	// keep checking
-	return true;		
+        // keep checking
+        return true;
     }
 
     // crunch dropped items
     if (thing->flags & MF_DROPPED)
     {
-	P_RemoveMobj (thing);
-	
-	// keep checking
-	return true;		
+        P_RemoveMobj (thing);
+
+        // keep checking
+        return true;		
     }
 
     if (! (thing->flags & MF_SHOOTABLE) )
     {
-	// assume it is bloody gibs or something
-	return true;			
+        // assume it is bloody gibs or something
+        return true;
     }
     
     nofit = true;
@@ -1517,19 +1517,19 @@
     if (crushchange && !(leveltime&3) )
     {
         S_StartSound(thing, sfx_pcrush);   // villsa [STRIFE]
-	P_DamageMobj(thing,NULL,NULL,10);
+        P_DamageMobj(thing,NULL,NULL,10);
 
-	// spray blood in a random direction
-	mo = P_SpawnMobj (thing->x,
-			  thing->y,
-			  thing->z + thing->height/2, MT_BLOOD_DEATH);
-	
-	mo->momx = (P_Random() - P_Random ())<<12;
-	mo->momy = (P_Random() - P_Random ())<<12;
+        // spray blood in a random direction
+        mo = P_SpawnMobj (thing->x,
+                          thing->y,
+                          thing->z + thing->height/2, MT_BLOOD_DEATH);
+
+        mo->momx = (P_Random() - P_Random ())<<12;
+        mo->momy = (P_Random() - P_Random ())<<12;
     }
 
     // keep checking (crush other things)	
-    return true;	
+    return true;
 }
 
 
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -264,14 +264,14 @@
 {
     fixed_t	dist;
     fixed_t	delta;
-    
+
     // check for smooth step up
     if (mo->player && mo->z < mo->floorz)
     {
-	mo->player->viewheight -= mo->floorz-mo->z;
+        mo->player->viewheight -= mo->floorz-mo->z;
 
-	mo->player->deltaviewheight
-	    = (VIEWHEIGHT - mo->player->viewheight)>>3;
+        mo->player->deltaviewheight
+            = (VIEWHEIGHT - mo->player->viewheight)>>3;
     }
     
     // adjust height
@@ -286,44 +286,44 @@
     }
 
     //mo->z += mo->momz; // villsa [STRIFE] unused
-	
+
     if ( mo->flags & MF_FLOAT
-	 && mo->target)
+        && mo->target)
     {
-	// float down towards target if too close
-	if ( /*!(mo->flags & MF_SKULLFLY)   // villsa [STRIFE] unused
-	     &&*/ !(mo->flags & MF_INFLOAT) )
-	{
-	    dist = P_AproxDistance (mo->x - mo->target->x,
-				    mo->y - mo->target->y);
-	    
-	    delta =(mo->target->z + (mo->height>>1)) - mo->z;
+        // float down towards target if too close
+        if ( /*!(mo->flags & MF_SKULLFLY)   // villsa [STRIFE] unused
+             &&*/ !(mo->flags & MF_INFLOAT) )
+        {
+            dist = P_AproxDistance (mo->x - mo->target->x,
+                                    mo->y - mo->target->y);
 
-	    if (delta<0 && dist < -(delta*3) )
-		mo->z -= FLOATSPEED;
-	    else if (delta>0 && dist < (delta*3) )
-		mo->z += FLOATSPEED;			
-	}
-	
+            delta =(mo->target->z + (mo->height>>1)) - mo->z;
+
+            if (delta<0 && dist < -(delta*3) )
+                mo->z -= FLOATSPEED;
+            else if (delta>0 && dist < (delta*3) )
+                mo->z += FLOATSPEED;			
+        }
+
     }
     
     // clip movement
     if (mo->z <= mo->floorz)
     {
-	// hit the floor
+        // hit the floor
 
-	// Note (id):
-	//  somebody left this after the setting momz to 0,
-	//  kinda useless there.
-	//
-	// cph - This was the a bug in the linuxdoom-1.10 source which
-	//  caused it not to sync Doom 2 v1.9 demos. Someone
-	//  added the above comment and moved up the following code. So
-	//  demos would desync in close lost soul fights.
-	// Note that this only applies to original Doom 1 or Doom2 demos - not
-	//  Final Doom and Ultimate Doom.  So we test demo_compatibility *and*
-	//  gamemission. (Note we assume that Doom1 is always Ult Doom, which
-	//  seems to hold for most published demos.)
+        // Note (id):
+        //  somebody left this after the setting momz to 0,
+        //  kinda useless there.
+        //
+        // cph - This was the a bug in the linuxdoom-1.10 source which
+        //  caused it not to sync Doom 2 v1.9 demos. Someone
+        //  added the above comment and moved up the following code. So
+        //  demos would desync in close lost soul fights.
+        // Note that this only applies to original Doom 1 or Doom2 demos - not
+        //  Final Doom and Ultimate Doom.  So we test demo_compatibility *and*
+        //  gamemission. (Note we assume that Doom1 is always Ult Doom, which
+        //  seems to hold for most published demos.)
         //  
         //  fraggle - cph got the logic here slightly wrong.  There are three
         //  versions of Doom 1.9:
@@ -334,52 +334,53 @@
         //
         // So we need to check that this is either retail or commercial
         // (but not doom2)
-	
-	//int correct_lost_soul_bounce = gameversion >= exe_ultimate;
 
-	if (/*correct_lost_soul_bounce &&*/ mo->flags & MF_BOUNCE)
-	{
-	    // the skull slammed into something
+        //int correct_lost_soul_bounce = gameversion >= exe_ultimate;
+
+        if (/*correct_lost_soul_bounce &&*/ mo->flags & MF_BOUNCE)
+        {
+            // the skull slammed into something
             // villsa [STRIFE] affect reactiontime
             // momz is also shifted by 1
-	    mo->momz = -mo->momz >> 1;
+            mo->momz = -mo->momz >> 1;
             mo->reactiontime >>= 1;
 
             // villsa [STRIFE] get terrain type
             if(P_GetTerrainType(mo) != FLOOR_SOLID)
                 mo->flags &= ~MF_BOUNCE;
-	}
-	
-	if (mo->momz < 0)
-	{
-	    if (mo->player
-		&& mo->momz < -GRAVITY*8)	
-	    {
-		// Squat down.
-		// Decrease viewheight for a moment
-		// after hitting the ground (hard),
-		// and utter appropriate sound.
-		mo->player->deltaviewheight = mo->momz>>3;
+        }
 
+        if (mo->momz < 0)
+        {
+            if (mo->player
+                && mo->momz < -GRAVITY*8)	
+            {
+                // Squat down.
+                // Decrease viewheight for a moment
+                // after hitting the ground (hard),
+                // and utter appropriate sound.
+                mo->player->deltaviewheight = mo->momz>>3;
+
                 // villsa [STRIFE] fall damage
-                if(mo->momz < -(20*FRACUNIT))
+                if(mo->momz < -20*FRACUNIT)
                 {
-                    P_DamageMobj(mo, NULL, mo, (mo->momz >> 32) / -25000);
+                    // haleyjd 09/18/10: Repaired calculation
+                    P_DamageMobj(mo, NULL, mo, mo->momz / -25000);
                     mo->player->centerview = 1;
                 }
 
-		S_StartSound (mo, sfx_oof);
-	    }
-	    mo->momz = 0;
-	}
-	mo->z = mo->floorz;
+                S_StartSound (mo, sfx_oof);
+            }
+            mo->momz = 0;
+        }
+        mo->z = mo->floorz;
 
 
-	// cph 2001/05/26 -
-	// See lost soul bouncing comment above. We need this here for bug
-	// compatibility with original Doom2 v1.9 - if a soul is charging and
-	// hit by a raising floor this incorrectly reverses its Y momentum.
-	//
+        // cph 2001/05/26 -
+        // See lost soul bouncing comment above. We need this here for bug
+        // compatibility with original Doom2 v1.9 - if a soul is charging and
+        // hit by a raising floor this incorrectly reverses its Y momentum.
+        //
 
         // villsa [STRIFE] unused
         /*if (!correct_lost_soul_bounce && mo->flags & MF_SKULLFLY)
@@ -386,43 +387,43 @@
             mo->momz = -mo->momz;*/
 
         // villsa [STRIFE] also check for MF_BOUNCE
-	if ( (mo->flags & MF_MISSILE)
-	     && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) )
-	{
+        if ( (mo->flags & MF_MISSILE)
+            && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) )
+        {
             P_ExplodeMissile (mo);
-	    return;
-	}
+            return;
+        }
     }
     else if (! (mo->flags & MF_NOGRAVITY) )
     {
-	if (mo->momz == 0)
-	    mo->momz = -GRAVITY*2;
-	else
-	    mo->momz -= GRAVITY;
+        if (mo->momz == 0)
+            mo->momz = -GRAVITY*2;
+        else
+            mo->momz -= GRAVITY;
     }
-	
+
     if (mo->z + mo->height > mo->ceilingz)
     {
         // villsa [STRIFE] replace skullfly flag with MF_BOUNCE
         if (mo->flags & MF_BOUNCE)
         {
-	    // villsa [STRIFE] affect reactiontime
+            // villsa [STRIFE] affect reactiontime
             // momz is also shifted by 1
-	    mo->momz = -mo->momz >> 1;
+            mo->momz = -mo->momz >> 1;
             mo->reactiontime >>= 1;
         }
 
-	// hit the ceiling
-	if (mo->momz > 0)
-	    mo->momz = 0;
-	{
-	    mo->z = mo->ceilingz - mo->height;
-	}
-	
+        // hit the ceiling
+        if (mo->momz > 0)
+            mo->momz = 0;
+        {
+            mo->z = mo->ceilingz - mo->height;
+        }
+
         // villsa [STRIFE] also check for MF_BOUNCE
-	if ( (mo->flags & MF_MISSILE)
-	     && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) )
-	{
+        if ( (mo->flags & MF_MISSILE)
+            && !(mo->flags & (MF_NOCLIP|MF_BOUNCE)) )
+        {
             // villsa [STRIFE] check against skies
             if(mo->subsector->sector->ceilingpic == skyflatnum)
                 P_RemoveMobj(mo);
@@ -429,8 +430,8 @@
             else
                 P_ExplodeMissile (mo);
 
-	    return;
-	}
+            return;
+        }
     }
 } 
 
@@ -756,7 +757,6 @@
     fixed_t     y;
     fixed_t     z;
     mobj_t*     mobj;
-    int         i;
 
     if(mthing->type == 0)
         return;
--- a/src/strife/p_mobj.h
+++ b/src/strife/p_mobj.h
@@ -332,6 +332,7 @@
     
 } mobj_t;
 
-
+// haleyjd [STRIFE] Exported
+void P_CheckMissileSpawn (mobj_t* th);
 
 #endif
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -511,7 +511,6 @@
 void A_FireMissile(player_t* player, pspdef_t* psp) 
 {
     angle_t an;
-    mobj_t* mo;
 
     an = player->mo->angle;
     player->mo->angle += (P_Random() - P_Random())<<(19 - (player->accuracy * 4 / 100));
--- a/src/strife/p_pspr.h
+++ b/src/strife/p_pspr.h
@@ -79,4 +79,9 @@
 
 } pspdef_t;
 
+typedef struct player_s *playerptr;
+
+// haleyjd [STRIFE] Exported
+void P_SetPsprite(playerptr player, int position, statenum_t stnum);
+
 #endif
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -138,7 +138,7 @@
     { false, "F_FAN2",   "F_FAN1",    4},
     { false, "F_CONVY2", "F_CONVY1",  4},
     { false, "F_RDALN4", "F_RDALN1",  4},
-    { -1,    NULL,       NULL,        0},
+    { -1,    "",         "",          0},
 };
 
 anim_t  anims[MAXANIMS];
@@ -169,35 +169,35 @@
         startname = DEH_String(animdefs[i].startname);
         endname = DEH_String(animdefs[i].endname);
 
-	if (animdefs[i].istexture)
-	{
-	    // different episode ?
-	    if (R_CheckTextureNumForName(startname) == -1)
-		continue;	
+        if (animdefs[i].istexture)
+        {
+            // different episode ?
+            if (R_CheckTextureNumForName(startname) == -1)
+                continue;	
 
-	    lastanim->picnum = R_TextureNumForName(endname);
-	    lastanim->basepic = R_TextureNumForName(startname);
-	}
-	else
-	{
-	    if (W_CheckNumForName(startname) == -1)
-		continue;
+            lastanim->picnum = R_TextureNumForName(endname);
+            lastanim->basepic = R_TextureNumForName(startname);
+        }
+        else
+        {
+            if (W_CheckNumForName(startname) == -1)
+                continue;
 
-	    lastanim->picnum = R_FlatNumForName(endname);
-	    lastanim->basepic = R_FlatNumForName(startname);
-	}
+            lastanim->picnum = R_FlatNumForName(endname);
+            lastanim->basepic = R_FlatNumForName(startname);
+        }
 
-	lastanim->istexture = animdefs[i].istexture;
-	lastanim->numpics = lastanim->picnum - lastanim->basepic + 1;
+        lastanim->istexture = animdefs[i].istexture;
+        lastanim->numpics = lastanim->picnum - lastanim->basepic + 1;
 
-	if (lastanim->numpics < 2)
-	    I_Error ("P_InitPicAnims: bad cycle from %s to %s",
-		     startname, endname);
-	
-	lastanim->speed = animdefs[i].speed;
-	lastanim++;
+        if (lastanim->numpics < 2)
+            I_Error ("P_InitPicAnims: bad cycle from %s to %s",
+            startname, endname);
+
+        lastanim->speed = animdefs[i].speed;
+        lastanim++;
     }
-	
+
 }
 
 // villsa [STRIFE] terrain type definitions
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -35,6 +35,8 @@
 #include "g_game.h"
 #include "d_main.h" // villsa [STRIFE]
 #include "s_sound.h"
+#include "m_random.h" // haleyjd [STRIFE]
+#include "p_dialog.h"
 
 // Data.
 #include "sounds.h"
--- a/src/strife/p_user.c
+++ b/src/strife/p_user.c
@@ -26,9 +26,8 @@
 //
 //-----------------------------------------------------------------------------
 
+#include <stdlib.h>
 
-
-
 #include "doomdef.h"
 #include "d_event.h"
 #include "p_local.h"
@@ -36,6 +35,13 @@
 #include "p_dialog.h"   // villsa [STRIFE]
 #include "d_main.h"     // villsa [STRIFE]
 #include "doomstat.h"
+#include "deh_str.h"    // haleyjd [STRIFE]
+#include "z_zone.h"
+#include "w_wad.h"
+#include "p_pspr.h"
+#include "m_random.h"
+#include "s_sound.h"
+#include "p_inter.h"
 
 
 
--- a/src/strife/r_bsp.c
+++ b/src/strife/r_bsp.c
@@ -304,7 +304,7 @@
 	// Totally off the left edge?
 	if (tspan >= span)
 	    return;	
-	angle2 = -clipangle;
+	angle2 = 0 - clipangle;
     }
     
     // The seg is in the view range,
@@ -456,7 +456,7 @@
 	if (tspan >= span)
 	    return false;
 	
-	angle2 = -clipangle;
+	angle2 = 0 - clipangle;
     }
 
 
--- a/src/strife/r_main.c
+++ b/src/strife/r_main.c
@@ -320,7 +320,7 @@
 	    if (x>y)
 	    {
 		// octant 8
-		return -tantoangle[SlopeDiv(y,x)];
+		return 0 - tantoangle[SlopeDiv(y,x)];
 	    }
 	    else
 	    {
--- a/src/strife/r_segs.c
+++ b/src/strife/r_segs.c
@@ -637,7 +637,7 @@
 	offsetangle = rw_normalangle-rw_angle1;
 	
 	if (offsetangle > ANG180)
-	    offsetangle = -offsetangle;
+	    offsetangle = 0 - offsetangle;
 
 	if (offsetangle > ANG90)
 	    offsetangle = ANG90;
--- a/src/strife/s_sound.c
+++ b/src/strife/s_sound.c
@@ -25,6 +25,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #include "i_sound.h"
 #include "i_system.h"
@@ -590,6 +591,7 @@
 {
     int lumpnum;
     voiceinfo_t *voice; // choco-specific
+    char lumpnamedup[9];
 
     // no voices in deathmatch mode.
     if(netgame)
@@ -613,10 +615,15 @@
     if(lumpname == NULL)
         return;
 
-    if((lumpnum = W_CheckNumForName(lumpname)) != -1)
+    // Because of constness problems...
+    strncpy(lumpnamedup, lumpname, 9);
+    lumpnamedup[8] = '\0';
+
+
+    if((lumpnum = W_CheckNumForName(lumpnamedup)) != -1)
     {
         // haleyjd: Choco-specific: get a voice structure
-        voice = S_getVoice(lumpname, lumpnum);
+        voice = S_getVoice(lumpnamedup, lumpnum);
 
         // get a channel for the voice
         i_voicehandle = S_GetChannel(NULL, &voice->sfx, true);
--- a/src/strife/st_stuff.c
+++ b/src/strife/st_stuff.c
@@ -621,7 +621,6 @@
 void ST_Ticker (void)
 {
     static int  largeammo = 1994; // means "n/a"
-    int         i;
 
     // must redirect the pointer if the ready weapon has changed.
     if (weaponinfo[plyr->readyweapon].ammo == am_noammo)
@@ -809,8 +808,6 @@
 {
 
     int		i;
-    int		j;
-    int		facenum;
     
     char	namebuf[9];
 
@@ -896,8 +893,6 @@
 
 void ST_createWidgets(void)
 {
-    int i;
-
     // ready weapon ammo
     STlib_initNum(&w_ready,
                   ST_AMMOX,