]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 9 Mar 2012 19:02:48 +0000 (20:02 +0100)
code bits

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11749 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=f7b537c4d6f704b272a66041e03927c4bdecc40c

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

index e60ac367d64fa0760c4a0d10a2c24ff652a0f8b2..1584cb7bf19e59f462b4390be656e0637a5c7a97 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 a464db893b4e17a2ba10b984fd4a3133d388638b..30026988f6c97c2679231c4db50bc86db8685d1b 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 51d3f0c1bedcc78a04bf7002e3b7b09b6ac8ecc1..beee312d053ec2130607c22c0e916550098b9217 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 bc37840189571356248e4155bdcc121cbdcca064..2d0f4795316ea88aa4cbbb70e52cd83086a4af13 100644 (file)
@@ -1586,7 +1586,6 @@ static void R_ReplaceWorldTexture (void)
                        if ((skinframe = R_SkinFrame_LoadExternal(newt, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PICMIP, true)))
                        {
 //                             t->skinframes[0] = skinframe;
-                               t->currentskinframe = skinframe;
                                t->currentskinframe = skinframe;
                                Con_Printf("%s replaced with %s\n", r, newt);
                        }
index 57c7633a349c5e737368b1da3466df5e0da64241..57c257f27d85d1ecfff4e5909a8e8a426d8c4ef9 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 c4687b50f637aa97f868868fefdb26627d7ea089..6dc2a6e871d8d9963bdf69ee0104946429a0b5c6 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;
                                        }
                                }