From e906ccdb0f0f7671551b16c7a91bd67447f393d3 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 24 Jul 2016 21:23:59 +0200 Subject: [PATCH] libcollectdclient: fix compiler warning on Solaris 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 | 8 +++++--- src/libcollectdclient/collectd/client.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 26a59297..77fd576e 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -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 */ diff --git a/src/libcollectdclient/collectd/client.h b/src/libcollectdclient/collectd/client.h index 6ae85984..ac26b848 100644 --- a/src/libcollectdclient/collectd/client.h +++ b/src/libcollectdclient/collectd/client.h @@ -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); -- 2.30.2