libcollectdclient: fix compiler warning on Solaris
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 24 Jul 2016 19:23:59 +0000 (21:23 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 24 Jul 2016 19:25:55 +0000 (21:25 +0200)
  CC     libcollectdclient_la-client.lo
"client.c", line 1104: argument #4 is incompatible with prototype:
        prototype: pointer to function(pointer to const void, pointer to const void) returning int : "/usr/include/iso/stdlib_iso.h", line 134
        argument : pointer to void

src/libcollectdclient/client.c
src/libcollectdclient/collectd/client.h

index 26a5929..77fd576 100644 (file)
@@ -1062,9 +1062,11 @@ int lcc_string_to_identifier (lcc_connection_t *c, /* {{{ */
   return (0);
 } /* }}} int lcc_string_to_identifier */
 
-int lcc_identifier_compare (const lcc_identifier_t *i0, /* {{{ */
-    const lcc_identifier_t *i1)
+int lcc_identifier_compare (const void *a, /* {{{ */
+    const void *b)
 {
+  const lcc_identifier_t *i0 = a;
+  const lcc_identifier_t *i1 = b;
   int status;
 
   if ((i0 == NULL) && (i1 == NULL))
@@ -1101,7 +1103,7 @@ int lcc_sort_identifiers (lcc_connection_t *c, /* {{{ */
   }
 
   qsort (idents, idents_num, sizeof (*idents),
-      (void *) lcc_identifier_compare);
+      lcc_identifier_compare);
   return (0);
 } /* }}} int lcc_sort_identifiers */
 
index 6ae8598..ac26b84 100644 (file)
@@ -124,8 +124,8 @@ int lcc_string_to_identifier (lcc_connection_t *c,
 /* Compares the identifiers "i0" and "i1" and returns less than zero or greater
  * than zero if "i0" is smaller than or greater than "i1", respectively. If
  * "i0" and "i1" are identical, zero is returned. */
-int lcc_identifier_compare (const lcc_identifier_t *i0,
-    const lcc_identifier_t *i1);
+int lcc_identifier_compare (const void *i0,
+    const void *i1);
 int lcc_sort_identifiers (lcc_connection_t *c,
     lcc_identifier_t *idents, size_t idents_num);