diff options
author | Gerald Combs <gerald@wireshark.org> | 2017-12-14 14:13:39 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2017-12-14 23:43:38 +0000 |
commit | 90102ad12ec601abcc2270e4779f8d2fc1c0c937 (patch) | |
tree | 49a63bad606de772ae1500e06d8e55a5ffeb65d5 /ui/qt/main_window.cpp | |
parent | afc6e773dc84ddcf57af59e0fd87ab1625204786 (diff) |
Remove a plugin_if_gui_cb type conversion.
We always pass a GHashTable * to plugin_if_gui_cb so don't cast it to a
gconstpointer. This should fix the following and related warnings:
main_window.cpp: In function ‘void plugin_if_mainwindow_apply_filter(gconstpointer)’:
main_window.cpp:121:44: warning: cast from type ‘gconstpointer {aka const void*}’ to type ‘GHashTable* {aka _GHashTable*}’ casts away qualifiers [-Wcast-qual]
GHashTable * data_set = (GHashTable *) user_data;
Fix another const warning while we're here.
Change-Id: Ia9225188bfb913feb4fef4369f10fd5791fc8dc9
Reviewed-on: https://code.wireshark.org/review/24830
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r-- | ui/qt/main_window.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 83c07d73f1..bfd40ed7fa 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -113,25 +113,22 @@ void pipe_input_set_handler(gint source, gpointer user_data, ws_process_id *chil gbl_cur_main_window_->setPipeInputHandler(source, user_data, child_process, input_cb); } -static void plugin_if_mainwindow_apply_filter(gconstpointer user_data) +static void plugin_if_mainwindow_apply_filter(GHashTable * data_set) { - if (!gbl_cur_main_window_ || !user_data) + if (!gbl_cur_main_window_ || !data_set) return; - GHashTable * data_set = (GHashTable *) user_data; - if (g_hash_table_lookup_extended(data_set, "filter_string", NULL, NULL)) { QString filter((const char *)g_hash_table_lookup(data_set, "filter_string")); gbl_cur_main_window_->filterPackets(filter); } } -static void plugin_if_mainwindow_preference(gconstpointer user_data) +static void plugin_if_mainwindow_preference(GHashTable * data_set) { - if (!gbl_cur_main_window_ || !user_data) + if (!gbl_cur_main_window_ || !data_set) return; - GHashTable * data_set = (GHashTable *) user_data; const char * module_name; const char * pref_name; const char * pref_value; @@ -147,12 +144,11 @@ static void plugin_if_mainwindow_preference(gconstpointer user_data) } } -static void plugin_if_mainwindow_gotoframe(gconstpointer user_data) +static void plugin_if_mainwindow_gotoframe(GHashTable * data_set) { - if (!gbl_cur_main_window_ || !user_data) + if (!gbl_cur_main_window_ || !data_set) return; - GHashTable * data_set = (GHashTable *) user_data; gpointer framenr; if (g_hash_table_lookup_extended(data_set, "frame_nr", NULL, &framenr)) { @@ -163,12 +159,11 @@ static void plugin_if_mainwindow_gotoframe(gconstpointer user_data) #ifdef HAVE_LIBPCAP -static void plugin_if_mainwindow_get_ws_info(gconstpointer user_data) +static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set) { - if (!gbl_cur_main_window_ || !user_data) + if (!gbl_cur_main_window_ || !data_set) return; - GHashTable * data_set = (GHashTable *)user_data; ws_info_t *ws_info = NULL; if (!g_hash_table_lookup_extended(data_set, "ws_info", NULL, (void**)&ws_info)) @@ -241,12 +236,11 @@ static void plugin_if_mainwindow_get_ws_info(gconstpointer user_data) #endif /* HAVE_LIBPCAP */ -static void plugin_if_mainwindow_update_toolbars(gconstpointer user_data) +static void plugin_if_mainwindow_update_toolbars(GHashTable * data_set) { - if (!gbl_cur_main_window_ || ! user_data) + if (!gbl_cur_main_window_ || ! data_set) return; - GHashTable * data_set = (GHashTable *)user_data; if (g_hash_table_lookup_extended(data_set, "toolbar_name", NULL, NULL)) { QString toolbarName((const char *)g_hash_table_lookup(data_set, "toolbar_name")); gbl_cur_main_window_->removeAdditionalToolbar(toolbarName); @@ -1084,11 +1078,11 @@ void MainWindow::dropEvent(QDropEvent *event) return; } - char **in_filenames = (char **)g_malloc(sizeof(char*) * local_files.size()); + char **in_filenames = (char **) g_malloc(sizeof(char*) * local_files.size()); char *tmpname = NULL; for (int i = 0; i < local_files.size(); i++) { - in_filenames[i] = (char *) local_files.at(i).constData(); + in_filenames[i] = const_cast<char *>(local_files.at(i).constData()); } /* merge the files in chronological order */ |