Skip to content

Commit b23dd57

Browse files
committed
Replaced _isnan with std::isnan
1 parent f699277 commit b23dd57

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

Client/game_sa/CEntitySA.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ class CEntitySA : public virtual CEntity
339339

340340
inline bool IsValidPosition ( const CVector& vec )
341341
{
342-
if ( vec.fX < -16000 || vec.fX > 16000 || _isnan ( vec.fX )
343-
|| vec.fY < -16000 || vec.fY > 16000 || _isnan ( vec.fY )
344-
|| vec.fZ < -5000 || vec.fZ > 100000 || _isnan ( vec.fZ ) )
342+
if ( vec.fX < -16000 || vec.fX > 16000 || std::isnan ( vec.fX )
343+
|| vec.fY < -16000 || vec.fY > 16000 || std::isnan ( vec.fY )
344+
|| vec.fZ < -5000 || vec.fZ > 100000 || std::isnan ( vec.fZ ) )
345345
return false;
346346
return true;
347347
}

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,9 +2593,9 @@ bool CClientGame::ProcessMessageForCursorEvents ( HWND hwnd, UINT uMsg, WPARAM w
25932593
}
25942594
if ( szButton && szState )
25952595
{
2596-
if ( _isnan( vecCollision.fX ) ) vecCollision.fX = 0;
2597-
if ( _isnan( vecCollision.fY ) ) vecCollision.fY = 0;
2598-
if ( _isnan( vecCollision.fZ ) ) vecCollision.fZ = 0;
2596+
if ( std::isnan( vecCollision.fX ) ) vecCollision.fX = 0;
2597+
if ( std::isnan( vecCollision.fY ) ) vecCollision.fY = 0;
2598+
if ( std::isnan( vecCollision.fZ ) ) vecCollision.fZ = 0;
25992599

26002600
// Call the event for the client
26012601
CLuaArguments Arguments;

Client/mods/deathmatch/logic/CClientSpatialDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void CClientSpatialDatabaseImpl::FlushUpdateQueue ( void )
214214
bool CClientSpatialDatabaseImpl::IsValidSphere ( const CSphere& sphere )
215215
{
216216
// Check for nan
217-
if ( _isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
217+
if ( std::isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
218218
return false;
219219

220220
// Check radius within limits

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5597,7 +5597,7 @@ void _cdecl CheckMatrix ( float* pMatrix )
55975597
for ( uint i = 12 ; i < 15 ; i++ )
55985598
{
55995599
float f = pMatrix[i];
5600-
if ( f < -10 || f > 10 || _isnan( f ) )
5600+
if ( f < -10 || f > 10 || std::isnan( f ) )
56015601
bFix = true;
56025602
}
56035603
}

Server/mods/deathmatch/logic/CCameraSpatialDatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void CCameraSpatialDatabaseImpl::FlushUpdateQueue ( void )
217217
bool CCameraSpatialDatabaseImpl::IsValidSphere ( const CSphere& sphere )
218218
{
219219
// Check for nan
220-
if ( _isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
220+
if ( std::isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
221221
return false;
222222

223223
// Check radius within limits
@@ -230,4 +230,4 @@ bool CCameraSpatialDatabaseImpl::IsValidSphere ( const CSphere& sphere )
230230
return false;
231231

232232
return true;
233-
}
233+
}

Server/mods/deathmatch/logic/CSpatialDatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void CSpatialDatabaseImpl::FlushUpdateQueue ( void )
214214
bool CSpatialDatabaseImpl::IsValidSphere ( const CSphere& sphere )
215215
{
216216
// Check for nan
217-
if ( _isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
217+
if ( std::isnan ( sphere.fRadius + sphere.vecPosition.fX + sphere.vecPosition.fY + sphere.vecPosition.fZ ) )
218218
return false;
219219

220220
// Check radius within limits
@@ -227,4 +227,4 @@ bool CSpatialDatabaseImpl::IsValidSphere ( const CSphere& sphere )
227227
return false;
228228

229229
return true;
230-
}
230+
}

Shared/sdk/SharedUtil.Defines.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
STRNCPY( tempname, src, maxsize );
9494

9595
#ifndef _MSC_VER
96-
#define _isnan isnan
9796
#define wcsicmp wcscasecmp
9897
#endif
9998

Shared/sdk/net/SyncStructures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct SFloatSync : public ISyncStructure
5151
double dValue = data.fValue;
5252
#ifdef WIN32
5353
#ifdef MTA_DEBUG
54-
assert ( !_isnan ( dValue ) );
54+
assert ( !std::isnan ( dValue ) );
5555
#endif
5656
#endif
5757
dValue = Clamp < double > ( limitsMin, dValue, limitsMax );

0 commit comments

Comments
 (0)