ipmi plugin: fix sign compare warning
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 29 May 2018 09:25:10 +0000 (11:25 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 29 May 2018 09:25:10 +0000 (11:25 +0200)
  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++)
                     ^

src/ipmi.c

index 67fd949..3037beb 100644 (file)
@@ -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;