diff --git a/mp/src/game/server/hl2/combine_mine.cpp b/mp/src/game/server/hl2/combine_mine.cpp index 6d49f94e0..d3e40b565 100644 --- a/mp/src/game/server/hl2/combine_mine.cpp +++ b/mp/src/game/server/hl2/combine_mine.cpp @@ -244,7 +244,7 @@ int CBounceBomb::DrawDebugTextOverlays(void) if (m_debugOverlays & OVERLAY_TEXT_BIT) { char tempstr[512]; - Q_snprintf(tempstr,sizeof(tempstr), pszMineStateNames[m_iMineState] ); + Q_snprintf(tempstr,sizeof(tempstr), "%s", pszMineStateNames[m_iMineState] ); EntityText(text_offset,tempstr,0); text_offset++; } diff --git a/mp/src/game/server/hl2/grenade_bugbait.cpp b/mp/src/game/server/hl2/grenade_bugbait.cpp index 68364db79..b9d5b75b7 100644 --- a/mp/src/game/server/hl2/grenade_bugbait.cpp +++ b/mp/src/game/server/hl2/grenade_bugbait.cpp @@ -165,7 +165,7 @@ void CGrenadeBugBait::BugBaitTouch( CBaseEntity *pOther ) pSporeExplosion->SetLocalOrigin( GetAbsOrigin() ); pSporeExplosion->m_flSpawnRate = 8.0f; pSporeExplosion->m_flParticleLifetime = 2.0f; - pSporeExplosion->SetRenderColor( 0.0f, 0.5f, 0.25f, 0.15f ); + pSporeExplosion->SetRenderColor( 0, 128, 64, 38 ); pSporeExplosion->m_flStartSize = 32.0f; pSporeExplosion->m_flEndSize = 64.0f; diff --git a/mp/src/game/server/hl2/npc_metropolice.cpp b/mp/src/game/server/hl2/npc_metropolice.cpp index f87b473b5..6a43b131c 100644 --- a/mp/src/game/server/hl2/npc_metropolice.cpp +++ b/mp/src/game/server/hl2/npc_metropolice.cpp @@ -1675,7 +1675,7 @@ float CNPC_MetroPolice::AimBurstAtReactionTime( float flReactionTime, float flDi #define AIM_AT_SHOT_SPEED_COUNT 6 #define AIM_AT_SHOT_DIST_COUNT 6 -static int s_pShotCountFraction[AIM_AT_TIME_DIST_COUNT][AIM_AT_TIME_SPEED_COUNT] = +static float s_pShotCountFraction[AIM_AT_TIME_DIST_COUNT][AIM_AT_TIME_SPEED_COUNT] = { { 3.0f, 3.0f, 2.5f, 1.5f, 1.0f, 0.0f }, { 3.0f, 3.0f, 2.5f, 1.25f, 0.5f, 0.0f }, diff --git a/mp/src/game/server/hl2/weapon_bugbait.cpp b/mp/src/game/server/hl2/weapon_bugbait.cpp index cff59bb19..9678cfb6a 100644 --- a/mp/src/game/server/hl2/weapon_bugbait.cpp +++ b/mp/src/game/server/hl2/weapon_bugbait.cpp @@ -168,7 +168,7 @@ void CWeaponBugBait::Drop( const Vector &vecVelocity ) pSporeExplosion->m_flSpawnRate = 16.0f; pSporeExplosion->m_flParticleLifetime = 0.5f; - pSporeExplosion->SetRenderColor( 0.0f, 0.5f, 0.25f, 0.15f ); + pSporeExplosion->SetRenderColor( 0, 128, 64, 38 ); pSporeExplosion->m_flStartSize = 32; pSporeExplosion->m_flEndSize = 48; diff --git a/mp/src/game/shared/GameStats.cpp b/mp/src/game/shared/GameStats.cpp index 3571827dc..3c0b48f18 100644 --- a/mp/src/game/shared/GameStats.cpp +++ b/mp/src/game/shared/GameStats.cpp @@ -867,7 +867,7 @@ void CBaseGameStats_Driver::LevelInitPreEntity() if ( crcInput[0] && crcInput[1] ) { CRC32_t crc = CRC32_ProcessSingleBuffer( crcInput, sizeof( crcInput ) ); - Q_snprintf( s_szPseudoUniqueID, ARRAYSIZE( s_szPseudoUniqueID ), "H:%x", crc ); + Q_snprintf( s_szPseudoUniqueID, ARRAYSIZE( s_szPseudoUniqueID ), "H:%lx", crc ); } } } diff --git a/mp/src/game/shared/beam_shared.h b/mp/src/game/shared/beam_shared.h index 4dc169933..54e7b756c 100644 --- a/mp/src/game/shared/beam_shared.h +++ b/mp/src/game/shared/beam_shared.h @@ -101,7 +101,7 @@ public: void SetColor( int r, int g, int b ); void SetBrightness( int brightness ); void SetFrame( float frame ); - void SetScrollRate( int speed ); + void SetScrollRate( float speed ); void SetFireTime( float flFireTime ); void SetFrameRate( float flFrameRate ) { m_flFrameRate = flFrameRate; } @@ -351,7 +351,7 @@ inline void CBeam::SetFrame( float frame ) m_fStartFrame = frame; } -inline void CBeam::SetScrollRate( int speed ) +inline void CBeam::SetScrollRate( float speed ) { m_fSpeed = speed; } diff --git a/mp/src/game/shared/voice_status.cpp b/mp/src/game/shared/voice_status.cpp index 4d2957138..48f89ac89 100644 --- a/mp/src/game/shared/voice_status.cpp +++ b/mp/src/game/shared/voice_status.cpp @@ -434,8 +434,8 @@ void CVoiceStatus::HandleVoiceMaskMsg(bf_read &msg) if( voice_clientdebug.GetInt()) { Msg("CVoiceStatus::HandleVoiceMaskMsg\n"); - Msg(" - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw)); - Msg(" - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw)); + Msg(" - m_AudiblePlayers[%lu] = %u\n", dw, m_AudiblePlayers.GetDWord(dw)); + Msg(" - m_ServerBannedPlayers[%lu] = %u\n", dw, m_ServerBannedPlayers.GetDWord(dw)); } } diff --git a/mp/src/public/bone_setup.cpp b/mp/src/public/bone_setup.cpp index b8033c498..31fb49650 100644 --- a/mp/src/public/bone_setup.cpp +++ b/mp/src/public/bone_setup.cpp @@ -57,7 +57,9 @@ public: { p = new T[MAXSTUDIOBONES]; if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 ) + { DebuggerBreak(); + } } return p; diff --git a/mp/src/public/dt_common.h b/mp/src/public/dt_common.h index d899ee80f..d4a90f48a 100644 --- a/mp/src/public/dt_common.h +++ b/mp/src/public/dt_common.h @@ -143,7 +143,7 @@ public: switch ( m_Type ) { case DPT_Int : - Q_snprintf( text, sizeof(text), "%i", m_Int ); + Q_snprintf( text, sizeof(text), "%li", m_Int ); break; case DPT_Float : Q_snprintf( text, sizeof(text), "%.3f", m_Float ); diff --git a/mp/src/public/tier0/dbg.h b/mp/src/public/tier0/dbg.h index c1f8794e1..2faa26a59 100644 --- a/mp/src/public/tier0/dbg.h +++ b/mp/src/public/tier0/dbg.h @@ -253,9 +253,13 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent(); if ( ret == SPEW_DEBUGGER) \ { \ if ( !ShouldUseNewAssertDialog() || DoNewAssertDialog( __TFILE__, __LINE__, _msg ) ) \ + { \ DebuggerBreak(); \ + } \ if ( _bFatal ) \ + { \ _ExitOnFatalAssert( __TFILE__, __LINE__ ); \ + } \ } \ } \ } while (0) diff --git a/mp/src/public/tier0/platform.h b/mp/src/public/tier0/platform.h index 914cd39a3..5b3a501d4 100644 --- a/mp/src/public/tier0/platform.h +++ b/mp/src/public/tier0/platform.h @@ -661,6 +661,7 @@ typedef void * HINSTANCE; #ifdef OSX #pragma GCC diagnostic ignored "-Wconversion-null" // passing NULL to non-pointer argument 1 #pragma GCC diagnostic ignored "-Wnull-arithmetic" // NULL used in arithmetic. Ie, vpanel == NULL where VPANEL is uint. +#pragma GCC diagnostic ignored "-Wswitch" // enumeration values not handled in switch #pragma GCC diagnostic ignored "-Wswitch-enum" // enumeration values not handled in switch #endif diff --git a/sp/src/game/server/ai_networkmanager.cpp b/sp/src/game/server/ai_networkmanager.cpp index 953e2884c..d851051f0 100644 --- a/sp/src/game/server/ai_networkmanager.cpp +++ b/sp/src/game/server/ai_networkmanager.cpp @@ -48,7 +48,7 @@ inline void DebugConnectMsg( int node1, int node2, const char *pszFormat, ... ) Q_vsnprintf( string, sizeof(string), pszFormat, argptr ); va_end( argptr ); - DevMsg( string ); + DevMsg( "%s", string ); } } diff --git a/sp/src/game/server/hl2/combine_mine.cpp b/sp/src/game/server/hl2/combine_mine.cpp index 6d49f94e0..d3e40b565 100644 --- a/sp/src/game/server/hl2/combine_mine.cpp +++ b/sp/src/game/server/hl2/combine_mine.cpp @@ -244,7 +244,7 @@ int CBounceBomb::DrawDebugTextOverlays(void) if (m_debugOverlays & OVERLAY_TEXT_BIT) { char tempstr[512]; - Q_snprintf(tempstr,sizeof(tempstr), pszMineStateNames[m_iMineState] ); + Q_snprintf(tempstr,sizeof(tempstr), "%s", pszMineStateNames[m_iMineState] ); EntityText(text_offset,tempstr,0); text_offset++; } diff --git a/sp/src/game/server/hl2/grenade_bugbait.cpp b/sp/src/game/server/hl2/grenade_bugbait.cpp index 68364db79..b9d5b75b7 100644 --- a/sp/src/game/server/hl2/grenade_bugbait.cpp +++ b/sp/src/game/server/hl2/grenade_bugbait.cpp @@ -165,7 +165,7 @@ void CGrenadeBugBait::BugBaitTouch( CBaseEntity *pOther ) pSporeExplosion->SetLocalOrigin( GetAbsOrigin() ); pSporeExplosion->m_flSpawnRate = 8.0f; pSporeExplosion->m_flParticleLifetime = 2.0f; - pSporeExplosion->SetRenderColor( 0.0f, 0.5f, 0.25f, 0.15f ); + pSporeExplosion->SetRenderColor( 0, 128, 64, 38 ); pSporeExplosion->m_flStartSize = 32.0f; pSporeExplosion->m_flEndSize = 64.0f; diff --git a/sp/src/game/server/hl2/npc_metropolice.cpp b/sp/src/game/server/hl2/npc_metropolice.cpp index f87b473b5..6a43b131c 100644 --- a/sp/src/game/server/hl2/npc_metropolice.cpp +++ b/sp/src/game/server/hl2/npc_metropolice.cpp @@ -1675,7 +1675,7 @@ float CNPC_MetroPolice::AimBurstAtReactionTime( float flReactionTime, float flDi #define AIM_AT_SHOT_SPEED_COUNT 6 #define AIM_AT_SHOT_DIST_COUNT 6 -static int s_pShotCountFraction[AIM_AT_TIME_DIST_COUNT][AIM_AT_TIME_SPEED_COUNT] = +static float s_pShotCountFraction[AIM_AT_TIME_DIST_COUNT][AIM_AT_TIME_SPEED_COUNT] = { { 3.0f, 3.0f, 2.5f, 1.5f, 1.0f, 0.0f }, { 3.0f, 3.0f, 2.5f, 1.25f, 0.5f, 0.0f }, diff --git a/sp/src/game/server/hl2/weapon_bugbait.cpp b/sp/src/game/server/hl2/weapon_bugbait.cpp index cff59bb19..9678cfb6a 100644 --- a/sp/src/game/server/hl2/weapon_bugbait.cpp +++ b/sp/src/game/server/hl2/weapon_bugbait.cpp @@ -168,7 +168,7 @@ void CWeaponBugBait::Drop( const Vector &vecVelocity ) pSporeExplosion->m_flSpawnRate = 16.0f; pSporeExplosion->m_flParticleLifetime = 0.5f; - pSporeExplosion->SetRenderColor( 0.0f, 0.5f, 0.25f, 0.15f ); + pSporeExplosion->SetRenderColor( 0, 128, 64, 38 ); pSporeExplosion->m_flStartSize = 32; pSporeExplosion->m_flEndSize = 48; diff --git a/sp/src/game/shared/GameStats.cpp b/sp/src/game/shared/GameStats.cpp index 3571827dc..3c0b48f18 100644 --- a/sp/src/game/shared/GameStats.cpp +++ b/sp/src/game/shared/GameStats.cpp @@ -867,7 +867,7 @@ void CBaseGameStats_Driver::LevelInitPreEntity() if ( crcInput[0] && crcInput[1] ) { CRC32_t crc = CRC32_ProcessSingleBuffer( crcInput, sizeof( crcInput ) ); - Q_snprintf( s_szPseudoUniqueID, ARRAYSIZE( s_szPseudoUniqueID ), "H:%x", crc ); + Q_snprintf( s_szPseudoUniqueID, ARRAYSIZE( s_szPseudoUniqueID ), "H:%lx", crc ); } } } diff --git a/sp/src/game/shared/beam_shared.h b/sp/src/game/shared/beam_shared.h index 4dc169933..54e7b756c 100644 --- a/sp/src/game/shared/beam_shared.h +++ b/sp/src/game/shared/beam_shared.h @@ -101,7 +101,7 @@ public: void SetColor( int r, int g, int b ); void SetBrightness( int brightness ); void SetFrame( float frame ); - void SetScrollRate( int speed ); + void SetScrollRate( float speed ); void SetFireTime( float flFireTime ); void SetFrameRate( float flFrameRate ) { m_flFrameRate = flFrameRate; } @@ -351,7 +351,7 @@ inline void CBeam::SetFrame( float frame ) m_fStartFrame = frame; } -inline void CBeam::SetScrollRate( int speed ) +inline void CBeam::SetScrollRate( float speed ) { m_fSpeed = speed; } diff --git a/sp/src/game/shared/voice_status.cpp b/sp/src/game/shared/voice_status.cpp index 4d2957138..48f89ac89 100644 --- a/sp/src/game/shared/voice_status.cpp +++ b/sp/src/game/shared/voice_status.cpp @@ -434,8 +434,8 @@ void CVoiceStatus::HandleVoiceMaskMsg(bf_read &msg) if( voice_clientdebug.GetInt()) { Msg("CVoiceStatus::HandleVoiceMaskMsg\n"); - Msg(" - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw)); - Msg(" - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw)); + Msg(" - m_AudiblePlayers[%lu] = %u\n", dw, m_AudiblePlayers.GetDWord(dw)); + Msg(" - m_ServerBannedPlayers[%lu] = %u\n", dw, m_ServerBannedPlayers.GetDWord(dw)); } } diff --git a/sp/src/public/bone_setup.cpp b/sp/src/public/bone_setup.cpp index b8033c498..31fb49650 100644 --- a/sp/src/public/bone_setup.cpp +++ b/sp/src/public/bone_setup.cpp @@ -57,7 +57,9 @@ public: { p = new T[MAXSTUDIOBONES]; if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 ) + { DebuggerBreak(); + } } return p; diff --git a/sp/src/public/dt_common.h b/sp/src/public/dt_common.h index e1d00ae43..082522f97 100644 --- a/sp/src/public/dt_common.h +++ b/sp/src/public/dt_common.h @@ -143,7 +143,7 @@ public: switch ( m_Type ) { case DPT_Int : - Q_snprintf( text, sizeof(text), "%ld", m_Int ); + Q_snprintf( text, sizeof(text), "%li", m_Int ); break; case DPT_Float : Q_snprintf( text, sizeof(text), "%.3f", m_Float ); diff --git a/sp/src/public/tier0/dbg.h b/sp/src/public/tier0/dbg.h index c1f8794e1..2faa26a59 100644 --- a/sp/src/public/tier0/dbg.h +++ b/sp/src/public/tier0/dbg.h @@ -253,9 +253,13 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent(); if ( ret == SPEW_DEBUGGER) \ { \ if ( !ShouldUseNewAssertDialog() || DoNewAssertDialog( __TFILE__, __LINE__, _msg ) ) \ + { \ DebuggerBreak(); \ + } \ if ( _bFatal ) \ + { \ _ExitOnFatalAssert( __TFILE__, __LINE__ ); \ + } \ } \ } \ } while (0) diff --git a/sp/src/public/tier0/platform.h b/sp/src/public/tier0/platform.h index 914cd39a3..5b3a501d4 100644 --- a/sp/src/public/tier0/platform.h +++ b/sp/src/public/tier0/platform.h @@ -661,6 +661,7 @@ typedef void * HINSTANCE; #ifdef OSX #pragma GCC diagnostic ignored "-Wconversion-null" // passing NULL to non-pointer argument 1 #pragma GCC diagnostic ignored "-Wnull-arithmetic" // NULL used in arithmetic. Ie, vpanel == NULL where VPANEL is uint. +#pragma GCC diagnostic ignored "-Wswitch" // enumeration values not handled in switch #pragma GCC diagnostic ignored "-Wswitch-enum" // enumeration values not handled in switch #endif