From a8b188e1d5bd5ee9003f98b32b946195ded2c9a0 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Tue, 2 Aug 2016 23:16:24 +0500 Subject: [PATCH] Fix -Wshadow. --- cl_dll/ev_hldm.cpp | 7 +++---- dlls/buttons.cpp | 2 +- dlls/gauss.cpp | 2 +- dlls/monsters.cpp | 2 +- dlls/talkmonster.cpp | 6 +++--- dlls/util.cpp | 4 ++-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index a011ae4f..9787a839 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1048,7 +1048,6 @@ void EV_FireGauss( event_args_t *args ) if( !beam_tr.allsolid ) { vec3_t delta; - float n; // trace backwards to find exit point gEngfuncs.pEventAPI->EV_PlayerTrace( beam_tr.endpos, tr.endpos, PM_STUDIO_BOX, -1, &beam_tr ); @@ -1057,9 +1056,9 @@ void EV_FireGauss( event_args_t *args ) n = Length( delta ); - if(n < flDamage) + if( n < flDamage ) { - if(n == 0) + if( n == 0 ) n = 1; flDamage -= n; @@ -1443,7 +1442,7 @@ void EV_EgonFire( event_args_t *args ) if( iStartup == 1 && EV_IsLocal( idx ) && !pBeam && !pBeam2 && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction. { - vec3_t vecSrc, vecEnd, origin, angles, forward, right, up; + vec3_t vecSrc, vecEnd, angles, forward, right, up; pmtrace_t tr; cl_entity_t *pl = gEngfuncs.GetEntityByIndex( idx ); diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 15a17cf2..7b050add 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -191,7 +191,7 @@ void CMultiSource::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE if( IsTriggered( pActivator ) ) { ALERT( at_aiconsole, "Multisource %s enabled (%d inputs)\n", STRING( pev->targetname ), m_iTotal ); - USE_TYPE useType = USE_TOGGLE; + useType = USE_TOGGLE; if( m_globalstate ) useType = USE_ON; SUB_UseTargets( NULL, useType, 0 ); diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index db806eb3..14aac39b 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -469,7 +469,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) // trace backwards to find exit point UTIL_TraceLine( beam_tr.vecEndPos, tr.vecEndPos, dont_ignore_monsters, pentIgnore, &beam_tr ); - float n = (beam_tr.vecEndPos - tr.vecEndPos).Length( ); + n = ( beam_tr.vecEndPos - tr.vecEndPos ).Length(); if( n < flDamage ) { diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 631eddd5..d034abd6 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -1074,7 +1074,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) { // distance to enemy's feet vecEnemyPos.z -= pEnemy->pev->size.z; - float flDistToEnemy2 = ( vecEnemyPos - pev->origin ).Length(); + flDistToEnemy2 = ( vecEnemyPos - pev->origin ).Length(); if( flDistToEnemy2 < flDistToEnemy ) flDistToEnemy = flDistToEnemy2; } diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index a370b949..a0a52f52 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -466,12 +466,12 @@ void CTalkMonster::StartTask( Task_t *pTask ) void CTalkMonster::RunTask( Task_t *pTask ) { + edict_t *pPlayer; + switch( pTask->iTask ) { case TASK_TLK_CLIENT_STARE: case TASK_TLK_LOOK_AT_CLIENT: - edict_t *pPlayer; - // track head to the client for a while. if( m_MonsterState == MONSTERSTATE_IDLE && !IsMoving() && @@ -517,7 +517,7 @@ void CTalkMonster::RunTask( Task_t *pTask ) case TASK_FACE_PLAYER: { // Get edict for one player - edict_t *pPlayer = g_engfuncs.pfnPEntityOfEntIndex( 1 ); + pPlayer = g_engfuncs.pfnPEntityOfEntIndex( 1 ); if( pPlayer ) { diff --git a/dlls/util.cpp b/dlls/util.cpp index 825e5241..47eaf2f8 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1794,7 +1794,7 @@ void CSave::WriteFloat( const char *pname, const float *data, int count ) void CSave::WriteTime( const char *pname, const float *data, int count ) { int i; - Vector tmp, input; + //Vector tmp, input; BufferHeader( pname, sizeof(float) * count ); for( i = 0; i < count; i++ ) @@ -1871,7 +1871,7 @@ void CSave::WritePositionVector( const char *pname, const Vector &value ) void CSave::WritePositionVector( const char *pname, const float *value, int count ) { int i; - Vector tmp, input; + //Vector tmp, input; BufferHeader( pname, sizeof(float) * 3 * count ); for( i = 0; i < count; i++ )