mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2024-11-23 20:32:21 +00:00
Eliminated some warnings in mathlib and tier0.
This commit is contained in:
parent
823818305d
commit
8b4b6f93e4
6 changed files with 80 additions and 80 deletions
|
@ -77,7 +77,7 @@ public:
|
|||
private:
|
||||
unsigned int mOldValues;
|
||||
#else
|
||||
FPExceptionEnabler(unsigned int enableBits = 0)
|
||||
FPExceptionEnabler(unsigned int /*enableBits*/ = 0)
|
||||
{
|
||||
}
|
||||
~FPExceptionEnabler()
|
||||
|
@ -204,8 +204,8 @@ public:
|
|||
{
|
||||
m_Plane[i].normal = vecNormal;
|
||||
m_Plane[i].dist = dist;
|
||||
m_Plane[i].type = nType;
|
||||
m_Plane[i].signbits = SignbitsForPlane( &m_Plane[i] );
|
||||
m_Plane[i].type = static_cast<byte>(nType);
|
||||
m_Plane[i].signbits = static_cast<byte>(SignbitsForPlane( &m_Plane[i] ));
|
||||
m_AbsNormal[i].Init( fabs(vecNormal.x), fabs(vecNormal.y), fabs(vecNormal.z) );
|
||||
}
|
||||
|
||||
|
@ -1717,7 +1717,7 @@ void Parabolic_Spline_NormalizeX(
|
|||
FORCEINLINE float QuinticInterpolatingPolynomial(float t)
|
||||
{
|
||||
// 6t^5-15t^4+10t^3
|
||||
return t * t * t *( t * ( t* 6.0 - 15.0 ) + 10.0 );
|
||||
return static_cast<float>(t * t * t *( t * ( t* 6.0 - 15.0 ) + 10.0 ));
|
||||
}
|
||||
|
||||
// given a table of sorted tabulated positions, return the two indices and blendfactor to linear
|
||||
|
@ -2013,13 +2013,13 @@ FORCEINLINE float * UnpackNormal_UBYTE4( const unsigned int *pPackedNormal, floa
|
|||
unsigned char cX, cY;
|
||||
if ( bIsTangent )
|
||||
{
|
||||
cX = *pPackedNormal >> 16; // Unpack Z
|
||||
cY = *pPackedNormal >> 24; // Unpack W
|
||||
cX = static_cast<unsigned char>(*pPackedNormal >> 16); // Unpack Z
|
||||
cY = static_cast<unsigned char>(*pPackedNormal >> 24); // Unpack W
|
||||
}
|
||||
else
|
||||
{
|
||||
cX = *pPackedNormal >> 0; // Unpack X
|
||||
cY = *pPackedNormal >> 8; // Unpack Y
|
||||
cX = static_cast<unsigned char>(*pPackedNormal >> 0); // Unpack X
|
||||
cY = static_cast<unsigned char>(*pPackedNormal >> 8); // Unpack Y
|
||||
}
|
||||
|
||||
float x = cX - 128.0f;
|
||||
|
|
|
@ -869,10 +869,10 @@ FORCEINLINE ShortVector& ShortVector::operator-=(const ShortVector& v)
|
|||
|
||||
FORCEINLINE ShortVector& ShortVector::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x *= static_cast<short>(fl);
|
||||
y *= static_cast<short>(fl);
|
||||
z *= static_cast<short>(fl);
|
||||
w *= static_cast<short>(fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -889,10 +889,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(float fl)
|
|||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x *= static_cast<short>(oofl);
|
||||
y *= static_cast<short>(oofl);
|
||||
z *= static_cast<short>(oofl);
|
||||
w *= static_cast<short>(oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -909,10 +909,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(const ShortVector& v)
|
|||
FORCEINLINE void ShortVectorMultiply( const ShortVector& src, float fl, ShortVector& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = src.x * static_cast<short>(fl);
|
||||
res.y = src.y * static_cast<short>(fl);
|
||||
res.z = src.z * static_cast<short>(fl);
|
||||
res.w = src.w * static_cast<short>(fl);
|
||||
}
|
||||
|
||||
FORCEINLINE ShortVector ShortVector::operator*(float fl) const
|
||||
|
@ -1019,10 +1019,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator-=(const IntVector4D& v)
|
|||
|
||||
FORCEINLINE IntVector4D& IntVector4D::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x *= static_cast<int>(fl);
|
||||
y *= static_cast<int>(fl);
|
||||
z *= static_cast<int>(fl);
|
||||
w *= static_cast<int>(fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1039,10 +1039,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(float fl)
|
|||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x *= static_cast<int>(oofl);
|
||||
y *= static_cast<int>(oofl);
|
||||
z *= static_cast<int>(oofl);
|
||||
w *= static_cast<int>(oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1059,10 +1059,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(const IntVector4D& v)
|
|||
FORCEINLINE void IntVector4DMultiply( const IntVector4D& src, float fl, IntVector4D& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = src.x * static_cast<int>(fl);
|
||||
res.y = src.y * static_cast<int>(fl);
|
||||
res.z = src.z * static_cast<int>(fl);
|
||||
res.w = src.w * static_cast<int>(fl);
|
||||
}
|
||||
|
||||
FORCEINLINE IntVector4D IntVector4D::operator*(float fl) const
|
||||
|
@ -1487,28 +1487,28 @@ inline Vector RandomVector( float minVal, float maxVal )
|
|||
// Helper debugging stuff....
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline bool operator==( float const* f, const Vector& v )
|
||||
inline bool operator==( float const* /*f*/, const Vector& /*v*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator==( const Vector& v, float const* f )
|
||||
inline bool operator==( const Vector& /*v*/, float const* /*f*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator!=( float const* f, const Vector& v )
|
||||
inline bool operator!=( float const* /*f*/, const Vector& /*v*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator!=( const Vector& v, float const* f )
|
||||
inline bool operator!=( const Vector& /*v*/, float const* /*f*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
|
|
|
@ -244,7 +244,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
#else
|
||||
#define _AssertMsg( _exp, _msg, _executeExp, _bFatal ) \
|
||||
do { \
|
||||
if (!(_exp)) \
|
||||
if (0, !(_exp)) \
|
||||
{ \
|
||||
_SpewInfo( SPEW_ASSERT, __TFILE__, __LINE__ ); \
|
||||
SpewRetval_t ret = _SpewMessage("%s", _msg); \
|
||||
|
@ -254,11 +254,11 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
{ \
|
||||
if ( !ShouldUseNewAssertDialog() || DoNewAssertDialog( __TFILE__, __LINE__, _msg ) ) \
|
||||
DebuggerBreak(); \
|
||||
if ( _bFatal ) \
|
||||
if ( 0, _bFatal ) \
|
||||
_ExitOnFatalAssert( __TFILE__, __LINE__ ); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
} while (0,0)
|
||||
|
||||
#define _AssertMsgOnce( _exp, _msg, _bFatal ) \
|
||||
do { \
|
||||
|
@ -267,7 +267,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
{ \
|
||||
_AssertMsg( _exp, _msg, (fAsserted = true), _bFatal ); \
|
||||
} \
|
||||
} while (0)
|
||||
} while (0,0)
|
||||
#endif
|
||||
|
||||
/* Spew macros... */
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
private:
|
||||
unsigned int mOldValues;
|
||||
#else
|
||||
FPExceptionEnabler(unsigned int enableBits = 0)
|
||||
FPExceptionEnabler(unsigned int /*enableBits*/ = 0)
|
||||
{
|
||||
}
|
||||
~FPExceptionEnabler()
|
||||
|
@ -204,8 +204,8 @@ public:
|
|||
{
|
||||
m_Plane[i].normal = vecNormal;
|
||||
m_Plane[i].dist = dist;
|
||||
m_Plane[i].type = nType;
|
||||
m_Plane[i].signbits = SignbitsForPlane( &m_Plane[i] );
|
||||
m_Plane[i].type = static_cast<byte>(nType);
|
||||
m_Plane[i].signbits = static_cast<byte>(SignbitsForPlane( &m_Plane[i] ));
|
||||
m_AbsNormal[i].Init( fabs(vecNormal.x), fabs(vecNormal.y), fabs(vecNormal.z) );
|
||||
}
|
||||
|
||||
|
@ -1717,7 +1717,7 @@ void Parabolic_Spline_NormalizeX(
|
|||
FORCEINLINE float QuinticInterpolatingPolynomial(float t)
|
||||
{
|
||||
// 6t^5-15t^4+10t^3
|
||||
return t * t * t *( t * ( t* 6.0 - 15.0 ) + 10.0 );
|
||||
return static_cast<float>(t * t * t *( t * ( t* 6.0 - 15.0 ) + 10.0 ));
|
||||
}
|
||||
|
||||
// given a table of sorted tabulated positions, return the two indices and blendfactor to linear
|
||||
|
@ -2013,13 +2013,13 @@ FORCEINLINE float * UnpackNormal_UBYTE4( const unsigned int *pPackedNormal, floa
|
|||
unsigned char cX, cY;
|
||||
if ( bIsTangent )
|
||||
{
|
||||
cX = *pPackedNormal >> 16; // Unpack Z
|
||||
cY = *pPackedNormal >> 24; // Unpack W
|
||||
cX = static_cast<unsigned char>(*pPackedNormal >> 16); // Unpack Z
|
||||
cY = static_cast<unsigned char>(*pPackedNormal >> 24); // Unpack W
|
||||
}
|
||||
else
|
||||
{
|
||||
cX = *pPackedNormal >> 0; // Unpack X
|
||||
cY = *pPackedNormal >> 8; // Unpack Y
|
||||
cX = static_cast<unsigned char>(*pPackedNormal >> 0); // Unpack X
|
||||
cY = static_cast<unsigned char>(*pPackedNormal >> 8); // Unpack Y
|
||||
}
|
||||
|
||||
float x = cX - 128.0f;
|
||||
|
|
|
@ -869,10 +869,10 @@ FORCEINLINE ShortVector& ShortVector::operator-=(const ShortVector& v)
|
|||
|
||||
FORCEINLINE ShortVector& ShortVector::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x *= static_cast<short>(fl);
|
||||
y *= static_cast<short>(fl);
|
||||
z *= static_cast<short>(fl);
|
||||
w *= static_cast<short>(fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -889,10 +889,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(float fl)
|
|||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x *= static_cast<short>(oofl);
|
||||
y *= static_cast<short>(oofl);
|
||||
z *= static_cast<short>(oofl);
|
||||
w *= static_cast<short>(oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -909,10 +909,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(const ShortVector& v)
|
|||
FORCEINLINE void ShortVectorMultiply( const ShortVector& src, float fl, ShortVector& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = src.x * static_cast<short>(fl);
|
||||
res.y = src.y * static_cast<short>(fl);
|
||||
res.z = src.z * static_cast<short>(fl);
|
||||
res.w = src.w * static_cast<short>(fl);
|
||||
}
|
||||
|
||||
FORCEINLINE ShortVector ShortVector::operator*(float fl) const
|
||||
|
@ -1019,10 +1019,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator-=(const IntVector4D& v)
|
|||
|
||||
FORCEINLINE IntVector4D& IntVector4D::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x *= static_cast<int>(fl);
|
||||
y *= static_cast<int>(fl);
|
||||
z *= static_cast<int>(fl);
|
||||
w *= static_cast<int>(fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1039,10 +1039,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(float fl)
|
|||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x *= static_cast<int>(oofl);
|
||||
y *= static_cast<int>(oofl);
|
||||
z *= static_cast<int>(oofl);
|
||||
w *= static_cast<int>(oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1059,10 +1059,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(const IntVector4D& v)
|
|||
FORCEINLINE void IntVector4DMultiply( const IntVector4D& src, float fl, IntVector4D& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = src.x * static_cast<int>(fl);
|
||||
res.y = src.y * static_cast<int>(fl);
|
||||
res.z = src.z * static_cast<int>(fl);
|
||||
res.w = src.w * static_cast<int>(fl);
|
||||
}
|
||||
|
||||
FORCEINLINE IntVector4D IntVector4D::operator*(float fl) const
|
||||
|
@ -1487,28 +1487,28 @@ inline Vector RandomVector( float minVal, float maxVal )
|
|||
// Helper debugging stuff....
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline bool operator==( float const* f, const Vector& v )
|
||||
inline bool operator==( float const* /*f*/, const Vector& /*v*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator==( const Vector& v, float const* f )
|
||||
inline bool operator==( const Vector& /*v*/, float const* /*f*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator!=( float const* f, const Vector& v )
|
||||
inline bool operator!=( float const* /*f*/, const Vector& /*v*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator!=( const Vector& v, float const* f )
|
||||
inline bool operator!=( const Vector& /*v*/, float const* /*f*/ )
|
||||
{
|
||||
// AIIIEEEE!!!!
|
||||
Assert(0);
|
||||
|
|
|
@ -244,7 +244,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
#else
|
||||
#define _AssertMsg( _exp, _msg, _executeExp, _bFatal ) \
|
||||
do { \
|
||||
if (!(_exp)) \
|
||||
if (0, !(_exp)) \
|
||||
{ \
|
||||
_SpewInfo( SPEW_ASSERT, __TFILE__, __LINE__ ); \
|
||||
SpewRetval_t ret = _SpewMessage("%s", _msg); \
|
||||
|
@ -254,11 +254,11 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
{ \
|
||||
if ( !ShouldUseNewAssertDialog() || DoNewAssertDialog( __TFILE__, __LINE__, _msg ) ) \
|
||||
DebuggerBreak(); \
|
||||
if ( _bFatal ) \
|
||||
if ( 0, _bFatal ) \
|
||||
_ExitOnFatalAssert( __TFILE__, __LINE__ ); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
} while (0,0)
|
||||
|
||||
#define _AssertMsgOnce( _exp, _msg, _bFatal ) \
|
||||
do { \
|
||||
|
@ -267,7 +267,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
|||
{ \
|
||||
_AssertMsg( _exp, _msg, (fAsserted = true), _bFatal ); \
|
||||
} \
|
||||
} while (0)
|
||||
} while (0,0)
|
||||
#endif
|
||||
|
||||
/* Spew macros... */
|
||||
|
|
Loading…
Reference in a new issue