From beroset:
changed implicit casts to explicit casts and changed name of field from new to new_d (new dissector) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48290
This commit is contained in:
parent
e022d129bd
commit
1d16d95443
|
@ -234,7 +234,7 @@ add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name)
|
|||
{
|
||||
struct data_source *src;
|
||||
|
||||
src = g_malloc(sizeof(struct data_source));
|
||||
src = (struct data_source *)g_malloc(sizeof(struct data_source));
|
||||
src->tvb = tvb;
|
||||
src->name = g_strdup(name);
|
||||
pinfo->data_src = g_slist_append(pinfo->data_src, src);
|
||||
|
@ -265,7 +265,7 @@ free_data_sources(packet_info *pinfo)
|
|||
GSList *l;
|
||||
|
||||
for (l = pinfo->data_src; l; l = l->next) {
|
||||
struct data_source *src = l->data;
|
||||
struct data_source *src = (struct data_source *)l->data;
|
||||
|
||||
g_free(src->name);
|
||||
g_free(src);
|
||||
|
@ -420,7 +420,7 @@ struct dissector_handle {
|
|||
gboolean is_new; /* TRUE if new-style dissector */
|
||||
union {
|
||||
dissector_t old;
|
||||
new_dissector_t new;
|
||||
new_dissector_t new_d;
|
||||
} dissector;
|
||||
protocol_t *protocol;
|
||||
};
|
||||
|
@ -450,9 +450,9 @@ call_dissector_through_handle(dissector_handle_t handle, tvbuff_t *tvb,
|
|||
}
|
||||
|
||||
if (handle->is_new) {
|
||||
EP_CHECK_CANARY(("before calling handle->dissector.new for %s",handle->name));
|
||||
ret = (*handle->dissector.new)(tvb, pinfo, tree, data);
|
||||
EP_CHECK_CANARY(("after calling handle->dissector.new for %s",handle->name));
|
||||
EP_CHECK_CANARY(("before calling handle->dissector.new_d for %s",handle->name));
|
||||
ret = (*handle->dissector.new_d)(tvb, pinfo, tree, data);
|
||||
EP_CHECK_CANARY(("after calling handle->dissector.new_d for %s",handle->name));
|
||||
} else {
|
||||
EP_CHECK_CANARY(("before calling handle->dissector.old for %s",handle->name));
|
||||
(*handle->dissector.old)(tvb, pinfo, tree);
|
||||
|
@ -714,7 +714,7 @@ dissector_table_t
|
|||
find_dissector_table(const char *name)
|
||||
{
|
||||
g_assert(dissector_tables);
|
||||
return g_hash_table_lookup( dissector_tables, name );
|
||||
return (dissector_table_t)g_hash_table_lookup( dissector_tables, name );
|
||||
}
|
||||
|
||||
/* Find an entry in a uint dissector table. */
|
||||
|
@ -743,7 +743,7 @@ find_uint_dtbl_entry(dissector_table_t sub_dissectors, const guint32 pattern)
|
|||
/*
|
||||
* Find the entry.
|
||||
*/
|
||||
return g_hash_table_lookup(sub_dissectors->hash_table,
|
||||
return (dtbl_entry_t *)g_hash_table_lookup(sub_dissectors->hash_table,
|
||||
GUINT_TO_POINTER(pattern));
|
||||
}
|
||||
|
||||
|
@ -814,7 +814,7 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h
|
|||
dissector_add_uint_sanity_check(name, pattern, handle, sub_dissectors);
|
||||
#endif
|
||||
|
||||
dtbl_entry = g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry = (dtbl_entry_t *)g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry->current = handle;
|
||||
dtbl_entry->initial = dtbl_entry->current;
|
||||
|
||||
|
@ -889,7 +889,7 @@ dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_
|
|||
if (handle == NULL)
|
||||
return;
|
||||
|
||||
dtbl_entry = g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry = (dtbl_entry_t *)g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry->initial = NULL;
|
||||
dtbl_entry->current = handle;
|
||||
|
||||
|
@ -1030,7 +1030,7 @@ find_string_dtbl_entry(dissector_table_t const sub_dissectors, const gchar *patt
|
|||
/*
|
||||
* Find the entry.
|
||||
*/
|
||||
return g_hash_table_lookup(sub_dissectors->hash_table, pattern);
|
||||
return (dtbl_entry_t *)g_hash_table_lookup(sub_dissectors->hash_table, pattern);
|
||||
}
|
||||
|
||||
/* Add an entry to a string dissector table. */
|
||||
|
@ -1073,7 +1073,7 @@ dissector_add_string(const char *name, const gchar *pattern,
|
|||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
dtbl_entry = g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry = (dtbl_entry_t *)g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry->current = handle;
|
||||
dtbl_entry->initial = dtbl_entry->current;
|
||||
|
||||
|
@ -1149,7 +1149,7 @@ dissector_change_string(const char *name, const gchar *pattern,
|
|||
if (handle == NULL)
|
||||
return;
|
||||
|
||||
dtbl_entry = g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry = (dtbl_entry_t *)g_malloc(sizeof (dtbl_entry_t));
|
||||
dtbl_entry->initial = NULL;
|
||||
dtbl_entry->current = handle;
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ dissector_table_foreach_func (gpointer key, gpointer value, gpointer user_data)
|
|||
g_assert(value);
|
||||
g_assert(user_data);
|
||||
|
||||
dtbl_entry = value;
|
||||
dtbl_entry = (dtbl_entry_t *)value;
|
||||
if (dtbl_entry->current == NULL ||
|
||||
dtbl_entry->current->protocol == NULL) {
|
||||
/*
|
||||
|
@ -1366,7 +1366,7 @@ dissector_table_foreach_func (gpointer key, gpointer value, gpointer user_data)
|
|||
return;
|
||||
}
|
||||
|
||||
info = user_data;
|
||||
info = (dissector_foreach_info_t *)user_data;
|
||||
info->caller_func(info->table_name, info->selector_type, key, value,
|
||||
info->caller_data);
|
||||
}
|
||||
|
@ -1383,8 +1383,8 @@ dissector_all_tables_foreach_func (gpointer key, gpointer value, gpointer user_d
|
|||
g_assert(value);
|
||||
g_assert(user_data);
|
||||
|
||||
sub_dissectors = value;
|
||||
info = user_data;
|
||||
sub_dissectors = (dissector_table_t)value;
|
||||
info = (dissector_foreach_info_t *)user_data;
|
||||
info->table_name = (gchar*) key;
|
||||
info->selector_type = get_dissector_table_selector_type(info->table_name);
|
||||
g_hash_table_foreach(sub_dissectors->hash_table, info->next_func, info);
|
||||
|
@ -1454,7 +1454,7 @@ dissector_table_foreach_changed_func (gpointer key, gpointer value, gpointer use
|
|||
g_assert(value);
|
||||
g_assert(user_data);
|
||||
|
||||
dtbl_entry = value;
|
||||
dtbl_entry = (dtbl_entry_t *)value;
|
||||
if (dtbl_entry->initial == dtbl_entry->current) {
|
||||
/*
|
||||
* Entry hasn't changed - don't call the function.
|
||||
|
@ -1462,7 +1462,7 @@ dissector_table_foreach_changed_func (gpointer key, gpointer value, gpointer use
|
|||
return;
|
||||
}
|
||||
|
||||
info = user_data;
|
||||
info = (dissector_foreach_info_t *)user_data;
|
||||
info->caller_func(info->table_name, info->selector_type, key, value,
|
||||
info->caller_data);
|
||||
}
|
||||
|
@ -1517,8 +1517,8 @@ dissector_all_tables_foreach_table_func (gpointer key, const gpointer value, con
|
|||
dissector_table_t table;
|
||||
dissector_foreach_table_info_t *info;
|
||||
|
||||
table = value;
|
||||
info = user_data;
|
||||
table = (dissector_table_t)value;
|
||||
info = (dissector_foreach_table_info_t *)user_data;
|
||||
(*info->caller_func)((gchar*)key, table->ui_name, info->caller_data);
|
||||
}
|
||||
|
||||
|
@ -1531,8 +1531,8 @@ dissector_all_tables_foreach_list_func (gpointer key, gpointer user_data)
|
|||
dissector_table_t table;
|
||||
dissector_foreach_table_info_t *info;
|
||||
|
||||
table = g_hash_table_lookup( dissector_tables, key );
|
||||
info = user_data;
|
||||
table = (dissector_table_t)g_hash_table_lookup( dissector_tables, key );
|
||||
info = (dissector_foreach_table_info_t *)user_data;
|
||||
(*info->caller_func)((gchar*)key, table->ui_name, info->caller_data);
|
||||
}
|
||||
|
||||
|
@ -1582,7 +1582,7 @@ register_dissector_table(const char *name, const char *ui_name, const ftenum_t t
|
|||
|
||||
/* Create and register the dissector table for this name; returns */
|
||||
/* a pointer to the dissector table. */
|
||||
sub_dissectors = g_malloc(sizeof (struct dissector_table));
|
||||
sub_dissectors = (struct dissector_table *)g_malloc(sizeof (struct dissector_table));
|
||||
switch (type) {
|
||||
|
||||
case FT_UINT8:
|
||||
|
@ -1650,7 +1650,7 @@ static heur_dissector_list_t *
|
|||
find_heur_dissector_list(const char *name)
|
||||
{
|
||||
g_assert(heur_dissector_lists != NULL);
|
||||
return g_hash_table_lookup(heur_dissector_lists, name);
|
||||
return (heur_dissector_list_t *)g_hash_table_lookup(heur_dissector_lists, name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1678,7 +1678,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const int proto
|
|||
|
||||
/* XXX: Should verify that sub-dissector is not already in the list ? */
|
||||
|
||||
hdtbl_entry = g_malloc(sizeof (heur_dtbl_entry_t));
|
||||
hdtbl_entry = (heur_dtbl_entry_t *)g_malloc(sizeof (heur_dtbl_entry_t));
|
||||
hdtbl_entry->dissector = dissector;
|
||||
hdtbl_entry->protocol = find_protocol_by_id(proto);
|
||||
hdtbl_entry->enabled = TRUE;
|
||||
|
@ -1858,7 +1858,7 @@ dissector_all_heur_tables_foreach_table_func (gpointer key, const gpointer value
|
|||
{
|
||||
heur_dissector_foreach_table_info_t *info;
|
||||
|
||||
info = user_data;
|
||||
info = (heur_dissector_foreach_table_info_t *)user_data;
|
||||
(*info->caller_func)((gchar*)key, value, info->caller_data);
|
||||
}
|
||||
|
||||
|
@ -1966,7 +1966,7 @@ dissector_handle_t
|
|||
find_dissector(const char *name)
|
||||
{
|
||||
g_assert(registered_dissectors != NULL);
|
||||
return g_hash_table_lookup(registered_dissectors, name);
|
||||
return (dissector_handle_t)g_hash_table_lookup(registered_dissectors, name);
|
||||
}
|
||||
|
||||
/* Create an anonymous handle for a dissector. */
|
||||
|
@ -1975,7 +1975,7 @@ create_dissector_handle(dissector_t dissector, const int proto)
|
|||
{
|
||||
struct dissector_handle *handle;
|
||||
|
||||
handle = g_malloc(sizeof (struct dissector_handle));
|
||||
handle = (struct dissector_handle *)g_malloc(sizeof (struct dissector_handle));
|
||||
handle->name = NULL;
|
||||
handle->is_new = FALSE;
|
||||
handle->dissector.old = dissector;
|
||||
|
@ -1989,10 +1989,10 @@ new_create_dissector_handle(new_dissector_t dissector, const int proto)
|
|||
{
|
||||
struct dissector_handle *handle;
|
||||
|
||||
handle = g_malloc(sizeof (struct dissector_handle));
|
||||
handle = (struct dissector_handle *)g_malloc(sizeof (struct dissector_handle));
|
||||
handle->name = NULL;
|
||||
handle->is_new = TRUE;
|
||||
handle->dissector.new = dissector;
|
||||
handle->dissector.new_d = dissector;
|
||||
handle->protocol = find_protocol_by_id(proto);
|
||||
|
||||
return handle;
|
||||
|
@ -2013,7 +2013,7 @@ register_dissector(const char *name, dissector_t dissector, const int proto)
|
|||
/* Make sure the registration is unique */
|
||||
g_assert(g_hash_table_lookup(registered_dissectors, name) == NULL);
|
||||
|
||||
handle = g_malloc(sizeof (struct dissector_handle));
|
||||
handle = (struct dissector_handle *)g_malloc(sizeof (struct dissector_handle));
|
||||
handle->name = name;
|
||||
handle->is_new = FALSE;
|
||||
handle->dissector.old = dissector;
|
||||
|
@ -2037,10 +2037,10 @@ new_register_dissector(const char *name, new_dissector_t dissector, const int pr
|
|||
/* Make sure the registration is unique */
|
||||
g_assert(g_hash_table_lookup(registered_dissectors, name) == NULL);
|
||||
|
||||
handle = g_malloc(sizeof (struct dissector_handle));
|
||||
handle = (struct dissector_handle *)g_malloc(sizeof (struct dissector_handle));
|
||||
handle->name = name;
|
||||
handle->is_new = TRUE;
|
||||
handle->dissector.new = dissector;
|
||||
handle->dissector.new_d = dissector;
|
||||
handle->protocol = find_protocol_by_id(proto);
|
||||
|
||||
g_hash_table_insert(registered_dissectors, (gpointer)name,
|
||||
|
@ -2122,7 +2122,7 @@ dissector_dump_decodes_display(const gchar *table_name,
|
|||
case FT_UINT16:
|
||||
case FT_UINT24:
|
||||
case FT_UINT32:
|
||||
dtbl_entry = value;
|
||||
dtbl_entry = (dtbl_entry_t *)value;
|
||||
g_assert(dtbl_entry);
|
||||
|
||||
handle = dtbl_entry->current;
|
||||
|
|
Loading…
Reference in New Issue