diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-08-26 01:19:34 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2018-08-26 00:44:19 +0000 |
commit | ca339d7e7fdcbc5eb766eabbe09a1bb480e7fdb4 (patch) | |
tree | a4f66d9e45f72bb6cc0525b29e331f7d2016ee7b | |
parent | d0b97a420d557042938ac5d6bf075fcd84df9371 (diff) |
Remove weird use of volatile qualifier
Change-Id: I47232912aea16f27ebdbd61940526dbcec5a387c
Reviewed-on: https://code.wireshark.org/review/29285
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
-rw-r--r-- | epan/tap.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/epan/tap.c b/epan/tap.c index c0b1dbf629..ff51755067 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -79,7 +79,7 @@ static tap_packet_t tap_packet_array[TAP_PACKET_QUEUE_LEN]; static guint tap_packet_index; typedef struct _tap_listener_t { - volatile struct _tap_listener_t *next; + struct _tap_listener_t *next; int tap_id; gboolean needs_redraw; guint flags; @@ -91,7 +91,8 @@ typedef struct _tap_listener_t { tap_draw_cb draw; tap_finish_cb finish; } tap_listener_t; -static volatile tap_listener_t *tap_listener_queue=NULL; + +static tap_listener_t *tap_listener_queue=NULL; #ifdef HAVE_PLUGINS static GSList *tap_plugins = NULL; @@ -243,7 +244,7 @@ tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data) void tap_build_interesting (epan_dissect_t *edt) { - volatile tap_listener_t *tl; + tap_listener_t *tl; /* nothing to do, just return */ if(!tap_listener_queue){ @@ -285,7 +286,7 @@ void tap_push_tapped_queue(epan_dissect_t *edt) { tap_packet_t *tp; - volatile tap_listener_t *tl; + tap_listener_t *tl; guint i; /* nothing to do, just return */ @@ -372,7 +373,7 @@ fetch_tapped_data(int tap_id, int idx) void reset_tap_listeners(void) { - volatile tap_listener_t *tl; + tap_listener_t *tl; for(tl=tap_listener_queue;tl;tl=tl->next){ if(tl->reset){ @@ -394,7 +395,7 @@ reset_tap_listeners(void) void draw_tap_listeners(gboolean draw_all) { - volatile tap_listener_t *tl; + tap_listener_t *tl; for(tl=tap_listener_queue;tl;tl=tl->next){ if(tl->needs_redraw || draw_all){ @@ -447,13 +448,11 @@ find_tap_id(const char *name) } static void -free_tap_listener(volatile tap_listener_t *tl) +free_tap_listener(tap_listener_t *tl) { dfilter_free(tl->code); g_free(tl->fstring); -DIAG_OFF(cast-qual) - g_free((gpointer)tl); -DIAG_ON(cast-qual) + g_free(tl); } /* this function attaches the tap_listener to the named tap. @@ -467,7 +466,7 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring, guint flags, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw, tap_finish_cb finish) { - volatile tap_listener_t *tl; + tap_listener_t *tl; int tap_id; dfilter_t *code=NULL; GString *error_string; @@ -480,7 +479,7 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring, return error_string; } - tl=(volatile tap_listener_t *)g_malloc0(sizeof(tap_listener_t)); + tl=(tap_listener_t *)g_malloc0(sizeof(tap_listener_t)); tl->needs_redraw=TRUE; tl->flags=flags; if(fstring){ @@ -515,7 +514,7 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring, GString * set_tap_dfilter(void *tapdata, const char *fstring) { - volatile tap_listener_t *tl=NULL,*tl2; + tap_listener_t *tl=NULL,*tl2; dfilter_t *code=NULL; GString *error_string; gchar *err_msg; @@ -566,7 +565,7 @@ set_tap_dfilter(void *tapdata, const char *fstring) void tap_listeners_dfilter_recompile(void) { - volatile tap_listener_t *tl; + tap_listener_t *tl; dfilter_t *code; gchar *err_msg; @@ -595,7 +594,7 @@ tap_listeners_dfilter_recompile(void) void remove_tap_listener(void *tapdata) { - volatile tap_listener_t *tl=NULL,*tl2; + tap_listener_t *tl=NULL,*tl2; if(!tap_listener_queue){ return; @@ -630,7 +629,7 @@ remove_tap_listener(void *tapdata) gboolean tap_listeners_require_dissection(void) { - volatile tap_listener_t *tap_queue = tap_listener_queue; + tap_listener_t *tap_queue = tap_listener_queue; while(tap_queue) { if(!(tap_queue->flags & TL_IS_DISSECTOR_HELPER)) @@ -647,7 +646,7 @@ tap_listeners_require_dissection(void) gboolean have_tap_listener(int tap_id) { - volatile tap_listener_t *tap_queue = tap_listener_queue; + tap_listener_t *tap_queue = tap_listener_queue; while(tap_queue) { if(tap_queue->tap_id == tap_id) @@ -665,7 +664,7 @@ have_tap_listener(int tap_id) gboolean have_filtering_tap_listeners(void) { - volatile tap_listener_t *tl; + tap_listener_t *tl; for(tl=tap_listener_queue;tl;tl=tl->next){ if(tl->code) @@ -682,7 +681,7 @@ have_filtering_tap_listeners(void) guint union_of_tap_listener_flags(void) { - volatile tap_listener_t *tl; + tap_listener_t *tl; guint flags = 0; for(tl=tap_listener_queue;tl;tl=tl->next){ @@ -693,8 +692,8 @@ union_of_tap_listener_flags(void) void tap_cleanup(void) { - volatile tap_listener_t *elem_lq; - volatile tap_listener_t *head_lq = tap_listener_queue; + tap_listener_t *elem_lq; + tap_listener_t *head_lq = tap_listener_queue; tap_dissector_t *elem_dl; tap_dissector_t *head_dl = tap_dissector_list; |