shithub: choc

Download patch

ref: 9b6485b5cc5f005a547e8dd3e3d5a8b90838ed99
parent: 73fd9adc1e23f711d249d4adc2389711304bd027
author: Simon Howard <[email protected]>
date: Mon Dec 24 13:33:24 EST 2012

Fix compiler warnings by removing variables that are set but not used.

Subversion-branch: /branches/v2-branch
Subversion-revision: 2555

--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -522,7 +522,6 @@
     static char		lastmessage[HU_MAXLINELENGTH+1];
     char*		macromessage;
     boolean		eatkey = false;
-    static boolean	shiftdown = false;
     static boolean	altdown = false;
     unsigned char 	c;
     int			i;
@@ -536,7 +535,6 @@
 
     if (ev->data1 == KEY_RSHIFT)
     {
-	shiftdown = ev->type == ev_keydown;
 	return false;
     }
     else if (ev->data1 == KEY_RALT || ev->data1 == KEY_LALT)
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -506,7 +506,6 @@
 {
     int rc;
     int key;
-    static int cheatstate = 0;
     static int bigstate = 0;
 
     key = ev->data1;
@@ -611,7 +610,6 @@
         */
         else
         {
-            cheatstate = 0;
             rc = false;
         }
 
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1049,14 +1049,8 @@
 
 void G_InitPlayer(int player)
 {
-    player_t *p;
-
-// set up the saved info
-    p = &players[player];
-
-// clear everything else to defaults
+    // clear everything else to defaults
     G_PlayerReborn(player);
-
 }
 
 
@@ -1423,7 +1417,6 @@
 
 void G_DoLoadGame(void)
 {
-    int length;
     int i;
     int a, b, c;
     char vcheck[VERSIONSIZE];
@@ -1430,7 +1423,7 @@
 
     gameaction = ga_nothing;
 
-    length = M_ReadFile(savename, &savebuffer);
+    M_ReadFile(savename, &savebuffer);
     free(savename);
     savename = NULL;
 
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -642,7 +642,6 @@
 void MN_LoadSlotText(void)
 {
     FILE *fp;
-    int count;
     int i;
     char *filename;
 
@@ -658,7 +657,7 @@
             SlotStatus[i] = 0;
             continue;
         }
-        count = fread(&SlotText[i], SLOTTEXTLEN, 1, fp);
+        fread(&SlotText[i], SLOTTEXTLEN, 1, fp);
         fclose(fp);
         SlotStatus[i] = 1;
     }
@@ -1040,7 +1039,6 @@
     int i;
     MenuItem_t *item;
     extern boolean automapactive;
-    static boolean shiftdown;
     extern void D_StartTitle(void);
     extern void G_CheckDemoStatus(void);
     char *textBuffer;
@@ -1081,11 +1079,7 @@
         return true;
     }
 
-    if (event->data1 == KEY_RSHIFT)
-    {
-        shiftdown = (event->type == ev_keydown);
-    }
-    if (event->type != ev_keydown)
+    if (event->data1 != KEY_RSHIFT && event->type != ev_keydown)
     {
         return (false);
     }
