Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: webrtc/base/logging.cc

Issue 2718663005: Replace NULL with nullptr or null in webrtc/base/. (Closed)
Patch Set: Fixing Windows and formatting issues. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/logging.h ('k') | webrtc/base/logging_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/logging.cc
diff --git a/webrtc/base/logging.cc b/webrtc/base/logging.cc
index 3624a40bc9e08f53b70aed79462889203a738719..25f85c96a7c03c7b2e406f4441bd0f3a2f3a7965 100644
--- a/webrtc/base/logging.cc
+++ b/webrtc/base/logging.cc
@@ -110,7 +110,7 @@ CriticalSection g_log_crit;
// 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 @@ LogMessage::LogMessage(const char* file,
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 @@ LogMessage::LogMessage(const char* file,
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 @@ LogMessage::LogMessage(const char* file,
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 @@ int64_t LogMessage::LogStartTime() {
}
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 @@ void LogMessage::OutputToDebug(const std::string& str,
"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 @@ void LogMessage::OutputToDebug(const std::string& str,
// stderr.
log_to_stderr = exists_and_is_valid && should_log;
}
- if (key != NULL) {
+ if (key != nullptr) {
CFRelease(key);
}
#endif
@@ -443,7 +447,7 @@ void LogMultiline(LoggingSeverity level, const char* label, bool input,
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 << "## "
« no previous file with comments | « webrtc/base/logging.h ('k') | webrtc/base/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698