mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 12:02:11 +02:00
global: fix sign-compare warnings
* Original commit: espressif/esp-idf@753a929525
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
2cf9fd8891
commit
1fe901f70f
@ -1605,7 +1605,7 @@ static void _mdns_init_pcb_probe(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_proto
|
|||||||
mdns_srv_item_t * new_probe_services[len];
|
mdns_srv_item_t * new_probe_services[len];
|
||||||
int new_probe_service_len = 0;
|
int new_probe_service_len = 0;
|
||||||
bool found;
|
bool found;
|
||||||
for (int j=0; j < len; ++j) {
|
for (size_t j=0; j < len; ++j) {
|
||||||
found = false;
|
found = false;
|
||||||
for (int i=0; i < pcb->probe_services_len; ++i) {
|
for (int i=0; i < pcb->probe_services_len; ++i) {
|
||||||
if (pcb->probe_services[i] == services[j]) {
|
if (pcb->probe_services[i] == services[j]) {
|
||||||
@ -2508,11 +2508,10 @@ static int _mdns_txt_items_count_get(const uint8_t * data, size_t len)
|
|||||||
*/
|
*/
|
||||||
static int _mdns_txt_item_name_get_len(const uint8_t * data, size_t len)
|
static int _mdns_txt_item_name_get_len(const uint8_t * data, size_t len)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
if (*data == '=') {
|
if (*data == '=') {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
if (data[i] == '=') {
|
if (data[i] == '=') {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -3483,7 +3482,6 @@ static void _mdns_search_result_add_srv(mdns_search_once_t * search, const char
|
|||||||
*/
|
*/
|
||||||
static void _mdns_search_result_add_txt(mdns_search_once_t * search, mdns_txt_item_t * txt, size_t txt_count, mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
static void _mdns_search_result_add_txt(mdns_search_once_t * search, mdns_txt_item_t * txt, size_t txt_count, mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
mdns_result_t * r = search->result;
|
mdns_result_t * r = search->result;
|
||||||
while (r) {
|
while (r) {
|
||||||
if (r->tcpip_if == tcpip_if && r->ip_protocol == ip_protocol) {
|
if (r->tcpip_if == tcpip_if && r->ip_protocol == ip_protocol) {
|
||||||
@ -3515,7 +3513,7 @@ static void _mdns_search_result_add_txt(mdns_search_once_t * search, mdns_txt_it
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
free_txt:
|
free_txt:
|
||||||
for (i=0; i<txt_count; i++) {
|
for (size_t i=0; i<txt_count; i++) {
|
||||||
free((char *)(txt[i].key));
|
free((char *)(txt[i].key));
|
||||||
free((char *)(txt[i].value));
|
free((char *)(txt[i].value));
|
||||||
}
|
}
|
||||||
@ -4702,7 +4700,6 @@ void mdns_query_results_free(mdns_result_t * results)
|
|||||||
{
|
{
|
||||||
mdns_result_t * r;
|
mdns_result_t * r;
|
||||||
mdns_ip_addr_t * a;
|
mdns_ip_addr_t * a;
|
||||||
int i;
|
|
||||||
|
|
||||||
while (results) {
|
while (results) {
|
||||||
r = results;
|
r = results;
|
||||||
@ -4710,7 +4707,7 @@ void mdns_query_results_free(mdns_result_t * results)
|
|||||||
free((char *)(r->hostname));
|
free((char *)(r->hostname));
|
||||||
free((char *)(r->instance_name));
|
free((char *)(r->instance_name));
|
||||||
|
|
||||||
for (i=0; i<r->txt_count; i++) {
|
for (size_t i=0; i<r->txt_count; i++) {
|
||||||
free((char *)(r->txt[i].key));
|
free((char *)(r->txt[i].key));
|
||||||
free((char *)(r->txt[i].value));
|
free((char *)(r->txt[i].value));
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ static void mdns_print_results(mdns_result_t * results)
|
|||||||
{
|
{
|
||||||
mdns_result_t * r = results;
|
mdns_result_t * r = results;
|
||||||
mdns_ip_addr_t * a = NULL;
|
mdns_ip_addr_t * a = NULL;
|
||||||
int i = 1, t;
|
int i = 1;
|
||||||
while (r) {
|
while (r) {
|
||||||
printf("%d: Interface: %s, Type: %s\n", i++, if_str[r->tcpip_if], ip_protocol_str[r->ip_protocol]);
|
printf("%d: Interface: %s, Type: %s\n", i++, if_str[r->tcpip_if], ip_protocol_str[r->ip_protocol]);
|
||||||
if (r->instance_name) {
|
if (r->instance_name) {
|
||||||
@ -35,7 +35,7 @@ static void mdns_print_results(mdns_result_t * results)
|
|||||||
}
|
}
|
||||||
if (r->txt_count) {
|
if (r->txt_count) {
|
||||||
printf(" TXT : [%u] ", r->txt_count);
|
printf(" TXT : [%u] ", r->txt_count);
|
||||||
for (t=0; t<r->txt_count; t++) {
|
for (size_t t=0; t<r->txt_count; t++) {
|
||||||
printf("%s=%s; ", r->txt[t].key, r->txt[t].value);
|
printf("%s=%s; ", r->txt[t].key, r->txt[t].value);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Reference in New Issue
Block a user