The big NULL replacement party part 2.

This may take a bit. Trying to do this by operator/command.
This commit is contained in:
Jason Felds
2013-05-03 23:11:42 -04:00
parent 9f24627bf9
commit ba59dd1656
174 changed files with 6644 additions and 6644 deletions
+7 -7
View File
@@ -87,7 +87,7 @@ static int get_readable_ranges( const void **starts, const void **ends, int size
while( got < size-1 )
{
char *p = (char *) memchr( file, '\n', file_used );
if( p == NULL )
if( p == nullptr )
break;
*p++ = 0;
@@ -98,13 +98,13 @@ static int get_readable_ranges( const void **starts, const void **ends, int size
/* Search for the hyphen. */
char *hyphen = strchr( line, '-' );
if( hyphen == NULL )
if( hyphen == nullptr )
continue; /* Parse error. */
/* Search for the space. */
char *space = strchr( hyphen, ' ' );
if( space == NULL )
if( space == nullptr )
continue; /* Parse error. */
/* " rwxp". If space[1] isn't 'r', then the block isn't readable. */
@@ -392,7 +392,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
InitializeBacktrace();
BacktraceContext CurrentCtx;
if( ctx == NULL )
if( ctx == nullptr )
{
ctx = &CurrentCtx;
@@ -528,7 +528,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
}
BacktraceContext CurrentCtx;
if( ctx == NULL )
if( ctx == nullptr )
{
ctx = &CurrentCtx;
@@ -649,7 +649,7 @@ void InitializeBacktrace() { }
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
BacktraceContext CurrentCtx;
if( ctx == NULL )
if( ctx == nullptr )
{
ctx = &CurrentCtx;
@@ -698,7 +698,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
BacktraceContext CurrentCtx;
if( ctx == NULL )
if( ctx == nullptr )
{
ctx = &CurrentCtx;
+4 -4
View File
@@ -119,7 +119,7 @@ void BacktraceNames::FromAddr( const void *p )
* between one function and the next, because the first lookup will succeed.
*/
Dl_info di;
if( !dladdr((void *) p, &di) || di.dli_sname == NULL )
if( !dladdr((void *) p, &di) || di.dli_sname == nullptr )
{
if( !dladdr( ((char *) p) - 8, &di) )
return;
@@ -175,7 +175,7 @@ static int osx_find_image( const void *p )
for( unsigned i = 0; i < image_count; i++ )
{
const struct mach_header *header = _dyld_get_image_header(i);
if( header == NULL )
if( header == nullptr )
continue;
/* The load commands directly follow the mach_header. */
@@ -233,7 +233,7 @@ void BacktraceNames::FromAddr( const void *p )
/* Find the link-edit pointer. */
const char *link_edit = osx_find_link_edit( _dyld_get_image_header(index) );
if( link_edit == NULL )
if( link_edit == nullptr )
return;
link_edit += _dyld_get_image_vmaddr_slide( index );
@@ -297,7 +297,7 @@ void BacktraceNames::FromAddr( const void *p )
Address = (intptr_t) p;
char **foo = backtrace_symbols(&p, 1);
if( foo == NULL )
if( foo == nullptr )
return;
FromString( foo[0] );
free(foo);
+2 -2
View File
@@ -30,7 +30,7 @@ static void safe_print( int fd, ... )
while( true )
{
const char *p = va_arg( ap, const char * );
if( p == NULL )
if( p == nullptr )
break;
size_t len = strlen( p );
while( len )
@@ -203,7 +203,7 @@ static void parent_process( int to_child, const CrashData *crash )
static void RunCrashHandler( const CrashData *crash )
{
if( g_pCrashHandlerArgv0 == NULL )
if( g_pCrashHandlerArgv0 == nullptr )
{
safe_print( fileno(stderr), "Crash handler failed: CrashHandlerHandleArgs was not called\n", NULL );
_exit( 1 );
+2 -2
View File
@@ -198,7 +198,7 @@ static void child_process()
sCrashInfoPath += "/crashinfo.txt";
FILE *CrashDump = fopen( sCrashInfoPath, "w+" );
if(CrashDump == NULL)
if(CrashDump == nullptr)
{
fprintf( stderr, "Couldn't open " + sCrashInfoPath + ": %s\n", strerror(errno) );
exit(1);
@@ -277,7 +277,7 @@ static void child_process()
/* stdout may have been inadvertently closed by the crash in the parent;
* write to /dev/tty instead. */
FILE *tty = fopen( "/dev/tty", "w" );
if( tty == NULL )
if( tty == nullptr )
tty = stderr;
fputs( "\n"
+1 -1
View File
@@ -141,7 +141,7 @@ static void *CreateStack( int size )
/* Hook up events to fatal signals, so we can clean up if we're killed. */
void SignalHandler::OnClose( handler h )
{
if( saved_sigs == NULL )
if( saved_sigs == nullptr )
{
saved_sigs = new SaveSignals;
+3 -3
View File
@@ -15,9 +15,9 @@ static Preference<RString> g_XWMName( "XWMName", PRODUCT_ID );
bool X11Helper::OpenXConnection()
{
DEBUG_ASSERT( Dpy == NULL && Win == None );
DEBUG_ASSERT( Dpy == nullptr && Win == None );
Dpy = XOpenDisplay(0);
if( Dpy == NULL )
if( Dpy == nullptr )
return false;
XSetIOErrorHandler( FatalCallback );
@@ -66,7 +66,7 @@ bool X11Helper::MakeWindow( Window &win, int screenNum, int depth, Visual *visua
return false;
XClassHint *hint = XAllocClassHint();
if ( hint == NULL ) {
if ( hint == nullptr ) {
LOG->Warn("Could not set class hint for X11 Window");
} else {
hint->res_name = (char*)g_XWMName.Get().c_str();