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/unixfilesystem.cc b/webrtc/base/unixfilesystem.cc
index a011094..d0da709 100644
--- a/webrtc/base/unixfilesystem.cc
+++ b/webrtc/base/unixfilesystem.cc
@@ -63,10 +63,10 @@
namespace rtc {
#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_MAC)
-char* UnixFilesystem::app_temp_path_ = NULL;
+char* UnixFilesystem::app_temp_path_ = nullptr;
#else
-char* UnixFilesystem::provided_app_data_folder_ = NULL;
-char* UnixFilesystem::provided_app_temp_folder_ = NULL;
+char* UnixFilesystem::provided_app_data_folder_ = nullptr;
+char* UnixFilesystem::provided_app_temp_folder_ = nullptr;
void UnixFilesystem::SetAppDataFolder(const std::string& folder) {
delete [] provided_app_data_folder_;
@@ -126,9 +126,9 @@
FileStream *UnixFilesystem::OpenFile(const Pathname &filename,
const std::string &mode) {
FileStream *fs = new FileStream();
- if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), NULL)) {
+ if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), nullptr)) {
delete fs;
- fs = NULL;
+ fs = nullptr;
}
return fs;
}
@@ -157,7 +157,7 @@
bool UnixFilesystem::GetTemporaryFolder(Pathname &pathname, bool create,
const std::string *append) {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
- RTC_DCHECK(provided_app_temp_folder_ != NULL);
+ RTC_DCHECK(provided_app_temp_folder_ != nullptr);
pathname.SetPathname(provided_app_temp_folder_, "");
#else
if (const char* tmpdir = getenv("TMPDIR")) {
@@ -238,8 +238,8 @@
return false;
}
- while (source->Read(buf, sizeof(buf), &len, NULL) == SR_SUCCESS)
- dest->Write(buf, len, NULL, NULL);
+ while (source->Read(buf, sizeof(buf), &len, nullptr) == SR_SUCCESS)
+ dest->Write(buf, len, nullptr, nullptr);
delete source;
delete dest;
@@ -248,7 +248,7 @@
bool UnixFilesystem::IsTemporaryPath(const Pathname& pathname) {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
- RTC_DCHECK(provided_app_temp_folder_ != NULL);
+ RTC_DCHECK(provided_app_temp_folder_ != nullptr);
#endif
const char* const kTempPrefixes[] = {
@@ -315,13 +315,13 @@
bool UnixFilesystem::GetAppTempFolder(Pathname* path) {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
- RTC_DCHECK(provided_app_temp_folder_ != NULL);
+ RTC_DCHECK(provided_app_temp_folder_ != nullptr);
path->SetPathname(provided_app_temp_folder_);
return true;
#else
RTC_DCHECK(!application_name_.empty());
// TODO: Consider whether we are worried about thread safety.
- if (app_temp_path_ != NULL && strlen(app_temp_path_) > 0) {
+ if (app_temp_path_ != nullptr && strlen(app_temp_path_) > 0) {
path->SetPathname(app_temp_path_);
return true;
}
@@ -348,7 +348,7 @@
char* buf = new char[size];
if (!buf) {
- return NULL;
+ return nullptr;
}
strcpyn(buf, size, str.c_str());