patch from Klaus Silveira cleaning up several inefficient and redundant
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 9 Mar 2012 04:48:36 +0000 (04:48 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 9 Mar 2012 04:48:36 +0000 (04:48 +0000)
code bits

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11749 d7cf8633-e32d-0410-b094-e92efae38249

cl_demo.c
cl_parse.c
cmd.c
gl_rsurf.c
gl_textures.c
prvm_edict.c

index e60ac36..1584cb7 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -609,6 +609,5 @@ void CL_TimeDemo_f (void)
        cls.timedemo = true;
        cls.td_frames = -2;             // skip the first frame
        cls.demonum = -1;               // stop demo loop
-       cls.demonum = -1;               // stop demo loop
 }
 
index a464db8..3002698 100644 (file)
@@ -2187,7 +2187,7 @@ static void CL_ParseClientdata (void)
                cl.stats[STAT_CELLS] = MSG_ReadShort(&cl_message);
                cl.stats[STAT_ACTIVEWEAPON] = (unsigned short) MSG_ReadShort(&cl_message);
        }
-       else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
+       else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
        {
                cl.stats[STAT_WEAPONFRAME] = (bits & SU_WEAPONFRAME) ? MSG_ReadByte(&cl_message) : 0;
                cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadByte(&cl_message) : 0;
diff --git a/cmd.c b/cmd.c
index 51d3f0c..beee312 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -463,7 +463,8 @@ static void Cmd_StuffCmds_f (void)
 static void Cmd_Exec(const char *filename)
 {
        char *f;
-       qboolean isdefaultcfg = strlen(filename) >= 11 && !strcmp(filename + strlen(filename) - 11, "default.cfg");
+       size_t filenameLen = strlen(filename);
+       qboolean isdefaultcfg = filenameLen >= 11 && !strcmp(filename + filenameLen - 11, "default.cfg");
 
        if (!strcmp(filename, "config.cfg"))
        {
index bc37840..2d0f479 100644 (file)
@@ -1587,7 +1587,6 @@ static void R_ReplaceWorldTexture (void)
                        {
 //                             t->skinframes[0] = skinframe;
                                t->currentskinframe = skinframe;
-                               t->currentskinframe = skinframe;
                                Con_Printf("%s replaced with %s\n", r, newt);
                        }
                        else
index 57c7633..57c257f 100644 (file)
@@ -2069,7 +2069,7 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
        mipinfo[0][0] = glt->tilewidth;
        mipinfo[0][1] = glt->tileheight;
        mipmaps = 1;
-       if ((glt->flags & TEXF_MIPMAP) && !(glt->tilewidth == 1 && glt->tilewidth == 1))
+       if ((glt->flags & TEXF_MIPMAP) && !(glt->tilewidth == 1 && glt->tileheight == 1))
        {
                for (mip = 1;mip < 16;mip++)
                {
index c4687b5..6dc2a6e 100644 (file)
@@ -1606,7 +1606,7 @@ static void PRVM_PO_UnparseString(char *out, const char *in, size_t outsize)
                                                *out++ = '\\';
                                                *out++ = '0' + ((*in & 0700) >> 6);
                                                *out++ = '0' + ((*in & 0070) >> 3);
-                                               *out++ = '0' + ((*in & 0007));
+                                               *out++ = '0' +  (*in & 0007)      ;
                                                outsize -= 4;
                                        }
                                }