Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Henry Wilson
2019-04-10 22:07:06 +01:00
committed by Michael Lutz
parent 3b4f224c0b
commit 7c8e7c6b6e
463 changed files with 5674 additions and 5674 deletions

View File

@@ -66,7 +66,7 @@ class CrashLogOSX : public CrashLog {
" Machine: %s\n"
" Min Ver: %d\n",
ver_maj, ver_min, ver_bug,
arch != NULL ? arch->description : "unknown",
arch != nullptr ? arch->description : "unknown",
MAC_OS_X_VERSION_MIN_REQUIRED
);
}
@@ -79,7 +79,7 @@ class CrashLogOSX : public CrashLog {
" Message: %s\n\n",
strsignal(this->signum),
this->signum,
message == NULL ? "<none>" : message
message == nullptr ? "<none>" : message
);
}
@@ -99,14 +99,14 @@ class CrashLogOSX : public CrashLog {
frame = (void **)__builtin_frame_address(0);
#endif
for (int i = 0; frame != NULL && i < MAX_STACK_FRAMES; i++) {
for (int i = 0; frame != nullptr && i < MAX_STACK_FRAMES; i++) {
/* Get IP for current stack frame. */
#if defined(__ppc__) || defined(__ppc64__)
void *ip = frame[2];
#else
void *ip = frame[1];
#endif
if (ip == NULL) break;
if (ip == nullptr) break;
/* Print running index. */
buffer += seprintf(buffer, last, " [%02d]", i);
@@ -118,7 +118,7 @@ class CrashLogOSX : public CrashLog {
if (dl_valid && dli.dli_fname) {
/* Valid image name? Extract filename from the complete path. */
const char *s = strrchr(dli.dli_fname, '/');
if (s != NULL) {
if (s != nullptr) {
fname = s + 1;
} else {
fname = dli.dli_fname;
@@ -128,13 +128,13 @@ class CrashLogOSX : public CrashLog {
buffer += seprintf(buffer, last, " %-20s " PRINTF_PTR, fname, (uintptr_t)ip);
/* Print function offset if information is available. */
if (dl_valid && dli.dli_sname != NULL && dli.dli_saddr != NULL) {
if (dl_valid && dli.dli_sname != nullptr && dli.dli_saddr != nullptr) {
/* Try to demangle a possible C++ symbol. */
int status = -1;
char *func_name = abi::__cxa_demangle(dli.dli_sname, NULL, 0, &status);
char *func_name = abi::__cxa_demangle(dli.dli_sname, nullptr, 0, &status);
long int offset = (intptr_t)ip - (intptr_t)dli.dli_saddr;
buffer += seprintf(buffer, last, " (%s + %ld)", func_name != NULL ? func_name : dli.dli_sname, offset);
buffer += seprintf(buffer, last, " (%s + %ld)", func_name != nullptr ? func_name : dli.dli_sname, offset);
free(func_name);
}