@@ -67,6 +67,7 @@ using v8::Object;
6767using v8::String;
6868using v8::Value;
6969
70+ namespace {
7071
7172inline const char * ToErrorCodeString (int status) {
7273 switch (status) {
@@ -114,7 +115,7 @@ GetAddrInfoReqWrap::GetAddrInfoReqWrap(Environment* env,
114115}
115116
116117
117- static void NewGetAddrInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
118+ void NewGetAddrInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
118119 CHECK (args.IsConstructCall ());
119120}
120121
@@ -133,17 +134,17 @@ GetNameInfoReqWrap::GetNameInfoReqWrap(Environment* env,
133134}
134135
135136
136- static void NewGetNameInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
137+ void NewGetNameInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
137138 CHECK (args.IsConstructCall ());
138139}
139140
140141
141- static void NewQueryReqWrap (const FunctionCallbackInfo<Value>& args) {
142+ void NewQueryReqWrap (const FunctionCallbackInfo<Value>& args) {
142143 CHECK (args.IsConstructCall ());
143144}
144145
145146
146- static int cmp_ares_tasks (const node_ares_task* a, const node_ares_task* b) {
147+ int cmp_ares_tasks (const node_ares_task* a, const node_ares_task* b) {
147148 if (a->sock < b->sock )
148149 return -1 ;
149150 if (a->sock > b->sock )
@@ -158,14 +159,14 @@ RB_GENERATE_STATIC(node_ares_task_list, node_ares_task, node, cmp_ares_tasks)
158159
159160/* This is called once per second by loop->timer. It is used to constantly */
160161/* call back into c-ares for possibly processing timeouts. */
161- static void ares_timeout (uv_timer_t * handle) {
162+ void ares_timeout (uv_timer_t * handle) {
162163 Environment* env = Environment::from_cares_timer_handle (handle);
163164 CHECK_EQ (false , RB_EMPTY (env->cares_task_list ()));
164165 ares_process_fd (env->cares_channel (), ARES_SOCKET_BAD, ARES_SOCKET_BAD);
165166}
166167
167168
168- static void ares_poll_cb (uv_poll_t * watcher, int status, int events) {
169+ void ares_poll_cb (uv_poll_t * watcher, int status, int events) {
169170 node_ares_task* task = ContainerOf (&node_ares_task::poll_watcher, watcher);
170171 Environment* env = task->env ;
171172
@@ -186,15 +187,15 @@ static void ares_poll_cb(uv_poll_t* watcher, int status, int events) {
186187}
187188
188189
189- static void ares_poll_close_cb (uv_handle_t * watcher) {
190+ void ares_poll_close_cb (uv_handle_t * watcher) {
190191 node_ares_task* task = ContainerOf (&node_ares_task::poll_watcher,
191192 reinterpret_cast <uv_poll_t *>(watcher));
192193 free (task);
193194}
194195
195196
196197/* Allocates and returns a new node_ares_task */
197- static node_ares_task* ares_task_create (Environment* env, ares_socket_t sock) {
198+ node_ares_task* ares_task_create (Environment* env, ares_socket_t sock) {
198199 auto task = node::UncheckedMalloc<node_ares_task>(1 );
199200
200201 if (task == nullptr ) {
@@ -216,10 +217,10 @@ static node_ares_task* ares_task_create(Environment* env, ares_socket_t sock) {
216217
217218
218219/* Callback from ares when socket operation is started */
219- static void ares_sockstate_cb (void * data,
220- ares_socket_t sock,
221- int read,
222- int write) {
220+ void ares_sockstate_cb (void * data,
221+ ares_socket_t sock,
222+ int read,
223+ int write) {
223224 Environment* env = static_cast <Environment*>(data);
224225 node_ares_task* task;
225226
@@ -273,7 +274,7 @@ static void ares_sockstate_cb(void* data,
273274}
274275
275276
276- static Local<Array> HostentToAddresses (Environment* env, struct hostent * host) {
277+ Local<Array> HostentToAddresses (Environment* env, struct hostent * host) {
277278 EscapableHandleScope scope (env->isolate ());
278279 Local<Array> addresses = Array::New (env->isolate ());
279280
@@ -288,7 +289,7 @@ static Local<Array> HostentToAddresses(Environment* env, struct hostent* host) {
288289}
289290
290291
291- static Local<Array> HostentToNames (Environment* env, struct hostent * host) {
292+ Local<Array> HostentToNames (Environment* env, struct hostent * host) {
292293 EscapableHandleScope scope (env->isolate ());
293294 Local<Array> names = Array::New (env->isolate ());
294295
@@ -1105,7 +1106,7 @@ void AfterGetNameInfo(uv_getnameinfo_t* req,
11051106}
11061107
11071108
1108- static void IsIP (const FunctionCallbackInfo<Value>& args) {
1109+ void IsIP (const FunctionCallbackInfo<Value>& args) {
11091110 node::Utf8Value ip (args.GetIsolate (), args[0 ]);
11101111 char address_buffer[sizeof (struct in6_addr )];
11111112
@@ -1118,7 +1119,7 @@ static void IsIP(const FunctionCallbackInfo<Value>& args) {
11181119 args.GetReturnValue ().Set (rc);
11191120}
11201121
1121- static void IsIPv4 (const FunctionCallbackInfo<Value>& args) {
1122+ void IsIPv4 (const FunctionCallbackInfo<Value>& args) {
11221123 node::Utf8Value ip (args.GetIsolate (), args[0 ]);
11231124 char address_buffer[sizeof (struct in_addr )];
11241125
@@ -1129,7 +1130,7 @@ static void IsIPv4(const FunctionCallbackInfo<Value>& args) {
11291130 }
11301131}
11311132
1132- static void IsIPv6 (const FunctionCallbackInfo<Value>& args) {
1133+ void IsIPv6 (const FunctionCallbackInfo<Value>& args) {
11331134 node::Utf8Value ip (args.GetIsolate (), args[0 ]);
11341135 char address_buffer[sizeof (struct in6_addr )];
11351136
@@ -1140,7 +1141,7 @@ static void IsIPv6(const FunctionCallbackInfo<Value>& args) {
11401141 }
11411142}
11421143
1143- static void GetAddrInfo (const FunctionCallbackInfo<Value>& args) {
1144+ void GetAddrInfo (const FunctionCallbackInfo<Value>& args) {
11441145 Environment* env = Environment::GetCurrent (args);
11451146
11461147 CHECK (args[0 ]->IsObject ());
@@ -1188,7 +1189,7 @@ static void GetAddrInfo(const FunctionCallbackInfo<Value>& args) {
11881189}
11891190
11901191
1191- static void GetNameInfo (const FunctionCallbackInfo<Value>& args) {
1192+ void GetNameInfo (const FunctionCallbackInfo<Value>& args) {
11921193 Environment* env = Environment::GetCurrent (args);
11931194
11941195 CHECK (args[0 ]->IsObject ());
@@ -1217,7 +1218,7 @@ static void GetNameInfo(const FunctionCallbackInfo<Value>& args) {
12171218}
12181219
12191220
1220- static void GetServers (const FunctionCallbackInfo<Value>& args) {
1221+ void GetServers (const FunctionCallbackInfo<Value>& args) {
12211222 Environment* env = Environment::GetCurrent (args);
12221223
12231224 Local<Array> server_array = Array::New (env->isolate ());
@@ -1246,7 +1247,7 @@ static void GetServers(const FunctionCallbackInfo<Value>& args) {
12461247}
12471248
12481249
1249- static void SetServers (const FunctionCallbackInfo<Value>& args) {
1250+ void SetServers (const FunctionCallbackInfo<Value>& args) {
12501251 Environment* env = Environment::GetCurrent (args);
12511252
12521253 CHECK (args[0 ]->IsArray ());
@@ -1313,30 +1314,30 @@ static void SetServers(const FunctionCallbackInfo<Value>& args) {
13131314}
13141315
13151316
1316- static void StrError (const FunctionCallbackInfo<Value>& args) {
1317+ void StrError (const FunctionCallbackInfo<Value>& args) {
13171318 Environment* env = Environment::GetCurrent (args);
13181319 const char * errmsg = ares_strerror (args[0 ]->Int32Value ());
13191320 args.GetReturnValue ().Set (OneByteString (env->isolate (), errmsg));
13201321}
13211322
13221323
1323- static void CaresTimerCloseCb (uv_handle_t * handle) {
1324+ void CaresTimerCloseCb (uv_handle_t * handle) {
13241325 Environment* env = Environment::from_cares_timer_handle (
13251326 reinterpret_cast <uv_timer_t *>(handle));
13261327 env->FinishHandleCleanup (handle);
13271328}
13281329
13291330
1330- static void CaresTimerClose (Environment* env,
1331+ void CaresTimerClose (Environment* env,
13311332 uv_handle_t * handle,
13321333 void * arg) {
13331334 uv_close (handle, CaresTimerCloseCb);
13341335}
13351336
13361337
1337- static void Initialize (Local<Object> target,
1338- Local<Value> unused,
1339- Local<Context> context) {
1338+ void Initialize (Local<Object> target,
1339+ Local<Value> unused,
1340+ Local<Context> context) {
13401341 Environment* env = Environment::GetCurrent (context);
13411342
13421343 int r = ares_library_init (ARES_LIB_INIT_ALL);
@@ -1424,6 +1425,7 @@ static void Initialize(Local<Object> target,
14241425 qrw->GetFunction ());
14251426}
14261427
1428+ } // anonymous namespace
14271429} // namespace cares_wrap
14281430} // namespace node
14291431
0 commit comments