--- a/src/heretic/p_doors.c
+++ b/src/heretic/p_doors.c
@@ -213,7 +213,6 @@
 void EV_VerticalDoor(line_t * line, mobj_t * thing)
 {
     player_t *player;
-    int secnum;
     sector_t *sec;
     vldoor_t *door;
     int side;
@@ -268,7 +267,6 @@
 
     // if the sector has an active thinker, use it
     sec = sides[line->sidenum[side ^ 1]].sector;
-    secnum = sec - sectors;
     if (sec->specialdata)
     {
         door = sec->specialdata;
--- a/src/heretic/p_enemy.c
+++ b/src/heretic/p_enemy.c
@@ -526,7 +526,6 @@
     int c;
     int stop;
     player_t *player;
-    sector_t *sector;
     angle_t an;
     fixed_t dist;
 
@@ -534,7 +533,6 @@
     {                           // Single player game and player is dead, look for monsters
         return (P_LookForMonsters(actor));
     }
-    sector = actor->subsector->sector;
     c = 0;
     stop = (actor->lastlook - 1) & 3;
     for (;; actor->lastlook = (actor->lastlook + 1) & 3)
@@ -2272,7 +2270,6 @@
     mobj_t *mo;
     fixed_t x;
     fixed_t y;
-    fixed_t z;
 
     if (actor->special1.i == MAX_GEN_PODS)
     {                           // Too many generated pods
@@ -2280,7 +2277,6 @@
     }
     x = actor->x;
     y = actor->y;
-    z = actor->z;
     mo = P_SpawnMobj(x, y, ONFLOORZ, MT_POD);
     if (P_CheckPosition(mo, x, y) == false)
     {                           // Didn't fit
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -1133,11 +1133,6 @@
 {
     sector_t *sector;
     int i;
-    int episode;
-
-    episode = 1;
-    if (W_CheckNumForName(DEH_String("texture2")) >= 0)
-        episode = 2;
 
     //
     //      Init special SECTORs
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -106,9 +106,7 @@
                          int cacheheight)
 {
     int count, position;
-    byte *source, *dest;
-
-    dest = (byte *) cache + 3;
+    byte *source;
 
     while (patch->topdelta != 0xff)
     {
--- a/src/hexen/am_map.c
+++ b/src/hexen/am_map.c
@@ -275,7 +275,6 @@
 {
     int pnum;
     thinker_t *think;
-    mobj_t *mo;
 
     //static event_t st_notify = { ev_keyup, AM_MSGENTERED };
 
@@ -323,7 +322,6 @@
             {                   //not a mobj
                 continue;
             }
-            mo = (mobj_t *) think;
         }
     }
 
@@ -424,7 +422,6 @@
 {
     int rc;
     int key;
-    static int cheatstate = 0;
     static int bigstate = 0;
 
     key = ev->data1;
@@ -511,7 +508,6 @@
         }
         else
         {
-            cheatstate = 0;
             rc = false;
         }
 
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -1133,7 +1133,6 @@
     int i;
     MenuItem_t *item;
     extern boolean automapactive;
-    static boolean shiftdown;
     extern void H2_StartTitle(void);
     extern void G_CheckDemoStatus(void);
     char *textBuffer;
@@ -1175,13 +1174,9 @@
         return true;
     }
 
-    if (event->data1 == KEY_RSHIFT)
+    if (event->data1 != KEY_RSHIFT && event->type != ev_keydown)
     {
-        shiftdown = (event->type == ev_keydown);
-    }
-    if (event->type != ev_keydown)
-    {
-        return (false);
+        return false;
     }
 
     key = event->data1;
--- a/src/hexen/p_doors.c
+++ b/src/hexen/p_doors.c
@@ -206,7 +206,6 @@
 //==================================================================
 boolean EV_VerticalDoor(line_t * line, mobj_t * thing)
 {
-    int secnum;
     sector_t *sec;
     vldoor_t *door;
     int side;
@@ -215,7 +214,6 @@
 
     // if the sector has an active thinker, use it
     sec = sides[line->sidenum[side ^ 1]].sector;
-    secnum = sec - sectors;
     if (sec->specialdata)
     {
         return false;
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -529,7 +529,6 @@
     int c;
     int stop;
     player_t *player;
-    sector_t *sector;
     angle_t an;
     fixed_t dist;
 
@@ -537,7 +536,6 @@
     {                           // Single player game and player is dead, look for monsters
         return (P_LookForMonsters(actor));
     }
-    sector = actor->subsector->sector;
     c = 0;
 
     // NOTE: This behavior has been changed from the Vanilla behavior, where
@@ -2366,13 +2364,12 @@
 
 void A_SerpentMissileAttack(mobj_t * actor)
 {
-    mobj_t *mo;
-
     if (!actor->target)
     {
         return;
     }
-    mo = P_SpawnMissile(actor, actor->target, MT_SERPENTFX);
+
+    P_SpawnMissile(actor, actor->target, MT_SERPENTFX);
 }
 
 //============================================================================
@@ -3002,9 +2999,7 @@
 
 void A_DragonAttack(mobj_t * actor)
 {
-    mobj_t *mo;
-
-    mo = P_SpawnMissile(actor, actor->target, MT_DRAGON_FX);
+    P_SpawnMissile(actor, actor->target, MT_DRAGON_FX);
 }
 
 //============================================================================
@@ -3816,9 +3811,7 @@
 
 void A_IceGuyMissilePuff(mobj_t * actor)
 {
-    mobj_t *mo;
-    mo = P_SpawnMobj(actor->x, actor->y, actor->z + 2 * FRACUNIT,
-                     MT_ICEFX_PUFF);
+    P_SpawnMobj(actor->x, actor->y, actor->z + 2 * FRACUNIT, MT_ICEFX_PUFF);
 }
 
 //============================================================================
@@ -4983,12 +4976,10 @@
 
 void A_KoraxBonePop(mobj_t * actor)
 {
-    fixed_t x, y, z;
     mobj_t *mo;
     byte args[5];
 
     args[0] = args[1] = args[2] = args[3] = args[4] = 0;
-    x = actor->x, y = actor->y, z = actor->z;
 
     // Spawn 6 spirits equalangularly
     mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT1, ANG60 * 0,
@@ -5176,7 +5167,6 @@
 // Arm 1 projectile
 void KoraxFire1(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5184,7 +5174,7 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_SHORT, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_SHORT, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM1_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 
@@ -5191,7 +5181,6 @@
 // Arm 2 projectile
 void KoraxFire2(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5199,13 +5188,12 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM2_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 // Arm 3 projectile
 void KoraxFire3(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5213,13 +5201,12 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM3_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 // Arm 4 projectile
 void KoraxFire4(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5227,13 +5214,12 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_SHORT, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_SHORT, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM4_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 // Arm 5 projectile
 void KoraxFire5(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5241,13 +5227,12 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM5_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 // Arm 6 projectile
 void KoraxFire6(mobj_t * actor, int type)
 {
-    mobj_t *mo;
     angle_t ang;
     fixed_t x, y, z;
 
@@ -5255,7 +5240,7 @@
     x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]);
     y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]);
     z = actor->z - actor->floorclip + KORAX_ARM6_HEIGHT;
-    mo = P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
+    P_SpawnKoraxMissile(x, y, z, actor, actor->target, type);
 }
 
 
--- a/src/hexen/p_pspr.c
+++ b/src/hexen/p_pspr.c
@@ -1691,7 +1691,7 @@
 void A_CFlameMissile(mobj_t * actor)
 {
     int i;
-    int an, an90;
+    int an;
     fixed_t dist;
     mobj_t *mo;
 
@@ -1703,7 +1703,6 @@
         for (i = 0; i < 4; i++)
         {
             an = (i * ANG45) >> ANGLETOFINESHIFT;
-            an90 = (i * ANG45 + ANG90) >> ANGLETOFINESHIFT;
             mo = P_SpawnMobj(BlockingMobj->x + FixedMul(dist, finecosine[an]),
                              BlockingMobj->y + FixedMul(dist, finesine[an]),
                              BlockingMobj->z + 5 * FRACUNIT, MT_CIRCLEFLAME);
@@ -1923,11 +1922,9 @@
 
 void A_CHolyAttack(player_t * player, pspdef_t * psp)
 {
-    mobj_t *mo;
-
     player->mana[MANA_1] -= WeaponManaUse[player->class][player->readyweapon];
     player->mana[MANA_2] -= WeaponManaUse[player->class][player->readyweapon];
-    mo = P_SpawnPlayerMissile(player->mo, MT_HOLY_MISSILE);
+    P_SpawnPlayerMissile(player->mo, MT_HOLY_MISSILE);
     if (player == &players[consoleplayer])
     {
         player->damagecount = 0;
@@ -2262,7 +2259,6 @@
 {
     angle_t angle;
     int damage;
-    int slope;
     int i;
     mobj_t *pmo, *mo;
     int conedone = false;
@@ -2275,7 +2271,7 @@
     for (i = 0; i < 16; i++)
     {
         angle = pmo->angle + i * (ANG45 / 16);
-        slope = P_AimLineAttack(pmo, angle, MELEERANGE);
+        P_AimLineAttack(pmo, angle, MELEERANGE);
         if (linetarget)
         {
             pmo->flags2 |= MF2_ICEDAMAGE;
--- a/src/hexen/po_man.c
+++ b/src/hexen/po_man.c
@@ -1119,10 +1119,8 @@
 static void InitBlockMap(void)
 {
     int i;
-
     int j;
     seg_t **segList;
-    int area;
     int leftX, rightX;
     int topY, bottomY;
 
@@ -1158,8 +1156,8 @@
                 topY = (*segList)->v1->y;
             }
         }
-        area = ((rightX >> FRACBITS) - (leftX >> FRACBITS)) *
-            ((topY >> FRACBITS) - (bottomY >> FRACBITS));
+//    area = ((rightX >> FRACBITS) - (leftX >> FRACBITS)) *
+//        ((topY >> FRACBITS) - (bottomY >> FRACBITS));
 
 //    fprintf(stdaux, "Area of Polyobj[%d]: %d\n", polyobjs[i].tag, area);
 //    fprintf(stdaux, "\t[%d]\n[%d]\t\t[%d]\n\t[%d]\n", topY>>FRACBITS, 
--- a/src/hexen/r_data.c
+++ b/src/hexen/r_data.c
@@ -101,9 +101,7 @@
                          int cacheheight)
 {
     int count, position;
-    byte *source, *dest;
-
-    dest = (byte *) cache + 3;
+    byte *source;
 
     while (patch->topdelta != 0xff)
     {
--- a/src/strife/am_map.c
+++ b/src/strife/am_map.c
@@ -540,7 +540,8 @@
 //
 void AM_Start (void)
 {
-    static int lastlevel = -1, lastepisode = -1;
+    static int lastlevel = -1;
+    //static int lastepisode = -1;
 
     if (!stopped) AM_Stop();
     stopped = false;
@@ -584,7 +585,6 @@
 {
 
     int rc;
-    static int cheatstate=0;
     static int bigstate=0;
     static char buffer[20];
     int key;
@@ -681,7 +681,6 @@
         }
         else
         {
-            cheatstate=0;
             rc = false;
         }
 
--- a/src/strife/f_finale.c
+++ b/src/strife/f_finale.c
@@ -909,7 +909,6 @@
     int         x;
     patch_t*    p1;
     patch_t*    p2;
-    static int  laststage;
 
     p1 = W_CacheLumpName (DEH_String("credit"),  PU_LEVEL);
     p2 = W_CacheLumpName (DEH_String("vellogo"), PU_LEVEL);
--- a/src/strife/hu_lib.c
+++ b/src/strife/hu_lib.c
@@ -236,7 +236,6 @@
     int                 lh;
     int                 y;
     int                 yoffset;
-    static boolean      lastautomapactive = true;
 
     // Only erases when NOT in automap and the screen is reduced,
     // and the text must either need updating or refreshing
@@ -259,7 +258,6 @@
         }
     }
 
-    lastautomapactive = automapactive;
     if (l->needsupdate) l->needsupdate--;
 }
 
--- a/src/strife/hu_stuff.c
+++ b/src/strife/hu_stuff.c
@@ -540,7 +540,6 @@
     static char         lastmessage[HU_MAXLINELENGTH+1];
     char*               macromessage;
     boolean             eatkey = false;
-    static boolean      shiftdown = false;
     static boolean      altdown = false;
     unsigned char       c;
     int                 i;
@@ -554,7 +553,6 @@
 
     if (ev->data1 == KEY_RSHIFT)
     {
-        shiftdown = ev->type == ev_keydown;
         return false;
     }
     else if (ev->data1 == KEY_RALT || ev->data1 == KEY_LALT)
--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -542,7 +542,6 @@
 void M_ReadSaveStrings(void)
 {
     FILE *handle;
-    int   count;
     int   i;
     char *fname = NULL;
 
@@ -559,7 +558,7 @@
             LoadMenu[i].status = 0;
             continue;
         }
-        count = fread(savegamestrings[i], 1, SAVESTRINGSIZE, handle);
+        fread(savegamestrings[i], 1, SAVESTRINGSIZE, handle);
         fclose(handle);
         LoadMenu[i].status = 1;
     }
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -700,7 +700,6 @@
 {
     int i = 0;
     line_t junk;
-    boolean ok = true;
     int sound = sfx_itemup; // haleyjd 09/21/10: different sounds for items
 
     // set quest if mf_givequest flag is set
@@ -1262,7 +1261,6 @@
 void P_DialogStart(player_t *player)
 {
     int i = 0;
-    int j = 0;
     int pic;
     int rnd = 0;
     char* byetext;
--- a/src/strife/p_doors.c
+++ b/src/strife/p_doors.c
@@ -504,7 +504,6 @@
 boolean EV_ClearForceFields(line_t* line)
 {
     int         secnum;
-    int         rtn;
     sector_t*   sec;
     int         i;
     line_t*     secline;
@@ -511,12 +510,10 @@
     boolean     ret = false;
 
     secnum = -1;
-    rtn = 0;
 
     while((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
     {
         sec = &sectors[secnum];
-        rtn = 1;
 
         line->special = 0;
         ret = true;
@@ -549,7 +546,6 @@
 void EV_VerticalDoor(line_t* line, mobj_t* thing)
 {
     player_t*   player;
-    int         secnum;
     sector_t*   sec;
     vldoor_t*   door;
     int         side;
@@ -730,7 +726,6 @@
 
     // if the sector has an active thinker, use it
     sec = sides[ line->sidenum[side^1]] .sector;
-    secnum = sec-sectors;
 
     if (sec->specialdata)
     {
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -741,7 +741,6 @@
     int         c;
     int         stop;
     player_t*   player;
-    sector_t*   sector;
     angle_t     an;
     fixed_t     dist;
     mobj_t  *   master = players[actor->miscdata].mo;
@@ -799,8 +798,6 @@
 
         return true;
     }
-
-    sector = actor->subsector->sector;
 
     c = 0;
 
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -261,7 +261,6 @@
 
 void P_InitTerrainTypes(void)
 {
-    int pic = 0;
     int i = 0;
 
     if(terraintypes[0].type != FLOOR_END)
@@ -1887,11 +1886,6 @@
 {
     sector_t*   sector;
     int         i;
-    int         episode;
-
-    episode = 1;
-    if (W_CheckNumForName(DEH_String("texture2")) >= 0)
-        episode = 2;
 
     // See if -TIMER was specified.
 
--- a/src/strife/r_data.c
+++ b/src/strife/r_data.c
@@ -195,10 +195,7 @@
     int		count;
     int		position;
     byte*	source;
-    byte*	dest;
-	
-    dest = (byte *)cache + 3;
-	
+
     while (patch->topdelta != 0xff)
     {
 	source = (byte *)patch + 3;
@@ -708,12 +705,10 @@
 //
 void R_InitColormaps (void)
 {
-    int	lump, length;
-    
-    // Load in the light tables, 
-    //  256 byte align tables.
+    int	lump;
+
+    // Load in the light tables, 256 byte align tables.
     lump = W_GetNumForName(DEH_String("COLORMAP"));
-    length = W_LumpLength (lump);
     colormaps = W_CacheLumpNum(lump, PU_STATIC);
 }
 
--- a/src/strife/s_sound.c
+++ b/src/strife/s_sound.c
@@ -412,7 +412,6 @@
     mobj_t *origin;
     int rc;
     int sep;
-    int priority;
     int cnum;
     int volume;
 
@@ -434,7 +433,6 @@
     // Initialize sound parameters
     if (sfx->link)
     {
-        priority = sfx->priority;
         volume += sfx->volume;
 
         if (volume < 1)
@@ -446,10 +444,6 @@
         {
             volume = snd_SfxVolume;
         }
-    }        
-    else
-    {
-        priority = NORM_PRIORITY;
     }