summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2003-11-16 17:57:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2003-11-16 17:57:44 +0000
commitd6fe016c78e675a3d9844dea02eac6b38f6caf59 (patch)
treed379a3e0c83f3350305119ced35a0abfa9866155 /src
parent43b0d36ee182f48cd655187a63411045aa04c948 (diff)
downloadirssi-d6fe016c78e675a3d9844dea02eac6b38f6caf59.zip
Fixed some gcc aliasing warnings
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3147 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/expandos.c7
-rw-r--r--src/core/modules-load.c8
-rw-r--r--src/core/modules.c12
3 files changed, 17 insertions, 10 deletions
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);