aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2017-09-26 16:28:02 +0100
committerJoão Valverde <j@v6e.pt>2017-09-26 17:28:10 +0000
commit221a2bcbd0bd9fc04eacbe223f9118cabecccac1 (patch)
treea1ac7c9901d4c2f3ed2e9293e48e5e0003a087f3 /wiretap
parentcd6ca0da41ce2af151670486e724d47870705d44 (diff)
Move some DIAG_OFFs to make code less ugly
Change-Id: I0f343ab69a6592a466e12e5d258f0878b9c32c25 Reviewed-on: https://code.wireshark.org/review/23752 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/wtap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 64c10156eb..4354600f9d 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -51,10 +51,12 @@ static GSList *wtap_plugins = NULL;
/*
* Callback for each plugin found.
*/
+DIAG_OFF(pedantic)
static gboolean
check_for_wtap_plugin(GModule *handle)
{
gpointer gp;
+ void (*register_wtap_module)(void);
wtap_plugin *plugin;
/*
@@ -67,15 +69,18 @@ check_for_wtap_plugin(GModule *handle)
/*
* Yes - this plugin includes one or more wiretap modules.
+ */
+ register_wtap_module = (void (*)(void))gp;
+
+ /*
* Add this one to the list of wiretap module plugins.
*/
plugin = (wtap_plugin *)g_malloc(sizeof (wtap_plugin));
-DIAG_OFF(pedantic)
- plugin->register_wtap_module = (void (*)(void))gp;
-DIAG_ON(pedantic)
+ plugin->register_wtap_module = register_wtap_module;
wtap_plugins = g_slist_prepend(wtap_plugins, plugin);
return TRUE;
}
+DIAG_ON(pedantic)
static void
wtap_register_plugin_types(void)