The big NULL replacement party part 1.

This is meant to be a safer alternative since
NULL can often be 0. Let's not rely on that.

And yes, I know this is a lot of files. This is
a safer thing to do in big commits vs for loops.
This commit is contained in:
Jason Felds
2013-05-03 23:01:54 -04:00
parent b22a3bd3c4
commit 9f24627bf9
167 changed files with 31932 additions and 31932 deletions
+7 -7
View File
@@ -114,12 +114,12 @@ void ProfileManager::Init()
{
RString sCharacterID = FIXED_PROFILE_CHARACTER_ID( i );
Character *pCharacter = CHARMAN->GetCharacterFromID( sCharacterID );
ASSERT_M( pCharacter != NULL, sCharacterID );
ASSERT_M( pCharacter != nullptr, sCharacterID );
RString sProfileID;
bool b = CreateLocalProfile( pCharacter->GetDisplayName(), sProfileID );
ASSERT( b );
Profile* pProfile = GetLocalProfile( sProfileID );
ASSERT_M( pProfile != NULL, sProfileID );
ASSERT_M( pProfile != nullptr, sProfileID );
pProfile->m_sCharacterID = sCharacterID;
SaveLocalProfile( sProfileID );
}
@@ -341,7 +341,7 @@ bool ProfileManager::SaveProfile( PlayerNumber pn ) const
bool ProfileManager::SaveLocalProfile( RString sProfileID )
{
const Profile *pProfile = GetLocalProfile( sProfileID );
ASSERT( pProfile != NULL );
ASSERT( pProfile != nullptr );
RString sDir = LocalProfileIDToDir( sProfileID );
bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData );
return b;
@@ -473,7 +473,7 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName )
ASSERT( !sProfileID.empty() );
Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID );
ASSERT( pProfile != NULL );
ASSERT( pProfile != nullptr );
pProfile->m_sDisplayName = sNewName;
RString sProfileDir = LocalProfileIDToDir( sProfileID );
@@ -483,7 +483,7 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName )
bool ProfileManager::DeleteLocalProfile( RString sProfileID )
{
Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID );
ASSERT( pProfile != NULL );
ASSERT( pProfile != nullptr );
RString sProfileDir = LocalProfileIDToDir( sProfileID );
// flush directory cache in an attempt to get this working
@@ -821,7 +821,7 @@ class LunaProfileManager: public Luna<ProfileManager>
{
public:
static int IsPersistentProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsPersistentProfile(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); Profile* pP = p->GetProfile(pn); ASSERT(pP != NULL); pP->PushSelf(L); return 1; }
static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); Profile* pP = p->GetProfile(pn); ASSERT(pP != nullptr); pP->PushSelf(L); return 1; }
static int GetMachineProfile( T* p, lua_State *L ) { p->GetMachineProfile()->PushSelf(L); return 1; }
static int SaveMachineProfile( T* p, lua_State * ) { p->SaveMachineProfile(); return 0; }
static int GetLocalProfile( T* p, lua_State *L )
@@ -833,7 +833,7 @@ public:
lua_pushnil(L);
return 1;
}
static int GetLocalProfileFromIndex( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfileFromIndex(IArg(1)); ASSERT(pProfile != NULL); pProfile->PushSelf(L); return 1; }
static int GetLocalProfileFromIndex( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfileFromIndex(IArg(1)); ASSERT(pProfile != nullptr); pProfile->PushSelf(L); return 1; }
static int GetLocalProfileIDFromIndex( T* p, lua_State *L ) { lua_pushstring(L, p->GetLocalProfileIDFromIndex(IArg(1)) ); return 1; }
static int GetLocalProfileIndexFromID( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLocalProfileIndexFromID(SArg(1)) ); return 1; }
static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; }