The big NULL replacement party part 5.

Right. ' = NULL' would get a lot of these.
This commit is contained in:
Jason Felds
2013-05-03 23:39:52 -04:00
parent 328c41eec0
commit 28e5148dec
233 changed files with 7448 additions and 7447 deletions
+14 -14
View File
@@ -137,8 +137,8 @@ static int get_readable_ranges( const void **starts, const void **ends, int size
close(fd);
*starts++ = NULL;
*ends++ = NULL;
*starts++ = nullptr;
*ends++ = nullptr;
return got;
}
@@ -157,7 +157,7 @@ static int find_address( const void *p, const void **starts, const void **ends )
return -1;
}
static void *SavedStackPointer = NULL;
static void *SavedStackPointer = nullptr;
void InitializeBacktrace()
{
@@ -364,7 +364,7 @@ static void do_backtrace( const void **buf, size_t size, const BacktraceContext
frame = frame->link;
}
buf[i] = NULL;
buf[i] = nullptr;
}
#if defined(CPU_X86)
@@ -396,7 +396,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
ctx = &CurrentCtx;
CurrentCtx.ip = NULL;
CurrentCtx.ip = nullptr;
CurrentCtx.bp = __builtin_frame_address(0);
CurrentCtx.sp = __builtin_frame_address(0);
CurrentCtx.pid = GetCurrentThreadId();
@@ -523,7 +523,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
if( g_StackPointer == 0 )
{
buf[0] = BACKTRACE_METHOD_NOT_AVAILABLE;
buf[1] = NULL;
buf[1] = nullptr;
return;
}
@@ -532,7 +532,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
ctx = &CurrentCtx;
CurrentCtx.ip = NULL;
CurrentCtx.ip = nullptr;
CurrentCtx.bp = __builtin_frame_address(0);
CurrentCtx.sp = __builtin_frame_address(0);
}
@@ -562,7 +562,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
/* There isn't much we can do if this is the case. The stack should be read/write
* and since it isn't, give up. */
buf[i] = NULL;
buf[i] = nullptr;
return;
}
const Frame *frame = (Frame *)ctx->sp;
@@ -620,7 +620,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
frame = frame->link;
}
buf[i] = NULL;
buf[i] = nullptr;
}
#undef PROT_RW
#undef PROT_EXE
@@ -656,7 +656,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
/* __builtin_frame_address is broken on OS X; it sometimes returns bogus results. */
register void *r1 __asm__ ("r1");
CurrentCtx.FramePtr = (const Frame *) r1;
CurrentCtx.PC = NULL;
CurrentCtx.PC = nullptr;
}
const Frame *frame = ctx->FramePtr;
@@ -673,7 +673,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
frame = frame->stackPointer;
}
buf[i] = NULL;
buf[i] = nullptr;
}
#elif defined(BACKTRACE_METHOD_PPC_LINUX)
@@ -704,7 +704,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
register void *r1 __asm__("1");
CurrentCtx.FramePtr = (const Frame *)r1;
CurrentCtx.PC = NULL;
CurrentCtx.PC = nullptr;
}
const Frame *frame = (const Frame *)ctx->FramePtr;
@@ -718,7 +718,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
if( frame->linkReg )
buf[i++] = frame->linkReg;
}
buf[i] = NULL;
buf[i] = nullptr;
}
#else
@@ -729,7 +729,7 @@ void InitializeBacktrace() { }
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
buf[0] = BACKTRACE_METHOD_NOT_AVAILABLE;
buf[1] = NULL;
buf[1] = nullptr;
}
#endif
+1 -1
View File
@@ -34,7 +34,7 @@ void InitializeBacktrace();
* null-terminated. If ctx is NULL, retrieve the current backtrace; otherwise
* retrieve a backtrace for the given context. (Not all backtracers may
* support contexts.) */
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx = NULL );
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx = nullptr );
/* Set up a BacktraceContext to get a backtrace for a thread. ThreadID may
* not be the current thread. True is returned on success, false on failure. */
+2 -2
View File
@@ -242,8 +242,8 @@ void BacktraceNames::FromAddr( const void *p )
const struct load_command *cmd = (struct load_command *) &header[1];
unsigned long diff = 0xffffffff;
const char *dli_sname = NULL;
void *dli_saddr = NULL;
const char *dli_sname = nullptr;
void *dli_saddr = nullptr;
for( unsigned long i = 0; i < header->ncmds; i++, cmd = next_load_command(cmd) )
{
+1 -1
View File
@@ -30,7 +30,7 @@ extern const char *const version_time;
bool child_read( int fd, void *p, int size );
const char *g_pCrashHandlerArgv0 = NULL;
const char *g_pCrashHandlerArgv0 = nullptr;
static void output_stack_trace( FILE *out, const void **BacktracePointers )
+3 -3
View File
@@ -115,7 +115,7 @@ static void *CreateStack( int size )
*
* mmap entries always show up individually in /proc/#/maps. We could use posix_memalign as
* a fallback, but we'd have to put a barrier page on both sides to guarantee that. */
char *p = NULL;
char *p = nullptr;
p = (char *) mmap( NULL, size+PageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 );
if( p == (void *) -1 )
@@ -156,7 +156,7 @@ void SignalHandler::OnClose( handler h )
/* Allocate a separate signal stack. This makes the crash handler work
* if we run out of stack space. */
const int AltStackSize = 1024*64;
void *p = NULL;
void *p = nullptr;
if( bUseAltSigStack )
p = CreateStack( AltStackSize );
@@ -169,7 +169,7 @@ void SignalHandler::OnClose( handler h )
if( sigaltstack( &ss, NULL ) == -1 )
{
LOG->Info( "sigaltstack failed: %s", strerror(errno) );
p = NULL; /* no SA_ONSTACK */
p = nullptr; /* no SA_ONSTACK */
}
}
+2 -2
View File
@@ -5,7 +5,7 @@
#include "Preference.h"
#include "PrefsManager.h" // XXX: only used for m_bShowMouseCursor -aj
Display *X11Helper::Dpy = NULL;
Display *X11Helper::Dpy = nullptr;
Window X11Helper::Win = None;
static int ErrorCallback( Display*, XErrorEvent* );
@@ -31,7 +31,7 @@ void X11Helper::CloseXConnection()
DEBUG_ASSERT( Dpy != nullptr );
DEBUG_ASSERT( Win == None );
XCloseDisplay( Dpy );
Dpy = NULL;
Dpy = nullptr;
}
bool X11Helper::MakeWindow( Window &win, int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect )