diff --git a/src/game/client/beamdraw.cpp b/src/game/client/beamdraw.cpp index 006eacd34..bd45babbe 100644 --- a/src/game/client/beamdraw.cpp +++ b/src/game/client/beamdraw.cpp @@ -832,8 +832,8 @@ void DrawSplineSegs( int noise_divisions, float *prgNoise, } else if ( flags & FBEAM_SHADEOUT ) { - float fadeFraction = fadeLength/length; - brightness = 1.0 - (fraction/fadeFraction); + float outFadeFraction = fadeLength/length; + brightness = 1.0 - (fraction/outFadeFraction); if (brightness < 0) { brightness = 0; diff --git a/src/game/client/c_effects.cpp b/src/game/client/c_effects.cpp index c5a10491f..158a40a5c 100644 --- a/src/game/client/c_effects.cpp +++ b/src/game/client/c_effects.cpp @@ -2280,11 +2280,11 @@ void CSnowFallManager::FindSnowVolumes( Vector &vecCenter, float flRadius, Vecto { for ( iSnow = 0; iSnow < m_nActiveSnowCount; ++iSnow ) { - Vector vecCenter, vecMin, vecMax; - vecCenter = ( m_aSnow[iSnow].m_vecMin, m_aSnow[iSnow].m_vecMax ) * 0.5; - vecMin = m_aSnow[iSnow].m_vecMin - vecCenter; - vecMax = m_aSnow[iSnow].m_vecMax - vecCenter; - debugoverlay->AddBoxOverlay( vecCenter, vecMin, vecMax, QAngle( 0, 0, 0 ), 200, 0, 0, 25, r_SnowDebugBox.GetFloat() ); + Vector vecCenterDbg, vecMin, vecMax; + vecCenterDbg = ( m_aSnow[iSnow].m_vecMin, m_aSnow[iSnow].m_vecMax ) * 0.5; + vecMin = m_aSnow[iSnow].m_vecMin - vecCenterDbg; + vecMax = m_aSnow[iSnow].m_vecMax - vecCenterDbg; + debugoverlay->AddBoxOverlay( vecCenterDbg, vecMin, vecMax, QAngle( 0, 0, 0 ), 200, 0, 0, 25, r_SnowDebugBox.GetFloat() ); } } #endif diff --git a/src/game/client/c_entitydissolve.cpp b/src/game/client/c_entitydissolve.cpp index 3e4d2b3cc..b687d76d6 100644 --- a/src/game/client/c_entitydissolve.cpp +++ b/src/game/client/c_entitydissolve.cpp @@ -200,7 +200,7 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4 // Make a couple of tries at it int iTries = -1; - Vector vecForward; + Vector vecRandForward; trace_t tr; do { @@ -211,20 +211,20 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4 { QAngle vecTemp = vecAngles; vecTemp[YAW] += flYawOffset; - AngleVectors( vecTemp, &vecForward ); + AngleVectors( vecTemp, &vecRandForward ); // Randomly angle it up or down - vecForward.z = RandomFloat( -1, 1 ); + vecRandForward.z = RandomFloat( -1, 1 ); } else { - vecForward = RandomVector( -1, 1 ); + vecRandForward = RandomVector( -1, 1 ); } - UTIL_TraceLine( vecOrigin, vecOrigin + (vecForward * 192), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr ); + UTIL_TraceLine( vecOrigin, vecOrigin + (vecRandForward * 192), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr ); } while ( tr.fraction >= 1.0 && iTries < 3 ); - Vector vecEnd = tr.endpos - (vecForward * 8); + Vector vecRandEnd = tr.endpos - (vecRandForward * 8); // Only spark & glow if we hit something if ( tr.fraction < 1.0 ) diff --git a/src/game/client/c_smokestack.cpp b/src/game/client/c_smokestack.cpp index 5e8370b0f..231313f31 100644 --- a/src/game/client/c_smokestack.cpp +++ b/src/game/client/c_smokestack.cpp @@ -363,7 +363,8 @@ void C_SmokeStack::Update(float fTimeDelta) // Setup the twist matrix. float flTwist = (m_flTwist * (M_PI_F * 2.f) / 360.0f) * Helper_GetFrameTime(); - if( m_bTwist = !!flTwist ) + m_bTwist = !!flTwist; + if( m_bTwist ) { m_TwistMat[0][0] = cos(flTwist); m_TwistMat[0][1] = sin(flTwist); diff --git a/src/game/client/clientshadowmgr.cpp b/src/game/client/clientshadowmgr.cpp index 31134b7e4..1c6120616 100644 --- a/src/game/client/clientshadowmgr.cpp +++ b/src/game/client/clientshadowmgr.cpp @@ -4695,7 +4695,6 @@ void CClientShadowMgr::UpdateProjectedTextureInternal( ClientShadowHandle_t hand VPROF_BUDGET( "CClientShadowMgr::UpdateProjectedTextureInternal", VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING ); Assert( ( shadow.m_Flags & SHADOW_FLAGS_SHADOW ) == 0 ); - ClientShadow_t& shadow = m_Shadows[handle]; shadowmgr->EnableShadow( shadow.m_ShadowHandle, true ); diff --git a/src/game/client/fx.cpp b/src/game/client/fx.cpp index e69d254b0..bcd735779 100644 --- a/src/game/client/fx.cpp +++ b/src/game/client/fx.cpp @@ -1043,7 +1043,7 @@ void FX_Tesla( const CTeslaInfo &teslaInfo ) { // Make a couple of tries at it int iTries = -1; - Vector vecForward; + Vector vecRandForward; trace_t tr; do { @@ -1054,21 +1054,21 @@ void FX_Tesla( const CTeslaInfo &teslaInfo ) { QAngle vecTemp = teslaInfo.m_vAngles; vecTemp[YAW] += anglemod( flYawOffset + ((360 / iTotalBeams) * i) ); - AngleVectors( vecTemp, &vecForward ); + AngleVectors( vecTemp, &vecRandForward ); // Randomly angle it up or down - vecForward.z = RandomFloat( -1, 1 ); + vecRandForward.z = RandomFloat( -1, 1 ); } else { - vecForward = RandomVector( -1, 1 ); + vecRandForward = RandomVector( -1, 1 ); } - VectorNormalize( vecForward ); + VectorNormalize( vecRandForward ); - UTIL_TraceLine( teslaInfo.m_vPos, teslaInfo.m_vPos + (vecForward * teslaInfo.m_flRadius), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr ); + UTIL_TraceLine( teslaInfo.m_vPos, teslaInfo.m_vPos + (vecRandForward * teslaInfo.m_flRadius), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr ); } while ( tr.fraction >= 1.0 && iTries < 3 ); - Vector vecEnd = tr.endpos - (vecForward * 8); + Vector vecRandEnd = tr.endpos - (vecRandForward * 8); // Only spark & glow if we hit something if ( tr.fraction < 1.0 ) diff --git a/src/game/client/game_controls/baseviewport.cpp b/src/game/client/game_controls/baseviewport.cpp index 278a0c0f3..ac712a7e8 100644 --- a/src/game/client/game_controls/baseviewport.cpp +++ b/src/game/client/game_controls/baseviewport.cpp @@ -831,8 +831,6 @@ void CBaseViewport::ReloadScheme(const char *fromFile) GetHud().ResetHUD(); } -extern ConVar ss_verticalsplit; - void AddSubKeyNamed( KeyValues *pKeys, const char *pszName ) { KeyValues *pNewKey = new KeyValues( pszName ); diff --git a/src/game/client/hud_lcd.cpp b/src/game/client/hud_lcd.cpp index 359c43a9f..8da4477e3 100644 --- a/src/game/client/hud_lcd.cpp +++ b/src/game/client/hud_lcd.cpp @@ -528,15 +528,15 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD { CLCDItem *newItem = NULL; - CLCDItem *item = ag->m_Definition[ r ]; - switch ( item->m_Type ) + CLCDItem *definition = ag->m_Definition[ r ]; + switch ( definition->m_Type ) { default: break; case LCDITEM_TEXT: { - CLCDItemText *text = static_cast< CLCDItemText * >( item ); + CLCDItemText *text = static_cast< CLCDItemText * >( definition ); CUtlString s; s = text->m_OriginalText; Replace( s, prefix, s1 ); @@ -551,7 +551,7 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD // text->m_OriginalText = s; - CLCDItemText *copy = static_cast< CLCDItemText * >( page->Alloc( item->m_Type ) ); + CLCDItemText *copy = static_cast< CLCDItemText * >( page->Alloc( definition->m_Type ) ); *copy = *text; copy->m_bActive = true; copy->m_OriginalText = s; @@ -564,8 +564,8 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD break; case LCDITEM_ICON: { - CLCDItemIcon *icon = static_cast< CLCDItemIcon * >( item ); - CLCDItemIcon *copy = static_cast< CLCDItemIcon * >( page->Alloc( item->m_Type ) ); + CLCDItemIcon *icon = static_cast< CLCDItemIcon * >( definition ); + CLCDItemIcon *copy = static_cast< CLCDItemIcon * >( page->Alloc( definition->m_Type ) ); *copy = *icon; copy->m_bActive = true; copy->Create( m_lcd ); diff --git a/src/game/client/ragdoll.cpp b/src/game/client/ragdoll.cpp index 9b290b3d7..824f1d46b 100644 --- a/src/game/client/ragdoll.cpp +++ b/src/game/client/ragdoll.cpp @@ -794,11 +794,11 @@ class C_ServerRagdollAttached : public C_ServerRagdoll if ( !( hdr->boneFlags( i ) & boneMask ) ) continue; - Vector pos; + Vector col; matrix3x4_t &matrix = GetBoneForWrite( i ); - MatrixGetColumn( matrix, 3, pos ); - pos += offset; - MatrixSetColumn( pos, 3, matrix ); + MatrixGetColumn( matrix, 3, col ); + col += offset; + MatrixSetColumn( col, 3, matrix ); } } void OnDataChanged( DataUpdateType_t updateType ); diff --git a/src/game/client/swarm/gameui/optionssubvideo.cpp b/src/game/client/swarm/gameui/optionssubvideo.cpp index 45a7a2798..128c5426d 100644 --- a/src/game/client/swarm/gameui/optionssubvideo.cpp +++ b/src/game/client/swarm/gameui/optionssubvideo.cpp @@ -1021,10 +1021,10 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N void COptionsSubVideo::PrepareResolutionList() { // get the currently selected resolution - char sz[256]; - m_pMode->GetText(sz, 256); + char current[256]; + m_pMode->GetText(current, 256); int currentWidth = 0, currentHeight = 0; - sscanf( sz, "%i x %i", ¤tWidth, ¤tHeight ); + sscanf( current, "%i x %i", ¤tWidth, ¤tHeight ); // Clean up before filling the info again. m_pMode->DeleteAllItems(); diff --git a/src/game/client/swarm/gameui/swarm/vmainmenu.cpp b/src/game/client/swarm/gameui/swarm/vmainmenu.cpp index 789786d58..62ace4be9 100644 --- a/src/game/client/swarm/gameui/swarm/vmainmenu.cpp +++ b/src/game/client/swarm/gameui/swarm/vmainmenu.cpp @@ -2048,6 +2048,7 @@ void MainMenu::OnHoIAFTop10ScoresDownloaded( LeaderboardScoresDownloaded_t *pPar { bool bOK = SteamUserStats()->GetDownloadedLeaderboardEntry( pParam->m_hSteamLeaderboardEntries, i, &s_HoIAFLeaderboardEntryCache[i], reinterpret_cast< int32 * >( &s_HoIAFLeaderboardDetailsCache[i] ), sizeof( s_HoIAFLeaderboardDetailsCache[i] ) / sizeof( int32 ) ); Assert( bOK ); + ( void )bOK; // suppress warning C4189: 'bOK': local variable is initialized but not referenced Assert( s_HoIAFLeaderboardEntryCache[i].m_cDetails == sizeof( s_HoIAFLeaderboardDetailsCache[i] ) / sizeof( int32 ) ); m_pTopLeaderboardEntries[i]->SetFromEntry( s_HoIAFLeaderboardEntryCache[i], s_HoIAFLeaderboardDetailsCache[i] ); diff --git a/src/game/client/swarm/rd_collections_crafting.cpp b/src/game/client/swarm/rd_collections_crafting.cpp index 953c6da4e..c8ebe0188 100644 --- a/src/game/client/swarm/rd_collections_crafting.cpp +++ b/src/game/client/swarm/rd_collections_crafting.cpp @@ -288,11 +288,11 @@ void CRD_Crafting_Item_Grid::PerformLayout() m_Items[i]->SetPos( col * eachWide, row * eachTall + yOffset ); - int up = col + ( row - 1 ) * perRow; - int down = col + ( row + 1 ) * perRow; - int left = col == 0 ? -1 : col - 1 + row * perRow; - int right = col == perRow - 1 ? -1 : col + 1 + row * perRow; - + // int up = col + ( row - 1 ) * perRow; + // int down = col + ( row + 1 ) * perRow; + // int left = col == 0 ? -1 : col - 1 + row * perRow; + // int right = col == perRow - 1 ? -1 : col + 1 + row * perRow; + // // TODO: set up navigation } } diff --git a/src/game/client/swarm/vgui/asw_hud_minimap.cpp b/src/game/client/swarm/vgui/asw_hud_minimap.cpp index f9c99a5d9..a04c563b9 100644 --- a/src/game/client/swarm/vgui/asw_hud_minimap.cpp +++ b/src/game/client/swarm/vgui/asw_hud_minimap.cpp @@ -710,7 +710,7 @@ void CASWHudMinimap::Init() for ( int i = 0; i < ASW_MAX_MAP_VERTICAL_SECTIONS; i++ ) { m_nMapTextureID[i] = -1; - m_flMapMinZ[i] = HUGE_VAL; + m_flMapMinZ[i] = FLT_MAX; } m_bHasOverview = false; m_szLastLevelName.Clear(); @@ -1805,11 +1805,11 @@ void CASWHudMinimap::SetMap( const char *levelname ) } m_nMapTextureID[i] = -1; - m_flMapMinZ[i] = HUGE_VAL; + m_flMapMinZ[i] = FLT_MAX; } m_nMapTextureID[0] = surface()->CreateNewTextureID(); - m_flMapMinZ[0] = -HUGE_VAL; + m_flMapMinZ[0] = -FLT_MAX; const RD_Mission_t *pOverview = ReactiveDropMissions::GetMission( levelname ); if ( !pOverview ) @@ -1875,7 +1875,7 @@ void CASWHudMinimap::SetMap( const char *levelname ) m_nMapTextureID[j] = m_nMapTextureID[j - 1]; } - m_flMapMinZ[iMinIndex + 1] = MIN( iMinIndex + 2 < ASW_MAX_MAP_VERTICAL_SECTIONS ? m_flMapMinZ[iMinIndex + 2] : HUGE_VAL, flMax ); + m_flMapMinZ[iMinIndex + 1] = MIN( iMinIndex + 2 < ASW_MAX_MAP_VERTICAL_SECTIONS ? m_flMapMinZ[iMinIndex + 2] : FLT_MAX, flMax ); } else if ( iMinIndex > 0 && iBlankIndex != iMinIndex && iBlankIndex + 1 < ASW_MAX_MAP_VERTICAL_SECTIONS && m_flMapMinZ[iMinIndex + 1] > flMax ) { diff --git a/src/game/client/swarm/vgui/asw_vgui_computer_frame.cpp b/src/game/client/swarm/vgui/asw_vgui_computer_frame.cpp index c6d4fdf1f..326e012f0 100644 --- a/src/game/client/swarm/vgui/asw_vgui_computer_frame.cpp +++ b/src/game/client/swarm/vgui/asw_vgui_computer_frame.cpp @@ -180,7 +180,7 @@ void CASW_VGUI_Computer_Frame::RecordComputerContents() COMPILE_TIME_ASSERT( COMPUTER_LOCKED_MAIL_2 + 1 == COMPUTER_LOCKED_MAIL_3 ); COMPILE_TIME_ASSERT( COMPUTER_LOCKED_MAIL_3 + 1 == COMPUTER_LOCKED_MAIL_4 ); - int iLockedEntries = ( pArea->m_iLockedScreens >> COMPUTER_LOCKED_MAIL_1 ) & ( 1 << 4 - 1 ); + int iLockedEntries = ( pArea->m_iLockedScreens >> COMPUTER_LOCKED_MAIL_1 ) & ( ( 1 << 4 ) - 1 ); if ( pArea->IsPDA() ) SwarmopediaRecordSeenContent( "PDA", pArea->m_MailFile.Get(), pArea->GetAbsOrigin(), pMR->GetProfileIndex(), pArea->m_PDAName.Get(), iLockedEntries ); diff --git a/src/game/client/swarm/vgui/campaignpanel.cpp b/src/game/client/swarm/vgui/campaignpanel.cpp index 06e91127d..cd06380f4 100644 --- a/src/game/client/swarm/vgui/campaignpanel.cpp +++ b/src/game/client/swarm/vgui/campaignpanel.cpp @@ -446,7 +446,7 @@ void CampaignPanel::OnThink() int x, y; m_pCurrentLocationImage->GetPos( x, y ); // location of red arrows - C_ASW_Campaign_Save *pSave = pGameResource->GetCampaignSave(); + // C_ASW_Campaign_Save *pSave = pGameResource->GetCampaignSave(); if ( pSave ) { // check if there's a timer on @@ -554,7 +554,7 @@ void CampaignPanel::OnThink() if ( !pMission ) return; - CASW_Campaign_Save *pSave = ASWGameRules()->GetCampaignSave(); + // CASW_Campaign_Save *pSave = ASWGameRules()->GetCampaignSave(); if ( !pSave ) return; diff --git a/src/game/client/swarm/vgui/holdout_hud_wave_panel.cpp b/src/game/client/swarm/vgui/holdout_hud_wave_panel.cpp index 67d5af446..3c479f986 100644 --- a/src/game/client/swarm/vgui/holdout_hud_wave_panel.cpp +++ b/src/game/client/swarm/vgui/holdout_hud_wave_panel.cpp @@ -79,10 +79,10 @@ void Holdout_Hud_Wave_Panel::OnThink() m_pCountdownTimeLabel->SetVisible( true ); m_pCountdownLabel->SetVisible( true ); - wchar_t wzValue[15]; - V_snwprintf( wzValue, ARRAYSIZE( wzValue ), L"%d", (int) flTimeLeft ); + wchar_t wzTime[15]; + V_snwprintf( wzTime, ARRAYSIZE( wzTime ), L"%d", (int) flTimeLeft ); - m_pCountdownTimeLabel->SetText( wzValue ); + m_pCountdownTimeLabel->SetText( wzTime ); } UpdateWaveProgressBar(); diff --git a/src/game/client/swarm/vgui/objectivetitlepanel.cpp b/src/game/client/swarm/vgui/objectivetitlepanel.cpp index 1a9947f01..496dc6355 100644 --- a/src/game/client/swarm/vgui/objectivetitlepanel.cpp +++ b/src/game/client/swarm/vgui/objectivetitlepanel.cpp @@ -137,11 +137,12 @@ void ObjectiveTitlePanel::UpdateElements() pTitle = m_hObjective->GetObjectiveTitle(); else { - char buffer[8]; - Q_snprintf( buffer, sizeof( buffer ), "%d", m_Index ); + // TODO: why is is unused? + char snumber[8]; + Q_snprintf( snumber, sizeof( snumber ), "%d", m_Index ); wchar_t wnumber[8]; - g_pVGuiLocalize->ConvertANSIToUnicode( buffer, wnumber, sizeof( wnumber ) ); + g_pVGuiLocalize->ConvertANSIToUnicode( snumber, wnumber, sizeof( wnumber ) ); wchar_t *pLocal = g_pVGuiLocalize->Find( "#asw_objective_titlef" ); if ( !pLocal ) diff --git a/src/game/client/videoservices/video_material.cpp b/src/game/client/videoservices/video_material.cpp index b31f2a92d..5463359af 100644 --- a/src/game/client/videoservices/video_material.cpp +++ b/src/game/client/videoservices/video_material.cpp @@ -309,7 +309,6 @@ void CVideoMaterial::CreateVideoMaterial( const char *pMaterialName ) const int tex_flags = TEXTUREFLAGS_PROCEDURAL | TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT | TEXTUREFLAGS_NOMIP | TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_SINGLECOPY; -#define ALIGN_VALUE( val, alignment ) ( ( val + alignment - 1 ) & ~( alignment - 1 ) ); m_textureWidth = ALIGN_VALUE( m_videoWidth, 8 ); m_textureHeight = ALIGN_VALUE( m_videoHeight, 8 ); diff --git a/src/game/client/view_beams.cpp b/src/game/client/view_beams.cpp index 2305713b8..c3899c65c 100644 --- a/src/game/client/view_beams.cpp +++ b/src/game/client/view_beams.cpp @@ -422,7 +422,8 @@ bool Beam_t::ShouldDraw( void ) extern bool g_bRenderingScreenshot; extern ConVar r_drawviewmodel; -int Beam_t::DrawModel( int flags, const RenderableInstance_t &instance ) +// TODO: actually implement use of passed flags inside this method? +int Beam_t::DrawModel( int iFlags, const RenderableInstance_t &instance ) { diff --git a/src/game/client/viewrender.cpp b/src/game/client/viewrender.cpp index 3f62ae5df..befc4ea19 100644 --- a/src/game/client/viewrender.cpp +++ b/src/game/client/viewrender.cpp @@ -1271,7 +1271,6 @@ void CViewRender::DrawUnderwaterOverlay( void ) UpdateRefractTexture( x, y, w, h, true ); // Now draw the entire screen using the material... - CMatRenderContextPtr pRenderContext( materials ); ITexture *pTexture = GetPowerOfTwoFrameBufferTexture( ); int sw = pTexture->GetActualWidth(); int sh = pTexture->GetActualHeight(); diff --git a/src/game/server/baseflex.cpp b/src/game/server/baseflex.cpp index 8eb299442..bf9927736 100644 --- a/src/game/server/baseflex.cpp +++ b/src/game/server/baseflex.cpp @@ -2551,12 +2551,12 @@ void CFlexCycler::Think( void ) // only do this if they have more than eyelid movement if (GetNumFlexControllers() > 2) { - const char *pszExpression = flex_expression.GetString(); + const char *pszFlexExpression = flex_expression.GetString(); - if (pszExpression && pszExpression[0] == '+' && pszExpression[1] != '\0') + if (pszFlexExpression && pszFlexExpression[0] == '+' && pszFlexExpression[1] != '\0') { int i; - int j = atoi( &pszExpression[1] ); + int j = atoi( &pszFlexExpression[1] ); for ( i = 0; i < GetNumFlexControllers(); i++) { m_flextarget[m_flexnum] = 0; @@ -2569,7 +2569,7 @@ void CFlexCycler::Think( void ) // Msg( "%s %.3f\n", predef_flexcontroller_names[i], predef_flexcontroller_values[j][i] ); } } - else if ( pszExpression && (pszExpression[0] == '1') && (pszExpression[1] == '\0') ) // 1 for maxed controller values + else if ( pszFlexExpression && (pszFlexExpression[0] == '1') && (pszFlexExpression[1] == '\0') ) // 1 for maxed controller values { for ( LocalFlexController_t i = LocalFlexController_t(0); i < GetNumFlexControllers(); i++ ) { @@ -2578,7 +2578,7 @@ void CFlexCycler::Think( void ) SetFlexWeight( i, m_flextarget[i] ); } } - else if ( pszExpression && (pszExpression[0] == '^') && (pszExpression[1] == '\0') ) // ^ for sine wave + else if ( pszFlexExpression && (pszFlexExpression[0] == '^') && (pszFlexExpression[1] == '\0') ) // ^ for sine wave { for ( LocalFlexController_t i = LocalFlexController_t(0); i < GetNumFlexControllers(); i++ ) { @@ -2588,12 +2588,12 @@ void CFlexCycler::Think( void ) SetFlexWeight( i, m_flextarget[i] ); } } - else if (pszExpression && pszExpression[0] != '\0' && strcmp(pszExpression, "+") != 0) + else if (pszFlexExpression && pszFlexExpression[0] != '\0' && strcmp(pszFlexExpression, "+") != 0) { char szExpression[128]; char szTemp[32]; - Q_strncpy( szExpression, pszExpression ,sizeof(szExpression)); + Q_strncpy( szExpression, pszFlexExpression ,sizeof(szExpression)); char *pszExpression = szExpression; while (*pszExpression != '\0') diff --git a/src/game/server/env_effectsscript.cpp b/src/game/server/env_effectsscript.cpp index face56870..e76461fc9 100644 --- a/src/game/server/env_effectsscript.cpp +++ b/src/game/server/env_effectsscript.cpp @@ -25,7 +25,7 @@ enum EffectType bool g_bUnget = false; -unsigned char *buffer; +// unsigned char *buffer; char name[ 256 ]; const char *currenttoken; int tokencount; diff --git a/src/game/server/episodic/npc_hunter.cpp b/src/game/server/episodic/npc_hunter.cpp index c5006db48..143afec69 100644 --- a/src/game/server/episodic/npc_hunter.cpp +++ b/src/game/server/episodic/npc_hunter.cpp @@ -5612,9 +5612,8 @@ int CNPC_Hunter::OnTakeDamage_Alive( const CTakeDamageInfo &info ) // don't take damage from my own weapons!!! // Exception: I "own" a magnade if it's glued to me. - CBaseEntity *pInflictor = info.GetInflictor(); CBaseEntity *pAttacker = info.GetAttacker(); - if ( pInflictor ) + if ( CBaseEntity *pInflictor = info.GetInflictor() ) { if ( IsStriderBuster( pInflictor ) ) { diff --git a/src/game/server/genericactor.cpp b/src/game/server/genericactor.cpp index 025cb51f6..334b68c02 100644 --- a/src/game/server/genericactor.cpp +++ b/src/game/server/genericactor.cpp @@ -310,12 +310,12 @@ void CFlextalkActor::ProcessSceneEvents( void ) // only do this if they have more than eyelid movement if (GetNumFlexControllers() > 2) { - const char *pszExpression = flex_expression.GetString(); + const char *pszFlexExpression = flex_expression.GetString(); - if (pszExpression && pszExpression[0] == '+' && pszExpression[1] != '\0') + if (pszFlexExpression && pszFlexExpression[0] == '+' && pszFlexExpression[1] != '\0') { int i; - int j = atoi( &pszExpression[1] ); + int j = atoi( &pszFlexExpression[1] ); for (i = 0; i < GetNumFlexControllers(); i++) { m_flextarget[m_flexnum] = 0; @@ -328,12 +328,12 @@ void CFlextalkActor::ProcessSceneEvents( void ) // Msg( "%s %.3f\n", predef_flexcontroller_names[i], predef_flexcontroller_values[j][i] ); } } - else if (pszExpression && pszExpression[0] != '\0' && strcmp(pszExpression, "+") != 0) + else if (pszFlexExpression && pszFlexExpression[0] != '\0' && strcmp(pszFlexExpression, "+") != 0) { char szExpression[128]; char szTemp[32]; - Q_strncpy( szExpression, pszExpression ,sizeof(szExpression)); + Q_strncpy( szExpression, pszFlexExpression ,sizeof(szExpression)); char *pszExpression = szExpression; while (*pszExpression != '\0') diff --git a/src/game/server/hl2/npc_attackchopper.cpp b/src/game/server/hl2/npc_attackchopper.cpp index 2499a0c00..b976e9335 100644 --- a/src/game/server/hl2/npc_attackchopper.cpp +++ b/src/game/server/hl2/npc_attackchopper.cpp @@ -3743,7 +3743,6 @@ void CNPC_AttackHelicopter::Event_Killed( const CTakeDamageInfo &info ) SetDesiredPosition( pCrashPoint->GetAbsOrigin() ); // Start the failing engine sound - CSoundEnvelopeController &controller = CSoundEnvelopeController::GetController(); controller.SoundDestroy( m_pRotorSound ); CPASAttenuationFilter filter( this ); diff --git a/src/game/server/logicentities.cpp b/src/game/server/logicentities.cpp index 8426efa8c..2284cd2f5 100644 --- a/src/game/server/logicentities.cpp +++ b/src/game/server/logicentities.cpp @@ -494,9 +494,9 @@ void CTimerEntity::InputAddToTimer( inputdata_t &inputdata ) // don't add time if the timer isn't enabled if ( m_iDisabled ) return; - + // Add time to timer - float flNextThink = GetNextThink(); + float flNextThink = GetNextThink(); SetNextThink( flNextThink += inputdata.value.Float() ); } @@ -1303,9 +1303,9 @@ void CMultiSource::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE if ( IsTriggered( pActivator ) ) { DevMsg( 2, "Multisource %s enabled (%d inputs)\n", GetDebugName(), m_iTotal ); - USE_TYPE useType = USE_TOGGLE; - if ( m_globalstate != NULL_STRING ) - useType = USE_ON; + // USE_TYPE useType = USE_TOGGLE; + // if ( m_globalstate != NULL_STRING ) + // useType = USE_ON; m_OnTrigger.FireOutput(pActivator, this); } diff --git a/src/game/server/nav_generate.cpp b/src/game/server/nav_generate.cpp index d55cc001d..3bae2851a 100644 --- a/src/game/server/nav_generate.cpp +++ b/src/game/server/nav_generate.cpp @@ -759,10 +759,10 @@ void CNavMesh::RaiseAreasWithInternalObstacles() // yes, this edge is blocked iEdgesBlocked++; // keep track of obstacle height and start and end distance for this edge - float obstacleZ = nodeFrom->GetPosition()->z + obstacleHeight; - if ( obstacleZ > obstacleZThisDir[iEdge] ) - { - obstacleZThisDir[iEdge] = obstacleZ; + float flObstacleZ = nodeFrom->GetPosition()->z + obstacleHeight; + if ( flObstacleZ > obstacleZThisDir[iEdge] ) + { + obstacleZThisDir[iEdge] = flObstacleZ; } obstacleStartDistThisDir = MIN( nodeFrom->m_obstacleStartDist[dir], obstacleStartDistThisDir ); obstacleEndDistThisDir = MAX( nodeFrom->m_obstacleEndDist[dir], obstacleEndDistThisDir ); @@ -987,8 +987,8 @@ bool CNavMesh::CreateObstacleTopAreaIfNecessary( CNavArea *area, CNavArea *areaO if ( areaOther->Contains( *nodeTowardOtherArea->GetPosition() ) ) { float z = areaOther->GetZ( nodeTowardOtherArea->GetPosition()->x, nodeTowardOtherArea->GetPosition()->y ); - float deltaZ = fabs( nodeTowardOtherArea->GetPosition()->z - z ); - if ( deltaZ < 2.0f ) + float flDeltaZ = fabs( nodeTowardOtherArea->GetPosition()->z - z ); + if ( flDeltaZ < 2.0f ) { bInOtherArea = true; } @@ -2874,8 +2874,8 @@ bool CNavMesh::TestArea( CNavNode *node, int width, int height ) CNavNode *vertNode, *horizNode; vertNode = node; - int y; - for( y=0; yGetConnectedNode( EAST ); @@ -3051,12 +3051,12 @@ bool CNavMesh::TestArea( CNavNode *node, int width, int height ) } // Check the final (x=width) node, the above only checks thru x=width-1 - if ( !CheckObstacles( horizNode, width, height, x, y ) ) + if ( !CheckObstacles( horizNode, width, height, x, y_last ) ) return false; } vertNode = node; - for( y=0; y( gEntList.FindEntityByClassname( pStartEntity, "info_player_start" ) ) ) + while (( pStartEntity = assert_cast< CBaseStart* >( gEntList.FindEntityByClassname( pStartEntity, "info_player_start" ) ) )) { if ( pStartEntity->m_bUsed ) continue; diff --git a/src/game/shared/swarm/asw_weapon_sentry_shared.cpp b/src/game/shared/swarm/asw_weapon_sentry_shared.cpp index 40111b064..6d6858901 100644 --- a/src/game/shared/swarm/asw_weapon_sentry_shared.cpp +++ b/src/game/shared/swarm/asw_weapon_sentry_shared.cpp @@ -144,7 +144,7 @@ void CASW_Weapon_Sentry::ClientThink( void ) { BaseClass::ClientThink(); - CASW_Marine *pMarine; + CASW_Marine *pOwningMarine; if ( m_hOwningMarine.Get() ) { // this means it's been removed or dropped, so destroy the display @@ -156,14 +156,14 @@ void CASW_Weapon_Sentry::ClientThink( void ) return; } - pMarine = static_cast(m_hOwningMarine.Get()); + pOwningMarine = static_cast(m_hOwningMarine.Get()); } else - pMarine = GetMarine(); + pOwningMarine = GetMarine(); - if ( pMarine ) + if ( pOwningMarine ) { - bool bSentryActive = ( pMarine->GetActiveASWWeapon() == this ); + bool bSentryActive = ( pOwningMarine->GetActiveASWWeapon() == this ); if ( bSentryActive && m_flNextDeployCheckThink < gpGlobals->curtime ) { CASW_Marine *pMarine = GetMarine(); diff --git a/src/game/shared/swarm/rd_vgui_vscript_shared.cpp b/src/game/shared/swarm/rd_vgui_vscript_shared.cpp index fd0ec477c..0d5083f67 100644 --- a/src/game/shared/swarm/rd_vgui_vscript_shared.cpp +++ b/src/game/shared/swarm/rd_vgui_vscript_shared.cpp @@ -632,6 +632,7 @@ HSCRIPT CRD_VGui_VScript::CreateButton() { int j = m_ButtonPanels.AddToTail(); Assert( i == j ); + ( void )i; // remove compiler warning C4189: 'i': local variable is initialized but not referenced m_ButtonPanels[j] = new CRD_VGui_VScript_Button_Panel( m_hButtonPanelParent, "VScriptButtonPanel", pButton ); } diff --git a/src/public/sentence.cpp b/src/public/sentence.cpp index 1c59c1ffe..8c38c07cf 100644 --- a/src/public/sentence.cpp +++ b/src/public/sentence.cpp @@ -470,7 +470,6 @@ void CSentence::ParseWords( CUtlBuffer& buf ) { char token[ 4096 ]; char word[ 256 ]; - float start, end; while ( 1 ) { @@ -481,18 +480,20 @@ void CSentence::ParseWords( CUtlBuffer& buf ) if ( stricmp( token, "WORD" ) ) break; + float wordStart, wordEnd; + buf.GetString( token ); Q_strncpy( word, token, sizeof( word ) ); buf.GetString( token ); - start = atof( token ); + wordStart = atof( token ); buf.GetString( token ); - end = atof( token ); + wordEnd = atof( token ); CWordTag *wt = new CWordTag( word ); Assert( wt ); - wt->m_flStartTime = start; - wt->m_flEndTime = end; + wt->m_flStartTime = wordStart; + wt->m_flEndTime = wordEnd; AddWordTag( wt ); diff --git a/src/public/tier1/tokenset.h b/src/public/tier1/tokenset.h index b05e3464a..12841f9ad 100644 --- a/src/public/tier1/tokenset.h +++ b/src/public/tier1/tokenset.h @@ -33,55 +33,55 @@ template struct tokenset_t { - const char *name; - _T token; + const char *m_name; + _T m_token; - _T GetToken( const char *s ) const; - _T GetTokenI( const char *s ) const; + _T GetToken( const char *name ) const; + _T GetTokenI( const char *name ) const; const char *GetNameByToken( _T token ) const; const char *GetNameByToken( _T token, const char *szMismatchResult ) const; }; template -inline _T tokenset_t< _T >::GetToken( const char *s ) const +inline _T tokenset_t< _T >::GetToken( const char *name ) const { const tokenset_t< _T > *c; - for ( c = this; c->name; ++c ) + for ( c = this; c->m_name; ++c ) { - if ( !s ) + if ( !name ) { continue; // Loop to the last NULL value } - if ( Q_strcmp( s, c->name ) == 0 ) + if ( Q_strcmp( name, c->m_name ) == 0 ) { - return c->token; + return c->m_token; } } - return c->token; // c points to the last NULL value + return c->m_token; // c points to the last NULL value } template -inline _T tokenset_t< _T >::GetTokenI( const char *s ) const +inline _T tokenset_t< _T >::GetTokenI( const char *name ) const { const tokenset_t< _T > *c; - for ( c = this; c->name; ++c ) + for ( c = this; c->m_name; ++c ) { - if ( !s ) + if ( !name ) { continue; // Loop to the last NULL value } - if ( Q_stricmp( s, c->name ) == 0 ) + if ( Q_stricmp( name, c->m_name ) == 0 ) { - return c->token; + return c->m_token; } } - return c->token; // c points to the last NULL value + return c->m_token; // c points to the last NULL value } template @@ -91,11 +91,11 @@ inline const char *tokenset_t< _T >::GetNameByToken( _T token ) const const tokenset_t< _T > *c; - for ( c = this; c->name; ++c ) + for ( c = this; c->m_name; ++c ) { - if ( c->token == token ) + if ( c->m_token == token ) { - return c->name; + return c->m_name; } } @@ -107,11 +107,11 @@ inline const char *tokenset_t< _T >::GetNameByToken( _T token, char const *szMis { const tokenset_t< _T > *c; - for ( c = this; c->name; ++c ) + for ( c = this; c->m_name; ++c ) { - if ( c->token == token ) + if ( c->m_token == token ) { - return c->name; + return c->m_name; } } diff --git a/src/public/tier1/utlsoacontainer.h b/src/public/tier1/utlsoacontainer.h index 7d3cd8954..ed6f94895 100644 --- a/src/public/tier1/utlsoacontainer.h +++ b/src/public/tier1/utlsoacontainer.h @@ -508,8 +508,8 @@ template FORCEINLINE void CSOAAttributeReference::operato { m_pContainer->AssertDataType( m_nAttributeID, ATTRDATATYPE_FLOAT ); fltx4 *pOut = m_pContainer->RowPtr( m_nAttributeID, 0 ); - fltx4 *pInA = op.m_opA.m_pContainer->RowPtr( op.m_opA.m_nAttributeID, 0 ); - fltx4 *pInB = op.m_opB.m_pContainer->RowPtr( op.m_opB.m_nAttributeID, 0 ); + fltx4 *pInA = op.m_opA.m_pContainer->template RowPtr( op.m_opA.m_nAttributeID, 0 ); + fltx4 *pInB = op.m_opB.m_pContainer->template RowPtr( op.m_opB.m_nAttributeID, 0 ); size_t nRowToRowStride = m_pContainer->RowToRowStep( m_nAttributeID ) / sizeof( fltx4 ); int nRowCtr = m_pContainer->NumRows() * m_pContainer->NumSlices(); do