summaryrefslogtreecommitdiff
path: root/epan/plugins.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-01-02 04:01:00 +0000
committerGuy Harris <guy@alum.mit.edu>2005-01-02 04:01:00 +0000
commitbc7a4459e1937316b4edef4a9c95fc14cb04e688 (patch)
treee713bafa07650f1c611fdd9b99f92962fcc83dbc /epan/plugins.c
parentc1e2dc025b28d5ae050a4dbbe1ecd7918f5a1aaf (diff)
downloadwireshark-bc7a4459e1937316b4edef4a9c95fc14cb04e688.tar.gz
Don't cast pointers passed as arguments - pass a pointer to the right
type of variable and assign the value; that squelches "dereferencing type-punned pointer will break strict-aliasing rules" warnings from some versions of GCC. svn path=/trunk/; revision=12924
Diffstat (limited to 'epan/plugins.c')
-rw-r--r--epan/plugins.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/plugins.c b/epan/plugins.c
index c2edfda9b3..6b9b2eb6f9 100644
--- a/epan/plugins.c
+++ b/epan/plugins.c
@@ -167,6 +167,7 @@ plugins_scan_dir(const char *dirname)
gchar filename[FILENAME_LEN]; /* current file name */
GModule *handle; /* handle returned by dlopen */
gchar *version;
+ gpointer gp;
void (*init)(void *);
void (*reg_handoff)(void);
gchar *dot;
@@ -232,12 +233,13 @@ plugins_scan_dir(const char *dirname)
g_module_error());
continue;
}
- if (g_module_symbol(handle, "version", (gpointer*)&version) == FALSE)
+ if (!g_module_symbol(handle, "version", &gp))
{
g_warning("The plugin %s has no version symbol", name);
g_module_close(handle);
continue;
}
+ version = gp;
/*
* Old-style dissectors don't have a "plugin_reg_handoff()"
@@ -246,19 +248,21 @@ plugins_scan_dir(const char *dirname)
* New-style dissectors have one, because, otherwise, there's
* no way for them to arrange that they ever be called.
*/
- if (g_module_symbol(handle, "plugin_reg_handoff",
- (gpointer*)&reg_handoff))
+ if (g_module_symbol(handle, "plugin_reg_handoff", &gp))
{
+ reg_handoff = gp;
+
/*
* We require it to have a "plugin_init()" routine.
*/
- if (!g_module_symbol(handle, "plugin_init", (gpointer*)&init))
+ if (!g_module_symbol(handle, "plugin_init", &gp))
{
g_warning("The plugin %s has a plugin_reg_handoff symbol but no plugin_init routine",
name);
g_module_close(handle);
continue;
}
+ init = gp;
/*
* We have a "plugin_reg_handoff()" routine, so we don't