shithub: choc

Download patch

ref: cd7cc921f38545a47ed8bc16620ce58c816639e1
parent: 01168584c8f0e6485efcd8ffa5e9f720809eb64c
author: Michael Francis <mikefrancis95@gmail.com>
date: Wed Oct 21 08:05:00 EDT 2020

Remove extra assignments of variables (#1323)

This fixes more warnings generated by cppcheck.

--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -1858,8 +1858,6 @@
     gamemap = map;
     gameskill = skill;
 
-    viewactive = true;
-
     // Set the sky to use.
     //
     // Note: This IS broken, but it is how Vanilla Doom behaves.
--- a/src/doom/p_enemy.c
+++ b/src/doom/p_enemy.c
@@ -1831,8 +1831,7 @@
     // find all the target spots
     numbraintargets = 0;
     braintargeton = 0;
-	
-    thinker = thinkercap.next;
+
     for (thinker = thinkercap.next ;
 	 thinker != &thinkercap ;
 	 thinker = thinker->next)
--- a/src/doom/p_telept.c
+++ b/src/doom/p_telept.c
@@ -70,7 +70,6 @@
     {
 	if (sectors[ i ].tag == tag )
 	{
-	    thinker = thinkercap.next;
 	    for (thinker = thinkercap.next;
 		 thinker != &thinkercap;
 		 thinker = thinker->next)
--- a/src/doom/r_data.c
+++ b/src/doom/r_data.c
@@ -247,8 +247,6 @@
     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 @@
     //  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;
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1695,7 +1695,6 @@
     gameepisode = episode;
     gamemap = map;
     gameskill = skill;
-    viewactive = true;
     BorderNeedRefresh = true;
 
     // Set the sky map
--- a/src/heretic/p_telept.c
+++ b/src/heretic/p_telept.c
@@ -139,7 +139,6 @@
     {
         if (sectors[i].tag == tag)
         {
-            thinker = thinkercap.next;
             for (thinker = thinkercap.next; thinker != &thinkercap;
                  thinker = thinker->next)
             {
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -150,8 +150,6 @@
 //
 // composite the columns together
 //
-    patch = texture->patches;
-
     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
     {
@@ -216,7 +214,6 @@
 //
     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++)
--- a/src/hexen/p_lights.c
+++ b/src/hexen/p_lights.c
@@ -137,7 +137,6 @@
 
     secNum = -1;
     rtn = false;
-    think = false;
     while ((secNum = P_FindSectorFromTag(arg[0], secNum)) >= 0)
     {
         think = false;
--- a/src/hexen/p_spec.c
+++ b/src/hexen/p_spec.c
@@ -865,7 +865,6 @@
             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.
--- a/src/hexen/r_data.c
+++ b/src/hexen/r_data.c
@@ -145,8 +145,6 @@
 //
 // composite the columns together
 //
-    patch = texture->patches;
-
     for (i = 0, patch = texture->patches; i < texture->patchcount;
          i++, patch++)
     {
@@ -211,8 +209,6 @@
 //
     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++)
     {
--- a/src/strife/p_telept.c
+++ b/src/strife/p_telept.c
@@ -75,7 +75,6 @@
     {
         if (sectors[ i ].tag == tag )
         {
-            thinker = thinkercap.next;
             for (thinker = thinkercap.next;
                 thinker != &thinkercap;
                 thinker = thinker->next)
--- a/src/strife/r_data.c
+++ b/src/strife/r_data.c
@@ -243,8 +243,6 @@
     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 @@
     //  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;