src: fix warning in cares_wrap.cc
This commit fixes the following warning: ./src/cares_wrap.cc:1268:5: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare] CHECK_EQ(ret->Length(), a_count + aaaa_count); PR-URL: https://github.com/nodejs/node/pull/25230 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
3c5e2372db
commit
da9a4d0fb4
@ -1212,15 +1212,15 @@ class QueryAnyWrap: public QueryWrap {
|
|||||||
ret,
|
ret,
|
||||||
addrttls,
|
addrttls,
|
||||||
&naddrttls);
|
&naddrttls);
|
||||||
int a_count = ret->Length();
|
uint32_t a_count = ret->Length();
|
||||||
if (status != ARES_SUCCESS && status != ARES_ENODATA) {
|
if (status != ARES_SUCCESS && status != ARES_ENODATA) {
|
||||||
ParseError(status);
|
ParseError(status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == ns_t_a) {
|
if (type == ns_t_a) {
|
||||||
CHECK_EQ(naddrttls, a_count);
|
CHECK_EQ(static_cast<uint32_t>(naddrttls), a_count);
|
||||||
for (int i = 0; i < a_count; i++) {
|
for (uint32_t i = 0; i < a_count; i++) {
|
||||||
Local<Object> obj = Object::New(env()->isolate());
|
Local<Object> obj = Object::New(env()->isolate());
|
||||||
obj->Set(context,
|
obj->Set(context,
|
||||||
env()->address_string(),
|
env()->address_string(),
|
||||||
@ -1234,7 +1234,7 @@ class QueryAnyWrap: public QueryWrap {
|
|||||||
ret->Set(context, i, obj).FromJust();
|
ret->Set(context, i, obj).FromJust();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < a_count; i++) {
|
for (uint32_t i = 0; i < a_count; i++) {
|
||||||
Local<Object> obj = Object::New(env()->isolate());
|
Local<Object> obj = Object::New(env()->isolate());
|
||||||
obj->Set(context,
|
obj->Set(context,
|
||||||
env()->value_string(),
|
env()->value_string(),
|
||||||
@ -1258,13 +1258,13 @@ class QueryAnyWrap: public QueryWrap {
|
|||||||
ret,
|
ret,
|
||||||
addr6ttls,
|
addr6ttls,
|
||||||
&naddr6ttls);
|
&naddr6ttls);
|
||||||
int aaaa_count = ret->Length() - a_count;
|
uint32_t aaaa_count = ret->Length() - a_count;
|
||||||
if (status != ARES_SUCCESS && status != ARES_ENODATA) {
|
if (status != ARES_SUCCESS && status != ARES_ENODATA) {
|
||||||
ParseError(status);
|
ParseError(status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_EQ(aaaa_count, naddr6ttls);
|
CHECK_EQ(aaaa_count, static_cast<uint32_t>(naddr6ttls));
|
||||||
CHECK_EQ(ret->Length(), a_count + aaaa_count);
|
CHECK_EQ(ret->Length(), a_count + aaaa_count);
|
||||||
for (uint32_t i = a_count; i < ret->Length(); i++) {
|
for (uint32_t i = a_count; i < ret->Length(); i++) {
|
||||||
Local<Object> obj = Object::New(env()->isolate());
|
Local<Object> obj = Object::New(env()->isolate());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user