Modernize to C++11: NULL => nullptr.

No functional change.
This commit is contained in:
Haojian Wu 2016-07-10 11:52:28 +02:00
parent 9c74ea4bf4
commit fab02809c6
29 changed files with 82 additions and 82 deletions

View file

@ -25,7 +25,7 @@ namespace {
struct DummyClass { bool crash; };
void Crash() {
static_cast<DummyClass*>(NULL)->crash = true;
static_cast<DummyClass*>(nullptr)->crash = true;
}
void Hang() {

View file

@ -41,7 +41,7 @@ bool GetFilesNode(const base::DictionaryValue* root,
// Test for symbol linked directory.
std::string link;
if (dir->GetStringWithoutPathExpansion("link", &link)) {
const base::DictionaryValue* linked_node = NULL;
const base::DictionaryValue* linked_node = nullptr;
if (!GetNodeFromPath(link, root, &linked_node))
return false;
dir = linked_node;
@ -60,7 +60,7 @@ bool GetChildNode(const base::DictionaryValue* root,
return true;
}
const base::DictionaryValue* files = NULL;
const base::DictionaryValue* files = nullptr;
return GetFilesNode(root, dir, &files) &&
files->GetDictionaryWithoutPathExpansion(name, out);
}
@ -78,7 +78,7 @@ bool GetNodeFromPath(std::string path,
for (size_t delimiter_position = path.find_first_of(kSeparators);
delimiter_position != std::string::npos;
delimiter_position = path.find_first_of(kSeparators)) {
const base::DictionaryValue* child = NULL;
const base::DictionaryValue* child = nullptr;
if (!GetChildNode(root, path.substr(0, delimiter_position), dir, &child))
return false;

View file

@ -162,7 +162,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Array(
v8::Local<v8::Array> result(v8::Array::New(isolate, val->GetSize()));
for (size_t i = 0; i < val->GetSize(); ++i) {
const base::Value* child = NULL;
const base::Value* child = nullptr;
CHECK(val->Get(i, &child));
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child);
@ -214,7 +214,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
FromV8ValueState::Level state_level(state);
if (state->HasReachedMaxRecursionDepth())
return NULL;
return nullptr;
if (val->IsNull())
return base::Value::CreateNullValue().release();
@ -235,7 +235,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (val->IsUndefined())
// JSON.stringify ignores undefined.
return NULL;
return nullptr;
if (val->IsDate()) {
v8::Date* date = v8::Date::Cast(*val);
@ -265,7 +265,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (val->IsFunction()) {
if (!function_allowed_)
// JSON.stringify refuses to convert function(){}.
return NULL;
return nullptr;
return FromV8Object(val->ToObject(), state, isolate);
}
@ -278,7 +278,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
}
LOG(ERROR) << "Unexpected v8 value type encountered.";
return NULL;
return nullptr;
}
base::Value* V8ValueConverter::FromV8Array(

View file

@ -54,7 +54,7 @@ void NodeBindingsMac::PollEvents() {
// Wait for new libuv events.
int r;
do {
r = select(fd + 1, &readset, NULL, NULL, timeout == -1 ? NULL : &tv);
r = select(fd + 1, &readset, nullptr, nullptr, timeout == -1 ? nullptr : &tv);
} while (r == -1 && errno == EINTR);
}