From ddafaa790eabc300997bf8ee61ed6519b546f62d Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 20 Jun 2022 14:17:53 +0300 Subject: [PATCH] game: fix compilation problems for clang --- game/client/particlemgr.cpp | 2 +- game/server/hl2/npc_playercompanion.cpp | 2 +- game/server/portal/portal_player.cpp | 2 +- game/shared/hl2/survival_gamerules.cpp | 4 ++-- game/shared/portal/portal_gamerules.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/game/client/particlemgr.cpp b/game/client/particlemgr.cpp index a82ff1f5..c880a415 100644 --- a/game/client/particlemgr.cpp +++ b/game/client/particlemgr.cpp @@ -1014,7 +1014,7 @@ bool CParticleEffectBinding::RecalculateBoundingBox() CEffectMaterial* CParticleEffectBinding::GetEffectMaterial( CParticleSubTexture *pSubTexture ) { // Hash the IMaterial pointer. - unsigned int index = (((intp)pSubTexture->m_pGroup) >> 6) % EFFECT_MATERIAL_HASH_SIZE; + unsigned int index = (((uintp)pSubTexture->m_pGroup) >> 6) % EFFECT_MATERIAL_HASH_SIZE; for ( CEffectMaterial *pCur=m_EffectMaterialHash[index]; pCur; pCur = pCur->m_pHashedNext ) { if ( pCur->m_pGroup == pSubTexture->m_pGroup ) diff --git a/game/server/hl2/npc_playercompanion.cpp b/game/server/hl2/npc_playercompanion.cpp index a03a752f..91217b7f 100644 --- a/game/server/hl2/npc_playercompanion.cpp +++ b/game/server/hl2/npc_playercompanion.cpp @@ -3538,7 +3538,7 @@ void CNPC_PlayerCompanion::InputClearAllOuputs( inputdata_t &inputdata ) typedescription_t *dataDesc = &dmap->dataDesc[i]; if ( ( dataDesc->fieldType == FIELD_CUSTOM ) && ( dataDesc->flags & FTYPEDESC_OUTPUT ) ) { - CBaseEntityOutput *pOutput = (CBaseEntityOutput *)((int)this + (int)dataDesc->fieldOffset[0]); + CBaseEntityOutput *pOutput = (CBaseEntityOutput *)((intp)this + (intp)dataDesc->fieldOffset[0]); pOutput->DeleteAllElements(); /* int nConnections = pOutput->NumberOfElements(); diff --git a/game/server/portal/portal_player.cpp b/game/server/portal/portal_player.cpp index a72e2e94..15dd2504 100644 --- a/game/server/portal/portal_player.cpp +++ b/game/server/portal/portal_player.cpp @@ -556,7 +556,7 @@ void CPortal_Player::UpdateExpression( void ) return; } - char const szScene[256]; + char szScene[256] = { 0 }; response->GetResponse( szScene, sizeof(szScene) ); // Ignore updates that choose the same scene diff --git a/game/shared/hl2/survival_gamerules.cpp b/game/shared/hl2/survival_gamerules.cpp index 723eeeac..f8711c51 100644 --- a/game/shared/hl2/survival_gamerules.cpp +++ b/game/shared/hl2/survival_gamerules.cpp @@ -207,7 +207,7 @@ void CHalfLife2Survival::ParseSurvivalSettings( KeyValues *pSubKey ) } else if ( !stricmp( pTestKey->GetName(), "spawnhealth" ) ) { - m_SurvivalSettings.m_iSpawnHealth = pTestKey->GetInt( NULL, 100 ); + m_SurvivalSettings.m_iSpawnHealth = pTestKey->GetInt( 0, 100 ); } else if ( !stricmp( pTestKey->GetName(), "allowedpickups" ) ) { @@ -270,4 +270,4 @@ void CHalfLife2Survival::CreateStandardEntities( void ) #endif -#endif \ No newline at end of file +#endif diff --git a/game/shared/portal/portal_gamerules.cpp b/game/shared/portal/portal_gamerules.cpp index 3143d2b6..0f238d2a 100644 --- a/game/shared/portal/portal_gamerules.cpp +++ b/game/shared/portal/portal_gamerules.cpp @@ -1265,7 +1265,7 @@ CAmmoDef *GetAmmoDef() def.AddAmmoType("Grenade", DMG_BURN, TRACER_NONE, "sk_plr_dmg_grenade", "sk_npc_dmg_grenade", "sk_max_grenade", 0, 0); def.AddAmmoType("Thumper", DMG_SONIC, TRACER_NONE, 10, 10, 2, 0, 0 ); def.AddAmmoType("Gravity", DMG_CLUB, TRACER_NONE, 0, 0, 8, 0, 0 ); - def.AddAmmoType("Battery", DMG_CLUB, TRACER_NONE, NULL, NULL, NULL, 0, 0 ); + def.AddAmmoType("Battery", DMG_CLUB, TRACER_NONE, 0, 0, 0, 0, 0 ); def.AddAmmoType("GaussEnergy", DMG_SHOCK, TRACER_NONE, "sk_jeep_gauss_damage", "sk_jeep_gauss_damage", "sk_max_gauss_round", BULLET_IMPULSE(650, 8000), 0 ); // hit like a 10kg weight at 400 in/s def.AddAmmoType("CombineCannon", DMG_BULLET, TRACER_LINE, "sk_npc_dmg_gunship_to_plr", "sk_npc_dmg_gunship", NULL, 1.5 * 750 * 12, 0 ); // hit like a 1.5kg weight at 750 ft/s def.AddAmmoType("AirboatGun", DMG_AIRBOAT, TRACER_LINE, "sk_plr_dmg_airboat", "sk_npc_dmg_airboat", NULL, BULLET_IMPULSE(10, 600), 0 );