@@ -252,7 +252,7 @@ uint16_t DNSClient::BuildRequest(const char* aName)
252252}
253253
254254
255- uint16_t DNSClient::ProcessResponse (int aTimeout, IPAddress& aAddress)
255+ uint16_t DNSClient::ProcessResponse (uint16_t aTimeout, IPAddress& aAddress)
256256{
257257 uint32_t startTime = millis ();
258258
@@ -285,7 +285,7 @@ uint16_t DNSClient::ProcessResponse(int aTimeout, IPAddress& aAddress)
285285 uint16_t header_flags = htons (*((uint16_t *)&header[2 ]));
286286 // Check that it's a response to this request
287287 if ( ( iRequestId != (*((uint16_t *)&header[0 ])) ) ||
288- (header_flags & QUERY_RESPONSE_MASK != RESPONSE_FLAG) )
288+ (( header_flags & QUERY_RESPONSE_MASK) != ( uint16_t ) RESPONSE_FLAG) )
289289 {
290290 // Mark the entire packet as read
291291 iUdp.flush ();
@@ -310,7 +310,7 @@ uint16_t DNSClient::ProcessResponse(int aTimeout, IPAddress& aAddress)
310310 }
311311
312312 // Skip over any questions
313- for (int i =0 ; i < htons (*((uint16_t *)&header[4 ])); i++)
313+ for (uint16_t i =0 ; i < htons (*((uint16_t *)&header[4 ])); i++)
314314 {
315315 // Skip over the name
316316 uint8_t len;
@@ -340,7 +340,7 @@ uint16_t DNSClient::ProcessResponse(int aTimeout, IPAddress& aAddress)
340340 // type A answer) and some authority and additional resource records but
341341 // we're going to ignore all of them.
342342
343- for (int i =0 ; i < answerCount; i++)
343+ for (uint16_t i =0 ; i < answerCount; i++)
344344 {
345345 // Skip the name
346346 uint8_t len;
@@ -407,7 +407,7 @@ uint16_t DNSClient::ProcessResponse(int aTimeout, IPAddress& aAddress)
407407 else
408408 {
409409 // This isn't an answer type we're after, move onto the next one
410- for (int i =0 ; i < htons (header_flags); i++)
410+ for (uint16_t i =0 ; i < htons (header_flags); i++)
411411 {
412412 iUdp.read (); // we don't care about the returned byte
413413 }
0 commit comments