diff --git a/src/core/expandos.c b/src/core/expandos.c index e259c50f..6a1f3503 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -133,7 +133,7 @@ void expando_add_signal(const char *key, const char *signal, ExpandoArg arg) /* Destroy expando */ void expando_destroy(const char *key, EXPANDO_FUNC func) { - gpointer origkey; + gpointer origkey, value; EXPANDO_REC *rec; g_return_if_fail(key != NULL || *key == '\0'); @@ -146,8 +146,9 @@ void expando_destroy(const char *key, EXPANDO_FUNC func) char_expandos[(int) (unsigned char) *key] = NULL; g_free(rec); } - } else if (g_hash_table_lookup_extended(expandos, key, &origkey, - (gpointer *) &rec)) { + } else if (g_hash_table_lookup_extended(expandos, key, + &origkey, &value)) { + rec = value; if (rec->func == func) { g_hash_table_remove(expandos, key); g_free(origkey); diff --git a/src/core/modules-load.c b/src/core/modules-load.c index 7b90d802..2ae029e8 100644 --- a/src/core/modules-load.c +++ b/src/core/modules-load.c @@ -163,6 +163,7 @@ static int module_load_name(const char *path, const char *rootmodule, GModule *gmodule; MODULE_REC *module; MODULE_FILE_REC *rec; + gpointer value1, value2; char *initfunc, *deinitfunc; int found; @@ -178,11 +179,14 @@ static int module_load_name(const char *path, const char *rootmodule, /* get the module's init() and deinit() functions */ initfunc = module_get_func(rootmodule, submodule, "init"); deinitfunc = module_get_func(rootmodule, submodule, "deinit"); - found = g_module_symbol(gmodule, initfunc, (gpointer *) &module_init) && - g_module_symbol(gmodule, deinitfunc, (gpointer *) &module_deinit); + found = g_module_symbol(gmodule, initfunc, &value1) && + g_module_symbol(gmodule, deinitfunc, &value2); g_free(initfunc); g_free(deinitfunc); + module_init = value1; + module_deinit = value2; + if (!found) { module_error(MODULE_ERROR_INVALID, NULL, rootmodule, submodule); diff --git a/src/core/modules.c b/src/core/modules.c index dc373189..a04e31cc 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -177,10 +177,11 @@ static void uniq_destroy_str(gpointer key, gpointer value) void module_uniq_destroy(const char *module) { GHashTable *idlist; - gpointer key; + gpointer key, value; + + if (g_hash_table_lookup_extended(idlookup, module, &key, &value)) { + idlist = value; - if (g_hash_table_lookup_extended(idlookup, module, &key, - (gpointer *) &idlist)) { g_hash_table_remove(idlookup, key); g_free(key); @@ -188,8 +189,9 @@ void module_uniq_destroy(const char *module) g_hash_table_destroy(idlist); } - if (g_hash_table_lookup_extended(stridlookup, module, &key, - (gpointer *) &idlist)) { + if (g_hash_table_lookup_extended(stridlookup, module, &key, &value)) { + idlist = value; + g_hash_table_remove(stridlookup, key); g_free(key);