summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39a4590)
raw | patch | inline | side by side (parent: 39a4590)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 23 Feb 2014 20:37:07 +0000 (12:37 -0800) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 23 Feb 2014 20:37:07 +0000 (12:37 -0800) |
src/core/plugin.c | patch | blob | history | |
t/utils/unixsock_test.c | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 559e6eb4d7db1aa803a55783025d2dc4a8ee6afb..92440a5e69e913ebc8b63f1da8ccb0f370dffb45 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
sdb_plugin_register_config(const char *name, sdb_plugin_config_cb callback)
{
return plugin_add_callback(&config_list, "init", name,
- callback, NULL);
+ (void *)callback, NULL);
} /* sdb_plugin_register_config */
int
sdb_object_t *user_data)
{
return plugin_add_callback(&init_list, "init", name,
- callback, user_data);
+ (void *)callback, user_data);
} /* sdb_plugin_register_init */
int
@@ -594,14 +594,14 @@ sdb_plugin_register_shutdown(const char *name, sdb_plugin_shutdown_cb callback,
sdb_object_t *user_data)
{
return plugin_add_callback(&shutdown_list, "shutdown", name,
- callback, user_data);
+ (void *)callback, user_data);
} /* sdb_plugin_register_shutdown */
int
sdb_plugin_register_log(const char *name, sdb_plugin_log_cb callback,
sdb_object_t *user_data)
{
- return plugin_add_callback(&log_list, "log", name, callback,
+ return plugin_add_callback(&log_list, "log", name, (void *)callback,
user_data);
} /* sdb_plugin_register_log */
sdb_plugin_register_cname(const char *name, sdb_plugin_cname_cb callback,
sdb_object_t *user_data)
{
- return plugin_add_callback(&cname_list, "cname", name, callback,
+ return plugin_add_callback(&cname_list, "cname", name, (void *)callback,
user_data);
} /* sdb_plugin_register_cname */
}
old_ctx = ctx_set(plugin->cb_ctx);
- callback = plugin->cb_callback;
+ callback = (sdb_plugin_config_cb)plugin->cb_callback;
status = callback(ci);
ctx_set(old_ctx);
return status;
assert(obj);
cb = SDB_PLUGIN_CB(obj);
- callback = cb->cb_callback;
+ callback = (sdb_plugin_init_cb)cb->cb_callback;
old_ctx = ctx_set(cb->cb_ctx);
if (callback(cb->cb_user_data)) {
if (! obj)
return -1;
- callback = SDB_PLUGIN_CCB(obj)->ccb_callback;
+ callback = (sdb_plugin_collector_cb)SDB_PLUGIN_CCB(obj)->ccb_callback;
if (! (now = sdb_gettime())) {
char errbuf[1024];
sdb_object_t *obj = sdb_llist_iter_get_next(iter);
assert(obj);
- callback = SDB_PLUGIN_CB(obj)->cb_callback;
+ callback = (sdb_plugin_cname_cb)SDB_PLUGIN_CB(obj)->cb_callback;
cname = callback(hostname, SDB_PLUGIN_CB(obj)->cb_user_data);
if (cname) {
free(hostname);
sdb_object_t *obj = sdb_llist_iter_get_next(iter);
assert(obj);
- callback = SDB_PLUGIN_CB(obj)->cb_callback;
+ callback = (sdb_plugin_log_cb)SDB_PLUGIN_CB(obj)->cb_callback;
tmp = callback(prio, msg, SDB_PLUGIN_CB(obj)->cb_user_data);
if (tmp > ret)
ret = tmp;
index 4f1e0429e67ca338156597183fe2f6942b28bbcb..4502767868051bfb6ff33466b65f83283c0acdb8 100644 (file)
--- a/t/utils/unixsock_test.c
+++ b/t/utils/unixsock_test.c
* to use the original implementation */
if (fd != myfd) {
void *libc = dlopen_libc();
- FILE *(*orig_fdopen)(int, const char *) = dlsym(libc, "fdopen");
+ FILE *(*orig_fdopen)(int, const char *);
+
+ orig_fdopen = (FILE *(*)(int, const char *))dlsym(libc, "fdopen");
if (! orig_fdopen)
fail("INTERNAL ERROR: failed to load fdopen() from libc");