foxygit / doom Log in
commit cd7cc921f38545a47ed8bc16620ce58c816639e1
Author:     Michael Francis <mikefrancis95@gmail.com>
AuthorDate: Wed Oct 21 12:05:00 2020 -0400
Commit:     GitHub <noreply@github.com>
CommitDate: Wed Oct 21 12:05:00 2020 -0400

    Remove extra assignments of variables (#1323)

    This fixes more warnings generated by cppcheck.
---
 src/doom/g_game.c      | 2 --
 src/doom/p_enemy.c     | 3 +--
 src/doom/p_telept.c    | 1 -
 src/doom/r_data.c      | 3 ---
 src/heretic/g_game.c   | 1 -
 src/heretic/p_telept.c | 1 -
 src/heretic/r_data.c   | 3 ---
 src/hexen/p_lights.c   | 1 -
 src/hexen/p_spec.c     | 1 -
 src/hexen/r_data.c     | 4 ----
 src/strife/p_telept.c  | 1 -
 src/strife/r_data.c    | 3 ---
 12 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index d68c20e1..d3b2f3e4 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -1858,8 +1858,6 @@ G_InitNew
     gamemap = map;
     gameskill = skill;

-    viewactive = true;
-
     // Set the sky to use.
     //
     // Note: This IS broken, but it is how Vanilla Doom behaves.
diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c
index 0207ff8c..8f0795a4 100644
--- a/src/doom/p_enemy.c
+++ b/src/doom/p_enemy.c
@@ -1831,8 +1831,7 @@ void A_BrainAwake (mobj_t* mo)
     // find all the target spots
     numbraintargets = 0;
     braintargeton = 0;
-
-    thinker = thinkercap.next;
+
     for (thinker = thinkercap.next ;
 	 thinker != &thinkercap ;
 	 thinker = thinker->next)
diff --git a/src/doom/p_telept.c b/src/doom/p_telept.c
index 45cdfb01..8e2d5e16 100644
--- a/src/doom/p_telept.c
+++ b/src/doom/p_telept.c
@@ -70,7 +70,6 @@ EV_Teleport
     {
 	if (sectors[ i ].tag == tag )
 	{
-	    thinker = thinkercap.next;
 	    for (thinker = thinkercap.next;
 		 thinker != &thinkercap;
 		 thinker = thinker->next)
diff --git a/src/doom/r_data.c b/src/doom/r_data.c
index 4a452702..ea380fb9 100644
--- a/src/doom/r_data.c
+++ b/src/doom/r_data.c
@@ -247,8 +247,6 @@ void R_GenerateComposite (int texnum)
     colofs = texturecolumnofs[texnum];

     // Composite the columns together.
-    patch = texture->patches;
-
     for (i=0 , patch = texture->patches;
 	 i<texture->patchcount;
 	 i++, patch++)
@@ -319,7 +317,6 @@ void R_GenerateLookup (int texnum)
     //  with only a single patch are all done.
     patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount);
     memset (patchcount, 0, texture->width);
-    patch = texture->patches;

     for (i=0 , patch = texture->patches;
 	 i<texture->patchcount;
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 7e069693..56de0b8a 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1695,7 +1695,6 @@ void G_InitNew(skill_t skill, int episode, int map)
     gameepisode = episode;
     gamemap = map;
     gameskill = skill;
-    viewactive = true;
     BorderNeedRefresh = true;

     // Set the sky map
diff --git a/src/heretic/p_telept.c b/src/heretic/p_telept.c
index 640cee50..a922f7cf 100644
--- a/src/heretic/p_telept.c
+++ b/src/heretic/p_telept.c
@@ -139,7 +139,6 @@ boolean EV_Teleport(line_t * line, int side, mobj_t * thing)
     {
         if (sectors[i].tag == tag)
         {
-            thinker = thinkercap.next;
             for (thinker = thinkercap.next; thinker != &thinkercap;
                  thinker = thinker->next)
             {
diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index a9a4e29e..8970ad4b 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -150,8 +150,6 @@ void R_GenerateComposite(int texnum)
 //
 // composite the columns together
 //
-    patch = texture->patches;
-
     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
     {
@@ -216,7 +214,6 @@ void R_GenerateLookup(int texnum)
 //
     patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount);
     memset(patchcount, 0, texture->width);
-    patch = texture->patches;

     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
diff --git a/src/hexen/p_lights.c b/src/hexen/p_lights.c
index dc26f734..8c972981 100644
--- a/src/hexen/p_lights.c
+++ b/src/hexen/p_lights.c
@@ -137,7 +137,6 @@ boolean EV_SpawnLight(line_t * line, byte * arg, lighttype_t type)

     secNum = -1;
     rtn = false;
-    think = false;
     while ((secNum = P_FindSectorFromTag(arg[0], secNum)) >= 0)
     {
         think = false;
diff --git a/src/hexen/p_spec.c b/src/hexen/p_spec.c
index 893ad4ac..c3accc13 100644
--- a/src/hexen/p_spec.c
+++ b/src/hexen/p_spec.c
@@ -865,7 +865,6 @@ boolean P_ActivateLine(line_t * line, mobj_t * mo, int side,
             return false;       // never open secret doors
     }
     repeat = (line->flags & ML_REPEAT_SPECIAL) != 0;
-    buttonSuccess = false;

     // Construct args[] array to contain the arguments from the line, as we
     // cannot rely on struct field ordering and layout.
diff --git a/src/hexen/r_data.c b/src/hexen/r_data.c
index e020612c..5f0df8ab 100644
--- a/src/hexen/r_data.c
+++ b/src/hexen/r_data.c
@@ -145,8 +145,6 @@ void R_GenerateComposite(int texnum)
 //
 // composite the columns together
 //
-    patch = texture->patches;
-
     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
     {
@@ -211,8 +209,6 @@ void R_GenerateLookup(int texnum)
 //
     patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount);
     memset(patchcount, 0, texture->width);
-    patch = texture->patches;
-
     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
     {
diff --git a/src/strife/p_telept.c b/src/strife/p_telept.c
index 544c2336..aff3b0c3 100644
--- a/src/strife/p_telept.c
+++ b/src/strife/p_telept.c
@@ -75,7 +75,6 @@ EV_Teleport
     {
         if (sectors[ i ].tag == tag )
         {
-            thinker = thinkercap.next;
             for (thinker = thinkercap.next;
                 thinker != &thinkercap;
                 thinker = thinker->next)
diff --git a/src/strife/r_data.c b/src/strife/r_data.c
index 2ee5c426..0fbb8ee1 100644
--- a/src/strife/r_data.c
+++ b/src/strife/r_data.c
@@ -243,8 +243,6 @@ void R_GenerateComposite (int texnum)
     colofs = texturecolumnofs[texnum];

     // Composite the columns together.
-    patch = texture->patches;
-
     for (i=0 , patch = texture->patches;
 	 i<texture->patchcount;
 	 i++, patch++)
@@ -315,7 +313,6 @@ void R_GenerateLookup (int texnum)
     //  with only a single patch are all done.
     patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount);
     memset (patchcount, 0, texture->width);
-    patch = texture->patches;

     for (i=0 , patch = texture->patches;
 	 i<texture->patchcount;