trivial: remove various redundant variable assignments

clang found a number of places where we redundantly set a variable to
some value and never read it back (before it is assigned
again). Remove those cases. A couple were cases of trying to silence
the compiler, but modern versions of gcc seem to have made some of
these unneccessary.
This commit is contained in:
Tyrann 2011-12-28 11:41:14 +10:00
parent 1843ed91b0
commit 9d25ce27c2
9 changed files with 1 additions and 15 deletions

View File

@ -352,14 +352,12 @@ GL_DrawAliasShadow(aliashdr_t *paliashdr, int posenum)
int count;
lheight = currententity->origin[2] - lightspot[2];
height = -lheight + 1.0;
height = 0;
verts = (trivertx_t *)((byte *)paliashdr + paliashdr->posedata);
verts += posenum * paliashdr->poseverts;
order = (int *)((byte *)paliashdr + paliashdr->commands);
height = -lheight + 1.0;
while (1) {
// get the vertex count and primitive type
count = *order++;

View File

@ -634,7 +634,6 @@ Host_Loadgame_f(void)
if (i == sizeof(str) - 1)
Sys_Error("Loadgame buffer overflow");
str[i] = 0;
start = str;
start = COM_Parse(str);
if (!com_token[0])
break; // end of file

View File

@ -100,7 +100,6 @@ R_NetGraph(void)
char st[80];
unsigned ngraph_pixels[NET_GRAPHHEIGHT][NET_TIMINGS];
x = 0;
lost = CL_CalcNet();
for (a = 0; a < NET_TIMINGS; a++) {
i = (cls.netchan.outgoing_sequence - a) & NET_TIMINGSMASK;

View File

@ -340,7 +340,6 @@ Mod_LoadTextures(lump_t *l)
memset(altanims, 0, sizeof(altanims));
max = tx->name[1];
altmax = 0;
if (max >= 'a' && max <= 'z')
max -= 'a' - 'A';
if (max >= '0' && max <= '9') {

View File

@ -423,7 +423,6 @@ Mod_LoadTextures(lump_t *l)
memset(altanims, 0, sizeof(altanims));
max = tx->name[1];
altmax = 0;
if (max >= 'a' && max <= 'z')
max -= 'a' - 'A';
if (max >= '0' && max <= '9') {

View File

@ -135,8 +135,6 @@ XLateKey(XKeyEvent * ev)
char buf[64];
KeySym keysym;
key = 0;
XLookupString(ev, buf, sizeof(buf), &keysym, 0);
switch (keysym) {

View File

@ -278,7 +278,6 @@ BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, mplane_t *p)
p->normal[2] * emaxs[2];
break;
default:
dist1 = dist2 = 0; // shut up compiler
BOPS_Error();
break;
}

View File

@ -404,7 +404,6 @@ Mod_LoadTextures(lump_t *l)
memset(altanims, 0, sizeof(altanims));
max = tx->name[1];
altmax = 0;
if (max >= 'a' && max <= 'z')
max -= 'a' - 'A';
if (max >= '0' && max <= '9') {

View File

@ -576,8 +576,6 @@ VID_Init(unsigned char *palette)
Sys_Error("VID: Bad window height");
}
template_mask = 0;
// specify a visual id
if ((pnum = COM_CheckParm("-visualid"))) {
if (pnum >= com_argc - 1)
@ -801,8 +799,6 @@ XLateKey(XKeyEvent * ev)
char buf[64];
KeySym keysym;
key = 0;
XLookupString(ev, buf, sizeof(buf), &keysym, 0);
switch (keysym) {