@@ -121,9 +121,9 @@ static void ares_poll_close_cb(uv_handle_t* watcher) {
121
121
static ares_task_t * ares_task_create (Environment* env, ares_socket_t sock) {
122
122
ares_task_t * task = static_cast <ares_task_t *>(malloc (sizeof (*task)));
123
123
124
- if (task == NULL ) {
124
+ if (task == nullptr ) {
125
125
/* Out of memory. */
126
- return NULL ;
126
+ return nullptr ;
127
127
}
128
128
129
129
task->env = env;
@@ -132,7 +132,7 @@ static ares_task_t* ares_task_create(Environment* env, ares_socket_t sock) {
132
132
if (uv_poll_init_socket (env->event_loop (), &task->poll_watcher , sock) < 0 ) {
133
133
/* This should never happen. */
134
134
free (task);
135
- return NULL ;
135
+ return nullptr ;
136
136
}
137
137
138
138
return task;
@@ -163,7 +163,7 @@ static void ares_sockstate_cb(void* data,
163
163
}
164
164
165
165
task = ares_task_create (env, sock);
166
- if (task == NULL ) {
166
+ if (task == nullptr ) {
167
167
/* This should never happen unless we're out of memory or something */
168
168
/* is seriously wrong. The socket won't be polled, but the the query */
169
169
/* will eventually time out. */
@@ -202,7 +202,7 @@ static Local<Array> HostentToAddresses(Environment* env, struct hostent* host) {
202
202
Local<Array> addresses = Array::New (env->isolate ());
203
203
204
204
char ip[INET6_ADDRSTRLEN];
205
- for (uint32_t i = 0 ; host->h_addr_list [i] != NULL ; ++i) {
205
+ for (uint32_t i = 0 ; host->h_addr_list [i] != nullptr ; ++i) {
206
206
uv_inet_ntop (host->h_addrtype , host->h_addr_list [i], ip, sizeof (ip));
207
207
Local<String> address = OneByteString (env->isolate (), ip);
208
208
addresses->Set (i, address);
@@ -216,7 +216,7 @@ static Local<Array> HostentToNames(Environment* env, struct hostent* host) {
216
216
EscapableHandleScope scope (env->isolate ());
217
217
Local<Array> names = Array::New (env->isolate ());
218
218
219
- for (uint32_t i = 0 ; host->h_aliases [i] != NULL ; ++i) {
219
+ for (uint32_t i = 0 ; host->h_aliases [i] != nullptr ; ++i) {
220
220
Local<String> address = OneByteString (env->isolate (), host->h_aliases [i]);
221
221
names->Set (i, address);
222
222
}
@@ -375,7 +375,7 @@ class QueryAWrap: public QueryWrap {
375
375
376
376
struct hostent * host;
377
377
378
- int status = ares_parse_a_reply (buf, len, &host, NULL , NULL );
378
+ int status = ares_parse_a_reply (buf, len, &host, nullptr , nullptr );
379
379
if (status != ARES_SUCCESS) {
380
380
ParseError (status);
381
381
return ;
@@ -412,7 +412,7 @@ class QueryAaaaWrap: public QueryWrap {
412
412
413
413
struct hostent * host;
414
414
415
- int status = ares_parse_aaaa_reply (buf, len, &host, NULL , NULL );
415
+ int status = ares_parse_aaaa_reply (buf, len, &host, nullptr , nullptr );
416
416
if (status != ARES_SUCCESS) {
417
417
ParseError (status);
418
418
return ;
@@ -448,7 +448,7 @@ class QueryCnameWrap: public QueryWrap {
448
448
Context::Scope context_scope (env ()->context ());
449
449
struct hostent * host;
450
450
451
- int status = ares_parse_a_reply (buf, len, &host, NULL , NULL );
451
+ int status = ares_parse_a_reply (buf, len, &host, nullptr , nullptr );
452
452
if (status != ARES_SUCCESS) {
453
453
ParseError (status);
454
454
return ;
@@ -498,7 +498,7 @@ class QueryMxWrap: public QueryWrap {
498
498
Local<String> priority_symbol = env ()->priority_string ();
499
499
500
500
ares_mx_reply* current = mx_start;
501
- for (uint32_t i = 0 ; current != NULL ; ++i, current = current->next ) {
501
+ for (uint32_t i = 0 ; current != nullptr ; ++i, current = current->next ) {
502
502
Local<Object> mx_record = Object::New (env ()->isolate ());
503
503
mx_record->Set (exchange_symbol,
504
504
OneByteString (env ()->isolate (), current->host ));
@@ -583,7 +583,7 @@ class QueryTxtWrap: public QueryWrap {
583
583
584
584
ares_txt_reply* current = txt_out;
585
585
uint32_t i = 0 ;
586
- for (uint32_t j = 0 ; current != NULL ; current = current->next ) {
586
+ for (uint32_t j = 0 ; current != nullptr ; current = current->next ) {
587
587
Local<String> txt = OneByteString (env ()->isolate (), current->txt );
588
588
// New record found - write out the current chunk
589
589
if (current->record_start ) {
@@ -639,7 +639,7 @@ class QuerySrvWrap: public QueryWrap {
639
639
Local<String> weight_symbol = env ()->weight_string ();
640
640
641
641
ares_srv_reply* current = srv_start;
642
- for (uint32_t i = 0 ; current != NULL ; ++i, current = current->next ) {
642
+ for (uint32_t i = 0 ; current != nullptr ; ++i, current = current->next ) {
643
643
Local<Object> srv_record = Object::New (env ()->isolate ());
644
644
srv_record->Set (name_symbol,
645
645
OneByteString (env ()->isolate (), current->host ));
@@ -696,7 +696,7 @@ class QueryNaptrWrap: public QueryWrap {
696
696
Local<String> preference_symbol = env ()->preference_string ();
697
697
698
698
ares_naptr_reply* current = naptr_start;
699
- for (uint32_t i = 0 ; current != NULL ; ++i, current = current->next ) {
699
+ for (uint32_t i = 0 ; current != nullptr ; ++i, current = current->next ) {
700
700
Local<Object> naptr_record = Object::New (env ()->isolate ());
701
701
naptr_record->Set (flags_symbol,
702
702
OneByteString (env ()->isolate (), current->flags ));
@@ -1044,7 +1044,7 @@ static void GetAddrInfo(const FunctionCallbackInfo<Value>& args) {
1044
1044
&req_wrap->req_ ,
1045
1045
AfterGetAddrInfo,
1046
1046
*hostname,
1047
- NULL ,
1047
+ nullptr ,
1048
1048
&hints);
1049
1049
req_wrap->Dispatched ();
1050
1050
if (err)
@@ -1098,7 +1098,7 @@ static void GetServers(const FunctionCallbackInfo<Value>& args) {
1098
1098
1099
1099
ares_addr_node* cur = servers;
1100
1100
1101
- for (uint32_t i = 0 ; cur != NULL ; ++i, cur = cur->next ) {
1101
+ for (uint32_t i = 0 ; cur != nullptr ; ++i, cur = cur->next ) {
1102
1102
char ip[INET6_ADDRSTRLEN];
1103
1103
1104
1104
const void * caddr = static_cast <const void *>(&cur->addr );
@@ -1125,12 +1125,12 @@ static void SetServers(const FunctionCallbackInfo<Value>& args) {
1125
1125
uint32_t len = arr->Length ();
1126
1126
1127
1127
if (len == 0 ) {
1128
- int rv = ares_set_servers (env->cares_channel (), NULL );
1128
+ int rv = ares_set_servers (env->cares_channel (), nullptr );
1129
1129
return args.GetReturnValue ().Set (rv);
1130
1130
}
1131
1131
1132
1132
ares_addr_node* servers = new ares_addr_node[len];
1133
- ares_addr_node* last = NULL ;
1133
+ ares_addr_node* last = nullptr ;
1134
1134
1135
1135
int err;
1136
1136
@@ -1164,9 +1164,9 @@ static void SetServers(const FunctionCallbackInfo<Value>& args) {
1164
1164
if (err)
1165
1165
break ;
1166
1166
1167
- cur->next = NULL ;
1167
+ cur->next = nullptr ;
1168
1168
1169
- if (last != NULL )
1169
+ if (last != nullptr )
1170
1170
last->next = cur;
1171
1171
1172
1172
last = cur;
@@ -1230,7 +1230,7 @@ static void Initialize(Handle<Object> target,
1230
1230
env->RegisterHandleCleanup (
1231
1231
reinterpret_cast <uv_handle_t *>(env->cares_timer_handle ()),
1232
1232
CaresTimerClose,
1233
- NULL );
1233
+ nullptr );
1234
1234
1235
1235
env->SetMethod (target, " queryA" , Query<QueryAWrap>);
1236
1236
env->SetMethod (target, " queryAaaa" , Query<QueryAaaaWrap>);
0 commit comments