From: Ruben Kerkhof Date: Tue, 29 May 2018 09:29:52 +0000 (+0200) Subject: dpdkevents plugin: fix sign compare warnings X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=6eb269f494c039f1ff94f4771ac7ebf9f2783cba;hp=c4aa1d3762ad3465a247a581a79a7c9be18bd421 dpdkevents plugin: fix sign compare warnings src/dpdkevents.c: In function ‘dpdk_helper_link_status_get’: src/dpdkevents.c:431:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] for (int i = 0; i < ec->nb_ports; i++) { ^ src/dpdkevents.c: In function ‘dpdk_events_link_status_dispatch’: src/dpdkevents.c:500:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] for (int i = 0; i < ec->nb_ports; i++) { ^ --- diff --git a/src/dpdkevents.c b/src/dpdkevents.c index 6fd642ba..9970be0c 100644 --- a/src/dpdkevents.c +++ b/src/dpdkevents.c @@ -428,7 +428,7 @@ static int dpdk_helper_link_status_get(dpdk_helper_ctx_t *phc) { } ec->nb_ports = nb_ports > RTE_MAX_ETHPORTS ? RTE_MAX_ETHPORTS : nb_ports; - for (int i = 0; i < ec->nb_ports; i++) { + for (unsigned int i = 0; i < ec->nb_ports; i++) { if (ec->config.link_status.enabled_port_mask & (1 << i)) { struct rte_eth_link link; ec->link_info[i].read_time = cdtime(); @@ -497,7 +497,7 @@ static int dpdk_events_link_status_dispatch(dpdk_helper_ctx_t *phc) { ec->nb_ports); /* dispatch Link Status values to collectd */ - for (int i = 0; i < ec->nb_ports; i++) { + for (unsigned int i = 0; i < ec->nb_ports; i++) { if (ec->config.link_status.enabled_port_mask & (1 << i)) { if (!ec->config.link_status.send_updated || ec->link_info[i].status_updated) {