Fixed various compiler warnings

Conflicts:
	sp/src/public/dt_common.h
This commit is contained in:
Yaakov 2013-06-30 17:47:57 +10:00
parent d0dda32ba1
commit b8f979fd04
18 changed files with 24 additions and 18 deletions

View file

@ -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++;
}

View file

@ -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;

View file

@ -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 },

View file

@ -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 );
}
}
}

View file

@ -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;
}

View file

@ -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));
}
}

View file

@ -57,7 +57,9 @@ public:
{
p = new T[MAXSTUDIOBONES];
if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 )
{
DebuggerBreak();
}
}
return p;

View file

@ -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 );

View file

@ -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

View file

@ -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++;
}

View file

@ -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;

View file

@ -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 },

View file

@ -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 );
}
}
}

View file

@ -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;
}

View file

@ -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));
}
}

View file

@ -57,7 +57,9 @@ public:
{
p = new T[MAXSTUDIOBONES];
if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 )
{
DebuggerBreak();
}
}
return p;

View file

@ -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 );

View file

@ -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