Replace NULL with nullptr or null in webrtc/base/.
BUG=webrtc:7147
Review-Url: https://codereview.webrtc.org/2718663005
Cr-Commit-Position: refs/heads/master@{#16878}
diff --git a/webrtc/base/logging.cc b/webrtc/base/logging.cc
index 3624a40..25f85c9 100644
--- a/webrtc/base/logging.cc
+++ b/webrtc/base/logging.cc
@@ -110,7 +110,7 @@
// The list of logging streams currently configured.
// Note: we explicitly do not clean this up, because of the uncertain ordering
// of destructors at program exit. Let the person who sets the stream trigger
-// cleanup by setting to NULL, or let it leak (safe at program exit).
+// cleanup by setting to null, or let it leak (safe at program exit).
LogMessage::StreamList LogMessage::streams_ GUARDED_BY(g_log_crit);
// Boolean options default to false (0)
@@ -140,7 +140,7 @@
print_stream_ << "[" << std::dec << id << "] ";
}
- if (file != NULL)
+ if (file != nullptr)
print_stream_ << "(" << FilenameFromPath(file) << ":" << line << "): ";
if (err_ctx != ERRCTX_NONE) {
@@ -158,9 +158,8 @@
if (hmod)
flags |= FORMAT_MESSAGE_FROM_HMODULE;
if (DWORD len = FormatMessageA(
- flags, hmod, err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- msgbuf, sizeof(msgbuf) / sizeof(msgbuf[0]), NULL)) {
+ flags, hmod, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ msgbuf, sizeof(msgbuf) / sizeof(msgbuf[0]), nullptr)) {
while ((len > 0) &&
isspace(static_cast<unsigned char>(msgbuf[len-1]))) {
msgbuf[--len] = 0;
@@ -188,7 +187,12 @@
int line,
LoggingSeverity sev,
const std::string& tag)
- : LogMessage(file, line, sev, ERRCTX_NONE, 0 /* err */, NULL /* module */) {
+ : LogMessage(file,
+ line,
+ sev,
+ ERRCTX_NONE,
+ 0 /* err */,
+ nullptr /* module */) {
tag_ = tag;
print_stream_ << tag << ": ";
}
@@ -217,7 +221,7 @@
}
uint32_t LogMessage::WallClockStartTime() {
- static const uint32_t g_start_wallclock = time(NULL);
+ static const uint32_t g_start_wallclock = time(nullptr);
return g_start_wallclock;
}
@@ -349,7 +353,7 @@
"logToStdErr",
kCFStringEncodingUTF8);
CFStringRef domain = CFBundleGetIdentifier(CFBundleGetMainBundle());
- if (key != NULL && domain != NULL) {
+ if (key != nullptr && domain != nullptr) {
Boolean exists_and_is_valid;
Boolean should_log =
CFPreferencesGetAppBooleanValue(key, domain, &exists_and_is_valid);
@@ -357,7 +361,7 @@
// stderr.
log_to_stderr = exists_and_is_valid && should_log;
}
- if (key != NULL) {
+ if (key != nullptr) {
CFRelease(key);
}
#endif
@@ -443,7 +447,7 @@
const char * direction = (input ? " << " : " >> ");
- // NULL data means to flush our count of unprintable characters.
+ // null data means to flush our count of unprintable characters.
if (!data) {
if (state && state->unprintable_count_[input]) {
LOG_V(level) << label << direction << "## "