Browse Source

fix null comparison

pull/85/head
HappyDOGE 2 years ago
parent
commit
733dc35479
  1. 10
      tier0/memdbg.cpp

10
tier0/memdbg.cpp

@ -887,7 +887,7 @@ void *CDbgMemAlloc::Expand_NoLongerSupported( void *pMem, size_t nSize )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CDbgMemAlloc::PushAllocDbgInfo( const char *pFileName, int nLine ) void CDbgMemAlloc::PushAllocDbgInfo( const char *pFileName, int nLine )
{ {
if ( g_DbgInfoStack == NULL ) if ( g_DbgInfoStack == (void*)NULL )
{ {
g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH );
g_nDbgInfoStackDepth = -1; g_nDbgInfoStackDepth = -1;
@ -901,7 +901,7 @@ void CDbgMemAlloc::PushAllocDbgInfo( const char *pFileName, int nLine )
void CDbgMemAlloc::PopAllocDbgInfo() void CDbgMemAlloc::PopAllocDbgInfo()
{ {
if ( g_DbgInfoStack == NULL ) if ( g_DbgInfoStack == (void*)NULL )
{ {
g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH );
g_nDbgInfoStackDepth = -1; g_nDbgInfoStackDepth = -1;
@ -922,7 +922,7 @@ uint32 CDbgMemAlloc::GetDebugInfoSize()
void CDbgMemAlloc::SaveDebugInfo( void *pvDebugInfo ) void CDbgMemAlloc::SaveDebugInfo( void *pvDebugInfo )
{ {
if ( g_DbgInfoStack == NULL ) if ( g_DbgInfoStack == (void*)NULL )
{ {
g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH );
g_nDbgInfoStackDepth = -1; g_nDbgInfoStackDepth = -1;
@ -935,7 +935,7 @@ void CDbgMemAlloc::SaveDebugInfo( void *pvDebugInfo )
void CDbgMemAlloc::RestoreDebugInfo( const void *pvDebugInfo ) void CDbgMemAlloc::RestoreDebugInfo( const void *pvDebugInfo )
{ {
if ( g_DbgInfoStack == NULL ) if ( g_DbgInfoStack == (void*)NULL )
{ {
g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH );
g_nDbgInfoStackDepth = -1; g_nDbgInfoStackDepth = -1;
@ -976,7 +976,7 @@ void CDbgMemAlloc::GetActualDbgInfo( const char *&pFileName, int &nLine )
return; return;
#endif #endif
if ( g_DbgInfoStack == NULL ) if ( g_DbgInfoStack == (void*)NULL )
{ {
g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH );
g_nDbgInfoStackDepth = -1; g_nDbgInfoStackDepth = -1;

Loading…
Cancel
Save