The big NULL replacement party part 4.
...okay, not as big of a commit.
This commit is contained in:
+4
-4
@@ -532,7 +532,7 @@ const ulg crc_table[256] = {
|
||||
|
||||
ulg crc32(ulg crc, const uch *buf, size_t len)
|
||||
{
|
||||
if (buf==NULL) return 0L;
|
||||
if (buf== nullptr) return 0L;
|
||||
crc = crc ^ 0xffffffffL;
|
||||
while (len >= 8) {DO8(buf); len -= 8;}
|
||||
if (len) do {DO1(buf);} while (--len);
|
||||
@@ -935,12 +935,12 @@ ZRESULT TZip::Add(const TCHAR *odstzn, const TCHAR *src,unsigned long flags)
|
||||
// Keep a copy of the zipfileinfo, for our end-of-zip directory
|
||||
char *cextra = new char[zfi.cext]; memcpy(cextra,zfi.cextra,zfi.cext); zfi.cextra=cextra;
|
||||
TZipFileInfo *pzfi = new TZipFileInfo; memcpy(pzfi,&zfi,sizeof(zfi));
|
||||
if (zfis==NULL)
|
||||
if (zfis== nullptr)
|
||||
zfis=pzfi;
|
||||
else
|
||||
{
|
||||
TZipFileInfo *z=zfis;
|
||||
while (z->nxt!=NULL)
|
||||
while (z->nxt!= nullptr)
|
||||
z=z->nxt;
|
||||
z->nxt=pzfi;
|
||||
}
|
||||
@@ -954,7 +954,7 @@ ZRESULT TZip::AddCentral()
|
||||
ulg pos_at_start_of_central = writ;
|
||||
//ulg tot_unc_size=0, tot_compressed_size=0;
|
||||
bool okay=true;
|
||||
for (TZipFileInfo *zfi=zfis; zfi!=NULL; )
|
||||
for (TZipFileInfo *zfi=zfis; zfi!= nullptr; )
|
||||
{
|
||||
if (okay)
|
||||
{
|
||||
|
||||
+6
-6
@@ -755,14 +755,14 @@ public:
|
||||
static int GetText( T* p, lua_State *L ) { lua_pushstring(L, p->m_sText ); return 1; }
|
||||
static int GetIndex( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iIndex ); return 1; }
|
||||
static int GetMultiPlayer( T* p, lua_State *L ) { lua_pushnumber(L, p->m_MultiPlayer); return 1; }
|
||||
static int GetStyle( T* p, lua_State *L ) { if(p->m_pStyle==NULL) lua_pushnil(L); else {Style *pStyle = (Style*)p->m_pStyle; pStyle->PushSelf(L);} return 1; }
|
||||
static int GetStyle( T* p, lua_State *L ) { if(p->m_pStyle== nullptr) lua_pushnil(L); else {Style *pStyle = (Style*)p->m_pStyle; pStyle->PushSelf(L);} return 1; }
|
||||
static int GetScreen( T* p, lua_State *L ) { lua_pushstring(L, p->m_sScreen ); return 1; }
|
||||
static int GetProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sProfileID ); return 1; }
|
||||
static int GetSong( T* p, lua_State *L ) { if(p->m_pSong==NULL) lua_pushnil(L); else p->m_pSong->PushSelf(L); return 1; }
|
||||
static int GetSteps( T* p, lua_State *L ) { if(p->m_pSteps==NULL) lua_pushnil(L); else p->m_pSteps->PushSelf(L); return 1; }
|
||||
static int GetCourse( T* p, lua_State *L ) { if(p->m_pCourse==NULL) lua_pushnil(L); else p->m_pCourse->PushSelf(L); return 1; }
|
||||
static int GetTrail( T* p, lua_State *L ) { if(p->m_pTrail==NULL) lua_pushnil(L); else p->m_pTrail->PushSelf(L); return 1; }
|
||||
static int GetCharacter( T* p, lua_State *L ) { if(p->m_pCharacter==NULL) lua_pushnil(L); else p->m_pCharacter->PushSelf(L); return 1; }
|
||||
static int GetSong( T* p, lua_State *L ) { if(p->m_pSong== nullptr) lua_pushnil(L); else p->m_pSong->PushSelf(L); return 1; }
|
||||
static int GetSteps( T* p, lua_State *L ) { if(p->m_pSteps== nullptr) lua_pushnil(L); else p->m_pSteps->PushSelf(L); return 1; }
|
||||
static int GetCourse( T* p, lua_State *L ) { if(p->m_pCourse== nullptr) lua_pushnil(L); else p->m_pCourse->PushSelf(L); return 1; }
|
||||
static int GetTrail( T* p, lua_State *L ) { if(p->m_pTrail== nullptr) lua_pushnil(L); else p->m_pTrail->PushSelf(L); return 1; }
|
||||
static int GetCharacter( T* p, lua_State *L ) { if(p->m_pCharacter== nullptr) lua_pushnil(L); else p->m_pCharacter->PushSelf(L); return 1; }
|
||||
static int GetSongGroup( T* p, lua_State *L ) { lua_pushstring(L, p->m_sSongGroup ); return 1; }
|
||||
static int GetUrl( T* p, lua_State *L ) { lua_pushstring(L, p->m_sUrl ); return 1; }
|
||||
static int GetAnnouncer( T* p, lua_State *L ) { lua_pushstring(L, p->m_sAnnouncer ); return 1; }
|
||||
|
||||
@@ -338,11 +338,11 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
|
||||
Steps * tSteps;
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
ctr = uint8_t(ctr+tSteps->GetMeter()*16);
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
ctr = uint8_t( ctr+tSteps->GetMeter() );
|
||||
|
||||
m_packet.Write1( ctr );
|
||||
@@ -350,11 +350,11 @@ void NetworkSyncManager::StartRequest( short position )
|
||||
ctr=0;
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_1) )
|
||||
ctr = uint8_t( ctr + (int)tSteps->GetDifficulty()*16 );
|
||||
|
||||
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||
if( tSteps!=NULL && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
if( tSteps!= nullptr && GAMESTATE->IsPlayerEnabled(PLAYER_2) )
|
||||
ctr = uint8_t( ctr + (int)tSteps->GetDifficulty() );
|
||||
|
||||
m_packet.Write1( ctr );
|
||||
|
||||
+1
-1
@@ -799,7 +799,7 @@ void Player::Update( float fDeltaTime )
|
||||
|
||||
//LOG->Trace( "Player::Update(%f)", fDeltaTime );
|
||||
|
||||
if( GAMESTATE->m_pCurSong==NULL || IsOniDead() )
|
||||
if( GAMESTATE->m_pCurSong== nullptr || IsOniDead() )
|
||||
return;
|
||||
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
|
||||
+1
-1
@@ -772,7 +772,7 @@ void Profile::IncrementCategoryPlayCount( StepsType st, RankingCategory rc )
|
||||
#define WARN_AND_BREAK_M(m) { WARN_M(m); break; }
|
||||
#define LOAD_NODE(X) { \
|
||||
const XNode* X = xml->GetChild(#X); \
|
||||
if( X==NULL ) LOG->Warn("Failed to read section " #X); \
|
||||
if( X== nullptr ) LOG->Warn("Failed to read section " #X); \
|
||||
else Load##X##FromNode(X); }
|
||||
|
||||
ProfileLoadResult Profile::LoadAllFromDir( RString sDir, bool bRequireSignature )
|
||||
|
||||
+1
-1
@@ -757,7 +757,7 @@ void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
||||
|
||||
RString Sprite::GetTexturePath() const
|
||||
{
|
||||
if( m_pTexture==NULL )
|
||||
if( m_pTexture== nullptr )
|
||||
return RString();
|
||||
|
||||
return m_pTexture->GetID().filename;
|
||||
|
||||
+2
-2
@@ -98,14 +98,14 @@ public:
|
||||
const XNodeValue *GetAttr( const RString &sAttrName ) const;
|
||||
XNodeValue *GetAttr( const RString &sAttrName );
|
||||
template <typename T>
|
||||
bool GetAttrValue( const RString &sName, T &out ) const { const XNodeValue *pAttr=GetAttr(sName); if(pAttr==NULL) return false; pAttr->GetValue(out); return true; }
|
||||
bool GetAttrValue( const RString &sName, T &out ) const { const XNodeValue *pAttr=GetAttr(sName); if(pAttr== nullptr) return false; pAttr->GetValue(out); return true; }
|
||||
bool PushAttrValue( lua_State *L, const RString &sName ) const;
|
||||
|
||||
// in one level child nodes
|
||||
const XNode *GetChild( const RString &sName ) const;
|
||||
XNode *GetChild( const RString &sName );
|
||||
template <typename T>
|
||||
bool GetChildValue( const RString &sName, T &out ) const { const XNode *pChild=GetChild(sName); if(pChild==NULL) return false; pChild->GetTextValue(out); return true; }
|
||||
bool GetChildValue( const RString &sName, T &out ) const { const XNode *pChild=GetChild(sName); if(pChild== nullptr) return false; pChild->GetTextValue(out); return true; }
|
||||
bool PushChildValue( lua_State *L, const RString &sName ) const;
|
||||
|
||||
// modify DOM
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID )
|
||||
RString Driver;
|
||||
RageMovieTexture *ret = NULL;
|
||||
|
||||
for( unsigned i=0; ret==NULL && i<DriversToTry.size(); ++i )
|
||||
for( unsigned i=0; ret== nullptr && i<DriversToTry.size(); ++i )
|
||||
{
|
||||
Driver = DriversToTry[i];
|
||||
LOG->Trace( "Initializing driver: %s", Driver.c_str() );
|
||||
|
||||
Reference in New Issue
Block a user