From da9a4d0fb4df8be01cfd5a8d582f9acbb1e10306 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 26 Dec 2018 10:11:02 -0500 Subject: 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 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/cares_wrap.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cares_wrap.cc') diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 9d7af47dcdb..09cf809dec3 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -1212,15 +1212,15 @@ class QueryAnyWrap: public QueryWrap { ret, addrttls, &naddrttls); - int a_count = ret->Length(); + uint32_t a_count = ret->Length(); if (status != ARES_SUCCESS && status != ARES_ENODATA) { ParseError(status); return; } if (type == ns_t_a) { - CHECK_EQ(naddrttls, a_count); - for (int i = 0; i < a_count; i++) { + CHECK_EQ(static_cast(naddrttls), a_count); + for (uint32_t i = 0; i < a_count; i++) { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->address_string(), @@ -1234,7 +1234,7 @@ class QueryAnyWrap: public QueryWrap { ret->Set(context, i, obj).FromJust(); } } else { - for (int i = 0; i < a_count; i++) { + for (uint32_t i = 0; i < a_count; i++) { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->value_string(), @@ -1258,13 +1258,13 @@ class QueryAnyWrap: public QueryWrap { ret, addr6ttls, &naddr6ttls); - int aaaa_count = ret->Length() - a_count; + uint32_t aaaa_count = ret->Length() - a_count; if (status != ARES_SUCCESS && status != ARES_ENODATA) { ParseError(status); return; } - CHECK_EQ(aaaa_count, naddr6ttls); + CHECK_EQ(aaaa_count, static_cast(naddr6ttls)); CHECK_EQ(ret->Length(), a_count + aaaa_count); for (uint32_t i = a_count; i < ret->Length(); i++) { Local obj = Object::New(env()->isolate()); -- cgit v1.2.3