summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a08316a)
raw | patch | inline | side by side (parent: a08316a)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sun, 24 Jul 2016 16:43:38 +0000 (18:43 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sun, 24 Jul 2016 16:46:04 +0000 (18:46 +0200) |
Fixes the following warning on Solaris:
|c_avl_tree_t *c_avl_create (int (*compare) (const void *, const
void *));
| ^ line 54, utils_avltree.h
| included in line 34, utils_vl_lookup.c
|
| obj->by_type_tree = c_avl_create ((void *) strcmp);
| ^ line 567,
utils_vl_lookup.c
E_ARG_INCOMPATIBLE_WITH_ARG_L, argument #1 is incompatible with
prototype:
prototype: pointer to function(pointer to const void, pointer to
const void) returning int : "src/daemon/utils_avltree.h", line 54
argument : pointer to void
I'll look into writing a generic function to compare avl keys so
we don't need to do all the casting.
|c_avl_tree_t *c_avl_create (int (*compare) (const void *, const
void *));
| ^ line 54, utils_avltree.h
| included in line 34, utils_vl_lookup.c
|
| obj->by_type_tree = c_avl_create ((void *) strcmp);
| ^ line 567,
utils_vl_lookup.c
E_ARG_INCOMPATIBLE_WITH_ARG_L, argument #1 is incompatible with
prototype:
prototype: pointer to function(pointer to const void, pointer to
const void) returning int : "src/daemon/utils_avltree.h", line 54
argument : pointer to void
I'll look into writing a generic function to compare avl keys so
we don't need to do all the casting.
src/daemon/plugin.c | patch | blob | history | |
src/ethstat.c | patch | blob | history | |
src/gmond.c | patch | blob | history | |
src/statsd.c | patch | blob | history | |
src/threshold.c | patch | blob | history | |
src/utils_fbhash.c | patch | blob | history | |
src/utils_vl_lookup.c | patch | blob | history | |
src/zone.c | patch | blob | history |
diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c
index 3a2e28789270d8b011b6bb2f6d0057b55d1956f8..9258b885159072d6a9921bf71e9261f4afd3e9df 100644 (file)
--- a/src/daemon/plugin.c
+++ b/src/daemon/plugin.c
int status;
if (plugins_loaded == NULL)
- plugins_loaded = c_avl_create ((void *) strcasecmp);
+ plugins_loaded = c_avl_create ((int (*) (const void *, const void *)) strcasecmp);
assert (plugins_loaded != NULL);
status = c_avl_get (plugins_loaded, name, /* ret_value = */ NULL);
diff --git a/src/ethstat.c b/src/ethstat.c
index e10021c581155e4fe3887c8ecaaf4fbf4bbeee94..959737a368add51263a93c1caf6fb9cab4b7c3bb 100644 (file)
--- a/src/ethstat.c
+++ b/src/ethstat.c
if (value_map == NULL)
{
- value_map = c_avl_create ((void *) strcmp);
+ value_map = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (value_map == NULL)
{
sfree (map);
diff --git a/src/gmond.c b/src/gmond.c
index 70436d722501c0368d2b38d4835149915f6e0ef7..728162ec608c6ef76e36e15751608245390de4ad 100644 (file)
--- a/src/gmond.c
+++ b/src/gmond.c
(mc_receive_port != NULL) ? mc_receive_port : MC_RECEIVE_PORT_DEFAULT,
/* listen = */ 0);
- staging_tree = c_avl_create ((void *) strcmp);
+ staging_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (staging_tree == NULL)
{
ERROR ("gmond plugin: c_avl_create failed.");
diff --git a/src/statsd.c b/src/statsd.c
index 57cdbc557d1e9cb3d204286fbfb53431c2269061..a0c6e4f3e935117fd9f4c428a64072e7f007bdff 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
/* Make sure metric->set exists. */
if (metric->set == NULL)
- metric->set = c_avl_create ((void *) strcmp);
+ metric->set = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (metric->set == NULL)
{
{
pthread_mutex_lock (&metrics_lock);
if (metrics_tree == NULL)
- metrics_tree = c_avl_create ((void *) strcmp);
+ metrics_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (!network_thread_running)
{
diff --git a/src/threshold.c b/src/threshold.c
index d9d7f9e2ebc936783d8c457385f9f4e5d27f5219..77ba3f324b6e425afb4233fe0526b1cb86afdf8c 100644 (file)
--- a/src/threshold.c
+++ b/src/threshold.c
if (threshold_tree == NULL)
{
- threshold_tree = c_avl_create ((void *) strcmp);
+ threshold_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (threshold_tree == NULL)
{
ERROR ("ut_config: c_avl_create failed.");
diff --git a/src/utils_fbhash.c b/src/utils_fbhash.c
index 41f640af5a835652b73fb943523cb352dff726fd..d1a580cd632420d0ab25e9a6186d5210e63d6b55 100644 (file)
--- a/src/utils_fbhash.c
+++ b/src/utils_fbhash.c
return (-1);
}
- tree = c_avl_create ((void *) strcmp);
+ tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (tree == NULL)
{
fclose (fh);
diff --git a/src/utils_vl_lookup.c b/src/utils_vl_lookup.c
index 8a2e5671110f196e9ba72166303d9fbd436826b9..6081c90ef29d24801ce2f36c8062e61be9d2824c 100644 (file)
--- a/src/utils_vl_lookup.c
+++ b/src/utils_vl_lookup.c
}
by_type->wildcard_plugin_list = NULL;
- by_type->by_plugin_tree = c_avl_create ((void *) strcmp);
+ by_type->by_plugin_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (by_type->by_plugin_tree == NULL)
{
ERROR ("utils_vl_lookup: c_avl_create failed.");
return (NULL);
}
- obj->by_type_tree = c_avl_create ((void *) strcmp);
+ obj->by_type_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
if (obj->by_type_tree == NULL)
{
ERROR ("utils_vl_lookup: c_avl_create failed.");
diff --git a/src/zone.c b/src/zone.c
index 40c4d2ee5a3dad252f5a40d59bd883f0a419f434..87c65172292c6630a775a369be158bc9bf53e6f3 100644 (file)
--- a/src/zone.c
+++ b/src/zone.c
} 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);
}
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);
}