From 0e1520d29aad4eb4213bbd0c0ecc24dc6e509fcd Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Fri, 1 Jun 2012 17:05:40 +0200 Subject: [PATCH] Remove dead code and assignments --- src/client/cl_effects.c | 2 -- src/client/cl_prediction.c | 4 ---- src/client/cl_screen.c | 3 --- src/client/cl_tempentities.c | 8 ++++---- src/client/sound/snd_vorbis.c | 4 +--- src/refresh/r_image.c | 9 ++++----- src/refresh/r_mesh.c | 5 ++--- src/server/sv_send.c | 8 +++----- src/server/sv_world.c | 8 -------- 9 files changed, 14 insertions(+), 37 deletions(-) diff --git a/src/client/cl_effects.c b/src/client/cl_effects.c index 3e6847a3..12b80454 100644 --- a/src/client/cl_effects.c +++ b/src/client/cl_effects.c @@ -1419,7 +1419,6 @@ void CL_FlyParticles (vec3_t origin, int count) { angle = ltime * avelocities[i][1]; sp = (float)sin(angle); cp = (float)cos(angle); - angle = ltime * avelocities[i][2]; forward[0] = cp*cy; forward[1] = cp*sy; @@ -1508,7 +1507,6 @@ void CL_BfgParticles (entity_t *ent) { angle = ltime * avelocities[i][1]; sp = (float)sin(angle); cp = (float)cos(angle); - angle = ltime * avelocities[i][2]; forward[0] = cp*cy; forward[1] = cp*sy; diff --git a/src/client/cl_prediction.c b/src/client/cl_prediction.c index d8d4c68b..be5df0c3 100644 --- a/src/client/cl_prediction.c +++ b/src/client/cl_prediction.c @@ -216,13 +216,9 @@ void CL_PredictMovement (void) { /* copy current state to pmove */ pm.trace = CL_PMTrace; pm.pointcontents = CL_PMpointcontents; - pm_airaccelerate = atof(cl.configstrings[CS_AIRACCEL]); - pm.s = cl.frame.playerstate.pmove; - frame = 0; - VectorSet (pm.mins, -16, -16, -24); VectorSet (pm.maxs, 16, 16, 32); diff --git a/src/client/cl_screen.c b/src/client/cl_screen.c index e89e476f..123a3c6e 100644 --- a/src/client/cl_screen.c +++ b/src/client/cl_screen.c @@ -721,7 +721,6 @@ void DrawHUDString (char *string, int x, int y, int centerwidth, int xor) { if (*string) { string++; /* skip the \n */ - x = margin; y += 8; } } @@ -805,7 +804,6 @@ void SCR_ExecuteLayoutString (char *s) { x = 0; y = 0; - width = 3; while (s) { token = COM_Parse (&s); @@ -849,7 +847,6 @@ void SCR_ExecuteLayoutString (char *s) { if (!strcmp(token, "pic")) { /* draw a pic from a stat number */ token = COM_Parse (&s); - value = cl.frame.playerstate.stats[atoi(token)]; index = atoi(token); if (index < 0 || index >= sizeof(cl.frame.playerstate.stats)) diff --git a/src/client/cl_tempentities.c b/src/client/cl_tempentities.c index da56bc86..0066d4c7 100644 --- a/src/client/cl_tempentities.c +++ b/src/client/cl_tempentities.c @@ -478,12 +478,12 @@ void CL_ParseSteam (void) { s->nextthink = cl.time; } else { - cnt = MSG_ReadByte (&net_message); + MSG_ReadByte (&net_message); MSG_ReadPos (&net_message, pos); MSG_ReadDir (&net_message, dir); - r = MSG_ReadByte (&net_message); - magnitude = MSG_ReadShort (&net_message); - magnitude = MSG_ReadLong (&net_message); /* really interval */ + MSG_ReadByte (&net_message); + MSG_ReadShort (&net_message); + MSG_ReadLong (&net_message); /* really interval */ } } else { diff --git a/src/client/sound/snd_vorbis.c b/src/client/sound/snd_vorbis.c index 1f7065d9..8bc730a1 100644 --- a/src/client/sound/snd_vorbis.c +++ b/src/client/sound/snd_vorbis.c @@ -391,11 +391,9 @@ qboolean OGG_Open ( ogg_seek_t type, int offset ) { int size; /* File size. */ - int pos; /* Absolute position. */ + int pos = -1; /* Absolute position. */ int res; /* Error indicator. */ - pos = -1; - switch ( type ) { case ABS: diff --git a/src/refresh/r_image.c b/src/refresh/r_image.c index 7f45d08a..dce7cf6a 100644 --- a/src/refresh/r_image.c +++ b/src/refresh/r_image.c @@ -511,7 +511,6 @@ R_ResampleTexture ( unsigned *in, int inwidth, int inheight, unsigned *out, int { inrow = in + inwidth * (int) ( ( i + 0.25 ) * inheight / outheight ); inrow2 = in + inwidth * (int) ( ( i + 0.75 ) * inheight / outheight ); - frac = fracstep >> 1; for ( j = 0; j < outwidth; j++ ) { @@ -1085,7 +1084,7 @@ R_FindImage ( char *name, imagetype_t type ) else { /* Upload TGA */ - image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); + R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); } if( !pic ) @@ -1104,7 +1103,7 @@ R_FindImage ( char *name, imagetype_t type ) } else { - /* Upload JPEG */ + /* Upload JPEG or TGA */ image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); } } @@ -1140,7 +1139,7 @@ R_FindImage ( char *name, imagetype_t type ) else { /* Upload TGA */ - image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); + R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); } if( !pic ) @@ -1150,7 +1149,7 @@ R_FindImage ( char *name, imagetype_t type ) } else { - /* Upload JPEG */ + /* Upload JPEG or TGA */ image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); } diff --git a/src/refresh/r_mesh.c b/src/refresh/r_mesh.c index 6c28a662..597fec4c 100644 --- a/src/refresh/r_mesh.c +++ b/src/refresh/r_mesh.c @@ -294,13 +294,12 @@ R_DrawAliasFrameLerp ( dmdl_t *paliashdr, float backlerp ) void R_DrawAliasShadow ( dmdl_t *paliashdr, int posenum ) { - int *order; + int *order; vec3_t point; - float height, lheight; + float height = 0, lheight; int count; lheight = currententity->origin [ 2 ] - lightspot [ 2 ]; - height = 0; order = (int *) ( (byte *) paliashdr + paliashdr->ofs_glcmds ); height = -lheight + 0.1f; diff --git a/src/server/sv_send.c b/src/server/sv_send.c index fa31165f..997f884d 100644 --- a/src/server/sv_send.c +++ b/src/server/sv_send.c @@ -149,9 +149,9 @@ SV_BroadcastCommand ( char *fmt, ... ) void SV_Multicast ( vec3_t origin, multicast_t to ) { - client_t *client; - byte *mask; - int leafnum, cluster; + client_t *client; + byte *mask; + int leafnum = 0, cluster; int j; qboolean reliable; int area1, area2; @@ -165,7 +165,6 @@ SV_Multicast ( vec3_t origin, multicast_t to ) } else { - leafnum = 0; /* just to avoid compiler warnings */ area1 = 0; } @@ -180,7 +179,6 @@ SV_Multicast ( vec3_t origin, multicast_t to ) case MULTICAST_ALL_R: reliable = true; /* intentional fallthrough */ case MULTICAST_ALL: - leafnum = 0; mask = NULL; break; diff --git a/src/server/sv_world.c b/src/server/sv_world.c index cb093446..5c05572f 100644 --- a/src/server/sv_world.c +++ b/src/server/sv_world.c @@ -483,7 +483,6 @@ SV_PointContents ( vec3_t p ) int i, num; int contents, c2; int headnode; - float *angles; /* get base contents from world */ contents = CM_PointContents( p, sv.models [ 1 ]->headnode ); @@ -497,13 +496,6 @@ SV_PointContents ( vec3_t p ) /* might intersect, so do an exact clip */ headnode = SV_HullForEntity( hit ); - angles = hit->s.angles; - - if ( hit->solid != SOLID_BSP ) - { - angles = vec3_origin; /* boxes don't rotate */ - } - c2 = CM_TransformedPointContents( p, headnode, hit->s.origin, hit->s.angles ); contents |= c2;