Add casts to fix compilation with GCC.

Remove * from gconstpointers, they are already pointer types.
Add modelines to packet.c and clean up indentation a bit.

svn path=/trunk/; revision=44698
This commit is contained in:
Evan Huus 2012-08-29 22:19:29 +00:00
parent 2ec7c89c33
commit baf111a23c
2 changed files with 20 additions and 8 deletions

View File

@ -1240,12 +1240,11 @@ dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry)
}
gint
dissector_compare_filter_name(gconstpointer* dissector_a, gconstpointer* dissector_b)
dissector_compare_filter_name(gconstpointer dissector_a, gconstpointer dissector_b)
{
dissector_handle_t a = (dissector_handle_t)dissector_a,
b = (dissector_handle_t)dissector_b;
const char *a_name,
*b_name;
dissector_handle_t a = (dissector_handle_t)dissector_a;
dissector_handle_t b = (dissector_handle_t)dissector_b;
const char *a_name, *b_name;
gint ret;
if (a->protocol == NULL)
@ -1294,7 +1293,7 @@ dissector_add_handle(const char *name, dissector_handle_t handle)
/* Add it to the list. */
sub_dissectors->dissector_handles =
g_slist_insert_sorted(sub_dissectors->dissector_handles, (gpointer)handle, dissector_compare_filter_name);
g_slist_insert_sorted(sub_dissectors->dissector_handles, (gpointer)handle, (GCompareFunc)dissector_compare_filter_name);
}
dissector_handle_t
@ -2154,3 +2153,16 @@ call_all_postdissectors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb,pinfo,tree);
}
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/

View File

@ -462,7 +462,7 @@ find_protocol_name_func(const gchar *table _U_, gpointer handle, gpointer user_d
*/
static gint
compare_dissector_key_name(gconstpointer* dissector_a, gconstpointer* dissector_b)
compare_dissector_key_name(gconstpointer dissector_a, gconstpointer dissector_b)
{
return strcmp((const char*)dissector_a, (const char*)dissector_b);
}
@ -477,7 +477,7 @@ fprint_all_layer_types(FILE *output)
{
prev_display_dissector_name = NULL;
dissector_all_tables_foreach_table(display_dissector_table_names, (gpointer)output, compare_dissector_key_name);
dissector_all_tables_foreach_table(display_dissector_table_names, (gpointer)output, (GCompareFunc)compare_dissector_key_name);
}
/*