From d127d974f56b5103b01e30af0ab6e806e084679b Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Mon, 22 Oct 2012 21:22:35 +0000 Subject: volatile fixes. svn path=/trunk/; revision=45729 --- file.c | 15 +++++++++------ file.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/file.c b/file.c index 3c987e710b..c4aa90763c 100644 --- a/file.c +++ b/file.c @@ -511,9 +511,7 @@ cf_read(capture_file *cf, gboolean reloading) progdlg_t *progbar = NULL; gboolean stop_flag; GTimeVal start_time; - gchar status_str[100]; dfilter_t *dfcode; - column_info *cinfo; epan_dissect_t edt; gboolean create_proto_tree; guint tap_flags; @@ -528,7 +526,6 @@ cf_read(capture_file *cf, gboolean reloading) /* Get the union of the flags for all tap listeners. */ tap_flags = union_of_tap_listener_flags(); - cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL; create_proto_tree = (dfcode != NULL || have_filtering_tap_listeners() || (tap_flags & TL_REQUIRES_PROTO_TREE)); epan_dissect_init(&edt, create_proto_tree, FALSE); @@ -567,6 +564,11 @@ cf_read(capture_file *cf, gboolean reloading) gint64 progbar_quantum; gint64 progbar_nextstep; float progbar_val; + gchar status_str[100]; + + column_info *cinfo; + + cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL; /* Find the size of the file. */ size = wtap_file_size(cf->wth, NULL); @@ -776,12 +778,11 @@ cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempfile, int *er } cf_read_status_t -cf_continue_tail(capture_file *cf, int to_read, int *err) +cf_continue_tail(capture_file *cf, volatile int to_read, int *err) { gchar *err_info; int newly_displayed_packets = 0; dfilter_t *dfcode; - column_info *cinfo; epan_dissect_t edt; gboolean create_proto_tree; guint tap_flags; @@ -796,7 +797,6 @@ cf_continue_tail(capture_file *cf, int to_read, int *err) /* Get the union of the flags for all tap listeners. */ tap_flags = union_of_tap_listener_flags(); - cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL; create_proto_tree = (dfcode != NULL || have_filtering_tap_listeners() || (tap_flags & TL_REQUIRES_PROTO_TREE)); epan_dissect_init(&edt, create_proto_tree, FALSE); @@ -813,6 +813,9 @@ cf_continue_tail(capture_file *cf, int to_read, int *err) TRY { gint64 data_offset = 0; + column_info *cinfo; + + cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL; while (to_read != 0) { wtap_cleareof(cf->wth); diff --git a/file.h b/file.h index 621856e27e..ea182446d8 100644 --- a/file.h +++ b/file.h @@ -182,7 +182,7 @@ cf_status_t cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempf * @param err the error code, if an error had occured * @return one of cf_read_status_t */ -cf_read_status_t cf_continue_tail(capture_file *cf, int to_read, int *err); +cf_read_status_t cf_continue_tail(capture_file *cf, volatile int to_read, int *err); /** * Fake reading packets from the "end" of a capture file. -- cgit v1.2.1