From: Ruben Kerkhof Date: Tue, 29 May 2018 09:25:10 +0000 (+0200) Subject: ipmi plugin: fix sign compare warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c4aa1d3762ad3465a247a581a79a7c9be18bd421;p=collectd.git ipmi plugin: fix sign compare warning CC src/ipmi_la-ipmi.lo src/ipmi.c: In function ‘sensor_unit_to_type’: src/ipmi.c:360:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] for (int i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++) ^ --- diff --git a/src/ipmi.c b/src/ipmi.c index 67fd949c..3037beb7 100644 --- a/src/ipmi.c +++ b/src/ipmi.c @@ -357,7 +357,7 @@ static const char *sensor_unit_to_type(ipmi_sensor_t *sensor) { /* find the db type by using sensor base unit type */ enum ipmi_unit_type_e ipmi_type = ipmi_sensor_get_base_unit(sensor); - for (int i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++) + for (size_t i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++) if (ipmi_db_type_map[i].type == ipmi_type) return ipmi_db_type_map[i].type_name;