Remove unused variables and dead code (patch submitted by Christoph

Mallon)
This commit is contained in:
Yamagi Burmeister 2012-04-30 10:02:58 +02:00
parent cdaf1ef5c4
commit b6325d7858
18 changed files with 4 additions and 106 deletions

View file

@ -363,7 +363,6 @@ void Con_CenteredPrint (char *text) {
* typing goes beyond the right edge
*/
void Con_DrawInput (void) {
int y;
int i;
char *text;
@ -387,9 +386,6 @@ void Con_DrawInput (void) {
if (key_linepos >= con.linewidth)
text += 1 + key_linepos - con.linewidth;
/* draw it */
y = con.vislines-16;
for (i=0 ; i<con.linewidth ; i++)
re.DrawChar ( (i+1)<<3, con.vislines - 22, text[i]);

View file

@ -568,7 +568,6 @@ void CL_AddViewWeapon (player_state_t *ps, player_state_t *ops) {
void CL_CalcViewValues (void) {
int i;
float lerp, backlerp;
centity_t *ent;
frame_t *oldframe;
player_state_t *ps, *ops;
@ -588,7 +587,6 @@ void CL_CalcViewValues (void) {
|| abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8)
ops = ps; /* don't interpolate */
ent = &cl_entities[cl.playernum+1];
lerp = cl.lerpfrac;
/* calculate the origin */

View file

@ -128,7 +128,6 @@ ResetDefaults ( void *unused )
static void
ApplyChanges ( void *unused )
{
float gamma;
int ref;
/* make values consistent */
@ -136,9 +135,6 @@ ApplyChanges ( void *unused )
s_brightness_slider [ !s_current_menu_index ].curvalue = s_brightness_slider [ s_current_menu_index ].curvalue;
s_ref_list [ !s_current_menu_index ].curvalue = s_ref_list [ s_current_menu_index ].curvalue;
/* invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */
gamma = ( 0.8 - ( s_brightness_slider [ s_current_menu_index ].curvalue / 10.0 - 0.5 ) ) + 0.5;
Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
Cvar_SetValue( "vid_fullscreen", s_fs_box [ s_current_menu_index ].curvalue );
Cvar_SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue );

View file

@ -532,16 +532,8 @@ FS_FCloseFile(fileHandle_t f)
int
Developer_searchpath(int who)
{
int ch;
fsSearchPath_t *search;
if (who == 1) /* xatrix */
ch = 'x';
else if (who == 2) /* rogue */
ch = 'r';
for (search = fs_searchPaths; search; search = search->next)
{
if (strstr(search->path, "xatrix"))

View file

@ -273,7 +273,6 @@ qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
{
unsigned sequence, sequence_ack;
unsigned reliable_ack, reliable_message;
int qport;
/* get sequence numbers */
MSG_BeginReading (msg);
@ -282,7 +281,7 @@ qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
/* read the qport if we are a server */
if (chan->sock == NS_SERVER)
qport = MSG_ReadShort (msg);
(void)MSG_ReadShort(msg);
reliable_message = sequence >> 31;
reliable_ack = sequence_ack >> 31;

View file

@ -34,7 +34,6 @@ UpdateChaseCam(edict_t *ent)
vec3_t forward, right;
trace_t trace;
int i;
vec3_t oldgoal;
vec3_t angles;
if (!ent)
@ -60,7 +59,6 @@ UpdateChaseCam(edict_t *ent)
targ = ent->client->chase_target;
VectorCopy(targ->s.origin, ownerv);
VectorCopy(ent->s.origin, oldgoal);
ownerv[2] += targ->viewheight;

View file

@ -571,10 +571,7 @@ plat_blocked(edict_t *self, edict_t *other)
if (other)
{
/* Hack for entity without it's origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
@ -1608,10 +1605,7 @@ door_blocked(edict_t *self, edict_t *other)
if (other)
{
/* Hack for entitiy without their origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
@ -2136,10 +2130,7 @@ train_blocked(edict_t *self, edict_t *other)
if (other)
{
/* Hack for entity without an origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}
@ -2836,10 +2827,7 @@ door_secret_blocked(edict_t *self, edict_t *other)
if (other)
{
/* Hack for entities without their origin near the model */
vec3_t save;
VectorCopy(other->s.origin,save);
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
BecomeExplosion1(other);
}

View file

@ -578,7 +578,6 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
{
int i, e;
edict_t *check, *block;
vec3_t mins, maxs;
pushed_t *p;
vec3_t org, org2, move2, forward, right, up;
vec3_t realmins, realmaxs;
@ -607,13 +606,6 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
move[i] = 0.125 * (int)temp;
}
/* find the bounding box */
for (i = 0; i < 3; i++)
{
mins[i] = pusher->absmin[i] + move[i];
maxs[i] = pusher->absmax[i] + move[i];
}
/* we need this for pushing things later */
VectorSubtract(vec3_origin, amove, org);
AngleVectors(org, forward, right, up);

View file

@ -629,26 +629,11 @@ SP_target_spawner(edict_t *self)
void
use_target_blaster(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
int effect;
if (!self)
{
return;
}
if (self->spawnflags & 2)
{
effect = 0;
}
else if (self->spawnflags & 1)
{
effect = EF_HYPERBLASTER;
}
else
{
effect = EF_BLASTER;
}
fire_blaster(self, self->s.origin, self->movedir, self->dmg,
self->speed, EF_BLASTER, MOD_TARGET_BLASTER);
gi.sound(self, CHAN_VOICE, self->noise_index, 1, ATTN_NORM, 0);

View file

@ -674,7 +674,6 @@ Boss2_CheckAttack(edict_t *self)
vec3_t temp;
float chance;
trace_t tr;
qboolean enemy_infront;
int enemy_range;
float enemy_yaw;
@ -702,7 +701,6 @@ Boss2_CheckAttack(edict_t *self)
}
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract(self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);

View file

@ -726,17 +726,11 @@ jorg_firebullet(edict_t *self)
void
jorg_attack(edict_t *self)
{
vec3_t vec;
float range;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
range = VectorLength(vec);
if (random() <= 0.75)
{
gi.sound(self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM, 0);

View file

@ -797,8 +797,6 @@ makron_sight(edict_t *self, edict_t *other /* unused */)
void
makron_attack(edict_t *self)
{
vec3_t vec;
float range;
float r;
if (!self)
@ -808,9 +806,6 @@ makron_attack(edict_t *self)
r = random();
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
range = VectorLength(vec);
if (r <= 0.3)
{
self->monsterinfo.currentmove = &makron_move_attack3;
@ -946,7 +941,6 @@ Makron_CheckAttack(edict_t *self)
vec3_t temp;
float chance;
trace_t tr;
qboolean enemy_infront;
int enemy_range;
float enemy_yaw;
@ -974,7 +968,6 @@ Makron_CheckAttack(edict_t *self)
}
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract(self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);

View file

@ -212,7 +212,6 @@ DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
int sorted[MAX_CLIENTS];
int sortedscores[MAX_CLIENTS];
int score, total;
int picnum;
int x, y;
gclient_t *cl;
edict_t *cl_ent;
@ -272,7 +271,6 @@ DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
cl = &game.clients[sorted[i]];
cl_ent = g_edicts + 1 + sorted[i];
picnum = gi.imageindex("i_fixme");
x = (i >= 6) ? 160 : 0;
y = 32 + 32 * (i % 6);

View file

@ -315,7 +315,6 @@ R_LightPoint ( vec3_t p, vec3_t color )
float r;
int lnum;
dlight_t *dl;
float light;
vec3_t dist;
float add;
@ -341,7 +340,6 @@ R_LightPoint ( vec3_t p, vec3_t color )
}
/* add dynamic lights */
light = 0;
dl = r_newrefdef.dlights;
for ( lnum = 0; lnum < r_newrefdef.num_dlights; lnum++, dl++ )
@ -477,7 +475,6 @@ R_BuildLightMap ( msurface_t *surf, byte *dest, int stride )
float scale [ 4 ];
int nummaps;
float *bl;
lightstyle_t *style;
if ( surf->texinfo->flags & ( SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP ) )
{
@ -496,19 +493,11 @@ R_BuildLightMap ( msurface_t *surf, byte *dest, int stride )
/* set to full bright if no light data */
if ( !surf->samples )
{
int maps;
for ( i = 0; i < size * 3; i++ )
{
s_blocklights [ i ] = 255;
}
for ( maps = 0; maps < MAXLIGHTMAPS && surf->styles [ maps ] != 255;
maps++ )
{
style = &r_newrefdef.lightstyles [ surf->styles [ maps ] ];
}
goto store;
}

View file

@ -146,7 +146,6 @@ LM_BuildPolygonFromSurface ( msurface_t *fa )
{
int i, lindex, lnumverts;
medge_t *pedges, *r_pedge;
int vertpage;
float *vec;
float s, t;
glpoly_t *poly;
@ -155,7 +154,6 @@ LM_BuildPolygonFromSurface ( msurface_t *fa )
/* reconstruct the polygon */
pedges = currentmodel->edges;
lnumverts = fa->numedges;
vertpage = 0;
VectorClear( total );

View file

@ -294,23 +294,14 @@ R_DrawAliasFrameLerp ( dmdl_t *paliashdr, float backlerp )
void
R_DrawAliasShadow ( dmdl_t *paliashdr, int posenum )
{
dtrivertx_t *verts;
int *order;
vec3_t point;
float height, lheight;
int count;
daliasframe_t *frame;
lheight = currententity->origin [ 2 ] - lightspot [ 2 ];
frame = (daliasframe_t *) ( (byte *) paliashdr + paliashdr->ofs_frames
+ currententity->frame * paliashdr->framesize );
verts = frame->verts;
height = 0;
order = (int *) ( (byte *) paliashdr + paliashdr->ofs_glcmds );
height = -lheight + 0.1f;
/* stencilbuffer shadows */

View file

@ -403,9 +403,6 @@ SV_AreaEdicts_r ( areanode_t *node )
{
link_t *l, *next, *start;
edict_t *check;
int count;
count = 0;
/* touch linked edicts */
if ( area_type == AREA_SOLID )

View file

@ -269,7 +269,6 @@ NET_BaseAdrToString(netadr_t a)
static char s[64], tmp[64];
struct sockaddr_storage ss;
struct sockaddr_in6 *s6;
int flags;
switch (a.type)
{
@ -308,15 +307,12 @@ NET_BaseAdrToString(netadr_t a)
memcpy(&s6->sin6_addr, a.ip, sizeof(struct in6_addr));
}
flags = NI_NUMERICHOST;
#ifdef __FreeBSD__
if (getnameinfo((struct sockaddr *)&ss, ss.ss_len, s, sizeof(s),
NULL, 0, NI_NUMERICHOST))
socklen_t const salen = ss.ss_len;
#else
if (getnameinfo((struct sockaddr *)&ss, sizeof(ss), s, sizeof(s),
NULL, 0, NI_NUMERICHOST))
socklen_t const salen = sizeof(ss);
#endif
if (getnameinfo((struct sockaddr*)&ss, salen, s, sizeof(s), NULL, 0, NI_NUMERICHOST))
{
Com_sprintf(s, sizeof(s), "<invalid>");
}