diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2017-01-18 22:03:54 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-01-19 04:39:32 +0000 |
commit | b3432de4cfc496948921bc83840fefbdef22c28c (patch) | |
tree | 9e503bd895628b0bae13db4c95e97c034d333d7e | |
parent | d04b5cd362be82bf685fde65af67e73c5a8ca0e4 (diff) | |
download | wireshark-b3432de4cfc496948921bc83840fefbdef22c28c.tar.gz wireshark-b3432de4cfc496948921bc83840fefbdef22c28c.tar.bz2 wireshark-b3432de4cfc496948921bc83840fefbdef22c28c.zip |
packet.c: use call_routine() for all lists
For running through the postseq cleanup and final registration lists, we
can use the same dummy function call_routine() that is used for the init
and the cleanup lists. We don't need our own copies.
Change-Id: Ia1ea647d5831adda26dab86eceba8fcf704ce122
Reviewed-on: https://code.wireshark.org/review/19668
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/packet.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/epan/packet.c b/epan/packet.c index ce855aff71..647ec1afc9 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -266,7 +266,6 @@ register_cleanup_routine(void (*func)(void)) typedef void (*void_func_t)(void); -/* Initialize all data structures used for dissection. */ static void call_routine(gpointer routine, gpointer dummy _U_) { @@ -274,6 +273,7 @@ call_routine(gpointer routine, gpointer dummy _U_) (*func)(); } +/* Initialize all data structures used for dissection. */ void init_dissection(void) { @@ -338,18 +338,11 @@ register_postseq_cleanup_routine(void_func_t func) } /* Call all the registered "postseq_cleanup" routines. */ -static void -call_postseq_cleanup_routine(gpointer routine, gpointer dummy _U_) -{ - void_func_t func = (void_func_t)routine; - (*func)(); -} - void postseq_cleanup_all_protocols(void) { g_slist_foreach(postseq_cleanup_routines, - &call_postseq_cleanup_routine, NULL); + &call_routine, NULL); } /* @@ -431,19 +424,11 @@ register_final_registration_routine(void (*func)(void)) } /* Call all the registered "final_registration" routines. */ -static void -call_final_registration_routine(gpointer routine, gpointer dummy _U_) -{ - void_func_t func = (void_func_t)routine; - - (*func)(); -} - void final_registration_all_protocols(void) { g_slist_foreach(final_registration_routines, - &call_final_registration_routine, NULL); + &call_routine, NULL); } |