return ENOENT;
}
- void (*reg_handle)(void) = dlsym(dlh, "module_register");
+ void (*reg_handle)(void) = (void *)dlsym(dlh, "module_register");
if (reg_handle == NULL) {
ERROR("Couldn't find symbol \"module_register\" in \"%s\": %s\n", file,
dlerror());
old_ctx = plugin_set_ctx(rf->rf_ctx);
if (rf_type == RF_SIMPLE) {
- int (*callback)(void);
+ int (*callback)(void) = (void *)rf->rf_callback;
- callback = rf->rf_callback;
status = (*callback)();
} else {
- plugin_read_cb callback;
-
assert(rf_type == RF_COMPLEX);
- callback = rf->rf_callback;
+ plugin_read_cb callback = (void *)rf->rf_callback;
status = (*callback)(&rf->rf_udata);
}
* callback. */
le = llist_head(list_init);
while (le != NULL) {
- callback_func_t *cf;
- plugin_init_cb callback;
- plugin_ctx_t old_ctx;
-
- cf = le->value;
- old_ctx = plugin_set_ctx(cf->cf_ctx);
- callback = cf->cf_callback;
+ callback_func_t *cf = le->value;
+ plugin_ctx_t old_ctx = plugin_set_ctx(cf->cf_ctx);
+ plugin_init_cb callback = (void *)cf->cf_callback;
status = (*callback)();
plugin_set_ctx(old_ctx);
old_ctx = plugin_set_ctx(rf->rf_ctx);
if (rf->rf_type == RF_SIMPLE) {
- int (*callback)(void);
-
- callback = rf->rf_callback;
+ int (*callback)(void) = (void *)rf->rf_callback;
status = (*callback)();
} else {
- plugin_read_cb callback;
-
- callback = rf->rf_callback;
+ plugin_read_cb callback = (void *)rf->rf_callback;
status = (*callback)(&rf->rf_udata);
}
le = llist_head(list_write);
while (le != NULL) {
callback_func_t *cf = le->value;
- plugin_write_cb callback;
/* Keep the read plugin's interval and flush information but update the
* plugin name. */
plugin_set_ctx(ctx);
DEBUG("plugin: plugin_write: Writing values via %s.", le->key);
- callback = cf->cf_callback;
+ plugin_write_cb callback = (void *)cf->cf_callback;
status = (*callback)(fam, &cf->cf_udata);
if (status != 0)
failure++;
status = 0;
} else /* plugin != NULL */
{
- callback_func_t *cf;
- plugin_write_cb callback;
-
le = llist_head(list_write);
while (le != NULL) {
if (strcasecmp(plugin, le->key) == 0)
if (le == NULL)
return ENOENT;
- cf = le->value;
+ callback_func_t *cf = le->value;
/* do not switch plugin context; rather keep the context (interval)
* information of the calling read plugin */
DEBUG("plugin: plugin_write: Writing values via %s.", le->key);
- callback = cf->cf_callback;
+ plugin_write_cb callback = (void *)cf->cf_callback;
status = (*callback)(fam, &cf->cf_udata);
}
le = llist_head(list_flush);
while (le != NULL) {
- callback_func_t *cf;
- plugin_flush_cb callback;
- plugin_ctx_t old_ctx;
-
if ((plugin != NULL) && (strcmp(plugin, le->key) != 0)) {
le = le->next;
continue;
}
- cf = le->value;
- old_ctx = plugin_set_ctx(cf->cf_ctx);
- callback = cf->cf_callback;
+ callback_func_t *cf = le->value;
+ plugin_ctx_t old_ctx = plugin_set_ctx(cf->cf_ctx);
+ plugin_flush_cb callback = (void *)cf->cf_callback;
(*callback)(timeout, identifier, &cf->cf_udata);
le = llist_head(list_shutdown);
while (le != NULL) {
- callback_func_t *cf;
- plugin_shutdown_cb callback;
- plugin_ctx_t old_ctx;
-
- cf = le->value;
- old_ctx = plugin_set_ctx(cf->cf_ctx);
- callback = cf->cf_callback;
+ callback_func_t *cf = le->value;
+ plugin_ctx_t old_ctx = plugin_set_ctx(cf->cf_ctx);
+ plugin_shutdown_cb callback = (void *)cf->cf_callback;
/* Advance the pointer before calling the callback allows
* shutdown functions to unregister themselves. If done the
le = llist_head(list_log);
while (le != NULL) {
- callback_func_t *cf;
- plugin_log_cb callback;
-
- cf = le->value;
- callback = cf->cf_callback;
+ callback_func_t *cf = le->value;
+ plugin_log_cb callback = (void *)cf->cf_callback;
/* do not switch plugin context; rather keep the context
* (interval) information of the calling plugin */