aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-12-28 12:33:17 -0800
committerGuy Harris <guy@alum.mit.edu>2015-12-28 20:34:15 +0000
commit18c5496137a0da931b2cf2f52b5a76b570b5a881 (patch)
tree08b866afb29cd1e89178800f4634c599abf84d3e
parenta1c27ef7cf3686fae90b034bcad40c68dbc91fb1 (diff)
Don't cast away constness unnecessarily.
Compare functions for various collection data types don't need to modify what they're comparing, so keep everything const. Change-Id: I1c2cff6954b1a8c5ade74943934324d0bd8f523c Reviewed-on: https://code.wireshark.org/review/12884 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/rtd_table.c4
-rw-r--r--epan/srt_table.c4
-rw-r--r--epan/stat_tap_ui.c4
-rw-r--r--epan/stats_tree.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/epan/rtd_table.c b/epan/rtd_table.c
index 40fe46b0f8..2b17f80607 100644
--- a/epan/rtd_table.c
+++ b/epan/rtd_table.c
@@ -71,8 +71,8 @@ static GSList *registered_rtd_tables = NULL;
static gint
insert_sorted_by_table_name(gconstpointer aparam, gconstpointer bparam)
{
- const register_rtd_t *a = (register_rtd_t *)aparam;
- const register_rtd_t *b = (register_rtd_t *)bparam;
+ const register_rtd_t *a = (const register_rtd_t *)aparam;
+ const register_rtd_t *b = (const register_rtd_t *)bparam;
return g_ascii_strcasecmp(proto_get_protocol_short_name(find_protocol_by_id(a->proto_id)), proto_get_protocol_short_name(find_protocol_by_id(b->proto_id)));
}
diff --git a/epan/srt_table.c b/epan/srt_table.c
index 9ba162dc69..a0cafa6872 100644
--- a/epan/srt_table.c
+++ b/epan/srt_table.c
@@ -200,8 +200,8 @@ void srt_table_dissector_init(register_srt_t* srt, GArray* srt_array, srt_gui_in
static gint
insert_sorted_by_table_name(gconstpointer aparam, gconstpointer bparam)
{
- const register_srt_t *a = (register_srt_t *)aparam;
- const register_srt_t *b = (register_srt_t *)bparam;
+ const register_srt_t *a = (const register_srt_t *)aparam;
+ const register_srt_t *b = (const register_srt_t *)bparam;
return g_ascii_strcasecmp(proto_get_protocol_short_name(find_protocol_by_id(a->proto_id)), proto_get_protocol_short_name(find_protocol_by_id(b->proto_id)));
}
diff --git a/epan/stat_tap_ui.c b/epan/stat_tap_ui.c
index 6242adca3f..2061c7cfda 100644
--- a/epan/stat_tap_ui.c
+++ b/epan/stat_tap_ui.c
@@ -133,8 +133,8 @@ static GSList *registered_stat_tables = NULL;
static gint
insert_sorted_by_cli_string(gconstpointer aparam, gconstpointer bparam)
{
- const new_stat_tap_ui *a = (new_stat_tap_ui *)aparam;
- const new_stat_tap_ui *b = (new_stat_tap_ui *)bparam;
+ const new_stat_tap_ui *a = (const new_stat_tap_ui *)aparam;
+ const new_stat_tap_ui *b = (const new_stat_tap_ui *)bparam;
return g_ascii_strcasecmp(a->cli_string, b->cli_string);
}
diff --git a/epan/stats_tree.c b/epan/stats_tree.c
index c837277f96..1b1a0f4290 100644
--- a/epan/stats_tree.c
+++ b/epan/stats_tree.c
@@ -373,8 +373,8 @@ stats_tree_get_cfg_by_abbr(const char *abbr)
static gint
compare_stat_menu_item(gconstpointer stat_a, gconstpointer stat_b)
{
- stats_tree_cfg* stat_cfg_a = (stats_tree_cfg*)stat_a;
- stats_tree_cfg* stat_cfg_b = (stats_tree_cfg*)stat_b;
+ const stats_tree_cfg* stat_cfg_a = (const stats_tree_cfg*)stat_a;
+ const stats_tree_cfg* stat_cfg_b = (const stats_tree_cfg*)stat_b;
return strcmp(stat_cfg_a->name, stat_cfg_b->name);
}