Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgengjiawen <technicalcute@gmail.com>2019-02-02 11:27:12 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-07 09:39:42 +0300
commitabba1020f41cf684b850b95a1c96e2007959fe80 (patch)
tree41f4352e39016d228984b33e972c1f4aec285811 /src/cares_wrap.cc
parentb8d9d4ac68be5b95747a77b7f8bbdd62db379931 (diff)
src: refactor to nullptr in cpp code
Signed-off-by: gengjiawen <technicalcute@gmail.com> PR-URL: https://github.com/nodejs/node/pull/25888 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/cares_wrap.cc')
-rw-r--r--src/cares_wrap.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index 57c02fb3265..de05123c22c 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -395,7 +395,7 @@ void safe_free_hostent(struct hostent* host) {
free(host->h_addr_list[idx++]);
}
free(host->h_addr_list);
- host->h_addr_list = 0;
+ host->h_addr_list = nullptr;
}
if (host->h_aliases != nullptr) {
@@ -404,7 +404,7 @@ void safe_free_hostent(struct hostent* host) {
free(host->h_aliases[idx++]);
}
free(host->h_aliases);
- host->h_aliases = 0;
+ host->h_aliases = nullptr;
}
if (host->h_name != nullptr) {
@@ -1914,7 +1914,8 @@ void AfterGetNameInfo(uv_getnameinfo_t* req,
req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv);
}
-using ParseIPResult = decltype(static_cast<ares_addr_port_node*>(0)->addr);
+using ParseIPResult =
+ decltype(static_cast<ares_addr_port_node*>(nullptr)->addr);
int ParseIP(const char* ip, ParseIPResult* result = nullptr) {
ParseIPResult tmp;