node.cc: use nullptr instead of NULL
authorBert Belder <bertbelder@gmail.com>
Tue, 9 Dec 2014 04:57:17 +0000 (05:57 +0100)
committerBert Belder <bertbelder@gmail.com>
Tue, 9 Dec 2014 16:57:08 +0000 (17:57 +0100)
PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
src/node.cc

index 2cf6e1d..6e3d7ff 100644 (file)
@@ -2071,12 +2071,12 @@ struct node_module* get_builtin_module(const char* name) {
 struct node_module* get_linked_module(const char* name) {
   struct node_module* mp;
 
-  for (mp = modlist_linked; mp != NULL; mp = mp->nm_link) {
+  for (mp = modlist_linked; mp != nullptr; mp = mp->nm_link) {
     if (strcmp(mp->nm_modname, name) == 0)
       break;
   }
 
-  CHECK(mp == NULL || (mp->nm_flags & NM_F_LINKED) != 0);
+  CHECK(mp == nullptr || (mp->nm_flags & NM_F_LINKED) != 0);
   return mp;
 }
 
@@ -2298,7 +2298,7 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
   node::Utf8Value module_v(module);
   node_module* mod = get_linked_module(*module_v);
 
-  if (mod == NULL) {
+  if (mod == nullptr) {
     char errmsg[1024];
     snprintf(errmsg,
              sizeof(errmsg),
@@ -2309,12 +2309,12 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
 
   Local<Object> exports = Object::New(env->isolate());
 
-  if (mod->nm_context_register_func != NULL) {
+  if (mod->nm_context_register_func != nullptr) {
     mod->nm_context_register_func(exports,
                                   module,
                                   env->context(),
                                   mod->nm_priv);
-  } else if (mod->nm_register_func != NULL) {
+  } else if (mod->nm_register_func != nullptr) {
     mod->nm_register_func(exports, module, mod->nm_priv);
   } else {
     return env->ThrowError("Linked module has no declared entry point.");