Merge remote-tracking branch 'github/pr/1883'
[collectd.git] / src / zone.c
index 40c4d2e..d9e46f5 100644 (file)
@@ -31,6 +31,7 @@
 #endif
 
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 
@@ -48,11 +49,11 @@ typedef struct zone_stats {
 } zone_stats_t;
 
 static int
-zone_compare(const zoneid_t *a, const zoneid_t *b)
+zone_compare(const void *a, const void *b)
 {
-       if (*a == *b)
+       if (*(const zoneid_t *)a == *(const zoneid_t *)b)
                return(0);
-       if (*a < *b)
+       if (*(const zoneid_t *)a < *(const zoneid_t *)b)
                return(-1);
        return(1);
 }
@@ -133,7 +134,7 @@ zone_submit_values(c_avl_tree_t *tree)
        while (c_avl_pick (tree, (void **)&zoneid, (void **)&stats) == 0)
        {
                if (getzonenamebyid(*zoneid, zonename, sizeof( zonename )) == -1) {
-                       WARNING("zone plugin: error retreiving zonename");
+                       WARNING("zone plugin: error retrieving zonename");
                } else {
                        zone_submit_value(zonename, (gauge_t)FRC2PCT(stats->pctcpu));
                }
@@ -152,7 +153,7 @@ zone_scandir(DIR *procdir)
        c_avl_tree_t *tree;
        zone_stats_t *stats;
 
-       if (!(tree=c_avl_create((void *) zone_compare))) {
+       if (!(tree=c_avl_create(zone_compare))) {
                WARNING("zone plugin: Failed to create tree");
                return(NULL);
        }