The big NULL replacement party part 3.
Getting there I think.
This commit is contained in:
@@ -217,7 +217,7 @@ static const char *osx_find_link_edit( const struct mach_header *header )
|
||||
return (char *) ( scmd->vmaddr - scmd->fileoff );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BacktraceNames::FromAddr( const void *p )
|
||||
|
||||
@@ -119,9 +119,9 @@ static void *CreateStack( int size )
|
||||
p = (char *) mmap( NULL, size+PageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 );
|
||||
|
||||
if( p == (void *) -1 )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
// if( posix_memalign( (void**) &p, PageSize, RealSize ) != 0 )
|
||||
// return NULL;
|
||||
// return nullptr;
|
||||
|
||||
if( find_stack_direction() < 0 )
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ static const char *LookupException( DWORD code )
|
||||
if( exceptions[i].code == code )
|
||||
return exceptions[i].name;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static CrashInfo g_CrashInfo;
|
||||
@@ -154,13 +154,13 @@ static const char *CrashGetModuleBaseName(HMODULE hmod, char *pszBaseName)
|
||||
|
||||
__try {
|
||||
if( !GetModuleFileName(hmod, szPath1, sizeof(szPath1)) )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
char *pszFile;
|
||||
DWORD dw = GetFullPathName( szPath1, sizeof(szPath2), szPath2, &pszFile );
|
||||
|
||||
if( !dw || dw > sizeof(szPath2) )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
strcpy( pszBaseName, pszFile );
|
||||
|
||||
@@ -174,7 +174,7 @@ static const char *CrashGetModuleBaseName(HMODULE hmod, char *pszBaseName)
|
||||
if( period )
|
||||
*period = 0;
|
||||
} __except(1) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pszBaseName;
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace SymbolLookup
|
||||
pSymbol->MaxNameLen = sizeof(buffer) - sizeof(SYMBOL_INFO) + 1;
|
||||
|
||||
if( !SymFromAddr(g_hParent, ptr, &disp, pSymbol) )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return pSymbol;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ NetworkStream *CreateNetworkStream()
|
||||
WSADATA WSAData;
|
||||
WORD iVersionRequested = MAKEWORD(2,0);
|
||||
if( WSAStartup(iVersionRequested, &WSAData) != 0 )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new NetworkStream_Win32;
|
||||
|
||||
@@ -36,14 +36,14 @@ static bool GetRegKeyType( const RString &sIn, RString &sOut, HKEY &key )
|
||||
}
|
||||
|
||||
/* Given a full key, eg. "HKEY_LOCAL_MACHINE\hardware\foo", open it and return it.
|
||||
* On error, return NULL. */
|
||||
* On error, return nullptr. */
|
||||
enum RegKeyMode { READ, WRITE };
|
||||
static HKEY OpenRegKey( const RString &sKey, RegKeyMode mode, bool bWarnOnError = true )
|
||||
{
|
||||
RString sSubkey;
|
||||
HKEY hType;
|
||||
if( !GetRegKeyType(sKey, sSubkey, hType) )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
HKEY hRetKey;
|
||||
LONG retval = RegOpenKeyEx( hType, sSubkey, 0, (mode==READ) ? KEY_READ:KEY_WRITE, &hRetKey );
|
||||
@@ -51,7 +51,7 @@ static HKEY OpenRegKey( const RString &sKey, RegKeyMode mode, bool bWarnOnError
|
||||
{
|
||||
if( bWarnOnError )
|
||||
LOG->Warn( werr_ssprintf(retval, "RegOpenKeyEx(%x,%s) error", hType, sSubkey.c_str()) );
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return hRetKey;
|
||||
@@ -196,7 +196,7 @@ bool RegistryAccess::CreateKey( const RString &sKey )
|
||||
RString sSubkey;
|
||||
HKEY hType;
|
||||
if( !GetRegKeyType(sKey, sSubkey, hType) )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
HKEY hKey;
|
||||
DWORD dwDisposition = 0;
|
||||
|
||||
@@ -83,7 +83,7 @@ HICON IconFromSurface( const RageSurface *pSrcImg )
|
||||
if( icon == nullptr )
|
||||
{
|
||||
LOG->Trace( "%s", werr_ssprintf( GetLastError(), "CreateIconFromResourceEx" ).c_str() );
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return icon;
|
||||
@@ -96,7 +96,7 @@ HICON IconFromFile( const RString &sIconFile )
|
||||
if( pImg == nullptr )
|
||||
{
|
||||
LOG->Warn( "Couldn't open icon \"%s\": %s", sIconFile.c_str(), sError.c_str() );
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
HICON icon = IconFromSurface( pImg );
|
||||
|
||||
Reference in New Issue
Block a user