packet: Whitespace cleanup

Change-Id: I47d7994b5670ec6b954444b53aa9572f3ba5a047
Reviewed-on: https://code.wireshark.org/review/25682
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2018-02-08 09:31:29 +01:00
parent a56d9ba30e
commit a2265f73b5
1 changed files with 43 additions and 44 deletions

View File

@ -530,7 +530,6 @@ dissect_record(epan_dissect_t *edt, int file_type_subtype,
edt->pi.layers = wmem_list_new(edt->pi.pool); edt->pi.layers = wmem_list_new(edt->pi.pool);
edt->tvb = tvb; edt->tvb = tvb;
frame_delta_abs_time(edt->session, fd, fd->frame_ref_num, &edt->pi.rel_ts); frame_delta_abs_time(edt->session, fd, fd->frame_ref_num, &edt->pi.rel_ts);
/* pkt comment use first user, later from phdr */ /* pkt comment use first user, later from phdr */
@ -627,7 +626,7 @@ dissect_file(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
} }
CATCH2(FragmentBoundsError, ReportedBoundsError) { CATCH2(FragmentBoundsError, ReportedBoundsError) {
proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0, proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0,
"[Malformed Record: Packet Length]" ); "[Malformed Record: Packet Length]");
} }
ENDTRY; ENDTRY;
@ -900,7 +899,7 @@ struct dtbl_entry {
dissector_table_t dissector_table_t
find_dissector_table(const char *name) find_dissector_table(const char *name)
{ {
return (dissector_table_t)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. */ /* Find an entry in a uint dissector table. */
@ -1013,8 +1012,8 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h
dtbl_entry->initial = dtbl_entry->current; dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, g_hash_table_insert(sub_dissectors->hash_table,
GUINT_TO_POINTER( pattern), (gpointer)dtbl_entry); GUINT_TO_POINTER(pattern), (gpointer)dtbl_entry);
/* /*
* Now, if this table supports "Decode As", add this handle * Now, if this table supports "Decode As", add this handle
@ -1060,7 +1059,7 @@ dissector_add_preference(const char *name, dissector_handle_t handle, guint init
guint* uint_var; guint* uint_var;
module_t *module; module_t *module;
gchar *description, *title; gchar *description, *title;
dissector_table_t pref_dissector_table = find_dissector_table( name); dissector_table_t pref_dissector_table = find_dissector_table(name);
int proto_id = proto_get_id(handle->protocol); int proto_id = proto_get_id(handle->protocol);
uint_var = wmem_new(wmem_epan_scope(), guint); uint_var = wmem_new(wmem_epan_scope(), guint);
@ -1095,7 +1094,7 @@ void dissector_add_uint_range_with_preference(const char *name, const char* rang
range_t** range; range_t** range;
module_t *module; module_t *module;
gchar *description, *title; gchar *description, *title;
dissector_table_t pref_dissector_table = find_dissector_table( name); dissector_table_t pref_dissector_table = find_dissector_table(name);
int proto_id = proto_get_id(handle->protocol); int proto_id = proto_get_id(handle->protocol);
guint32 max_value = 0; guint32 max_value = 0;
@ -1159,11 +1158,11 @@ void
dissector_delete_uint(const char *name, const guint32 pattern, dissector_delete_uint(const char *name, const guint32 pattern,
dissector_handle_t handle _U_) dissector_handle_t handle _U_)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* Find the entry. * Find the entry.
@ -1241,11 +1240,11 @@ dissector_delete_from_all_tables(dissector_handle_t handle)
void void
dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_t handle) dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_t handle)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* See if the entry already exists. If so, reuse it. * See if the entry already exists. If so, reuse it.
@ -1269,19 +1268,19 @@ dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_
dtbl_entry->current = handle; dtbl_entry->current = handle;
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, g_hash_table_insert(sub_dissectors->hash_table,
GUINT_TO_POINTER( pattern), (gpointer)dtbl_entry); GUINT_TO_POINTER(pattern), (gpointer)dtbl_entry);
} }
/* Reset an entry in a uint dissector table to its initial value. */ /* Reset an entry in a uint dissector table to its initial value. */
void void
dissector_reset_uint(const char *name, const guint32 pattern) dissector_reset_uint(const char *name, const guint32 pattern)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* Find the entry. * Find the entry.
@ -1444,7 +1443,7 @@ void
dissector_add_string(const char *name, const gchar *pattern, dissector_add_string(const char *name, const gchar *pattern,
dissector_handle_t handle) dissector_handle_t handle)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
char *key; char *key;
@ -1497,7 +1496,7 @@ dissector_add_string(const char *name, const gchar *pattern,
} }
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, (gpointer)key, g_hash_table_insert(sub_dissectors->hash_table, (gpointer)key,
(gpointer)dtbl_entry); (gpointer)dtbl_entry);
/* /*
@ -1522,11 +1521,11 @@ void
dissector_delete_string(const char *name, const gchar *pattern, dissector_delete_string(const char *name, const gchar *pattern,
dissector_handle_t handle _U_) dissector_handle_t handle _U_)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* Find the entry. * Find the entry.
@ -1547,11 +1546,11 @@ void
dissector_change_string(const char *name, const gchar *pattern, dissector_change_string(const char *name, const gchar *pattern,
dissector_handle_t handle) dissector_handle_t handle)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* See if the entry already exists. If so, reuse it. * See if the entry already exists. If so, reuse it.
@ -1575,7 +1574,7 @@ dissector_change_string(const char *name, const gchar *pattern,
dtbl_entry->current = handle; dtbl_entry->current = handle;
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, (gpointer)g_strdup(pattern), g_hash_table_insert(sub_dissectors->hash_table, (gpointer)g_strdup(pattern),
(gpointer)dtbl_entry); (gpointer)dtbl_entry);
} }
@ -1583,11 +1582,11 @@ dissector_change_string(const char *name, const gchar *pattern,
void void
dissector_reset_string(const char *name, const gchar *pattern) dissector_reset_string(const char *name, const gchar *pattern)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* sanity check */ /* sanity check */
g_assert( sub_dissectors); g_assert(sub_dissectors);
/* /*
* Find the entry. * Find the entry.
@ -1707,7 +1706,7 @@ dissector_get_default_string_handle(const char *name, const gchar *string)
/* Add an entry to a "custom" dissector table. */ /* Add an entry to a "custom" dissector table. */
void dissector_add_custom_table_handle(const char *name, void *pattern, dissector_handle_t handle) void dissector_add_custom_table_handle(const char *name, void *pattern, dissector_handle_t handle)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry; dtbl_entry_t *dtbl_entry;
/* /*
@ -1730,7 +1729,7 @@ void dissector_add_custom_table_handle(const char *name, void *pattern, dissecto
dtbl_entry->initial = dtbl_entry->current; dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern, g_hash_table_insert(sub_dissectors->hash_table, (gpointer)pattern,
(gpointer)dtbl_entry); (gpointer)dtbl_entry);
/* /*
@ -1788,7 +1787,7 @@ void dissector_add_guid(const char *name, guid_key* guid_val, dissector_handle_t
dtbl_entry->initial = dtbl_entry->current; dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */ /* do the table insertion */
g_hash_table_insert( sub_dissectors->hash_table, g_hash_table_insert(sub_dissectors->hash_table,
guid_val, (gpointer)dtbl_entry); guid_val, (gpointer)dtbl_entry);
/* /*
@ -1939,7 +1938,7 @@ dissector_compare_filter_name(gconstpointer dissector_a, gconstpointer dissector
void void
dissector_add_for_decode_as(const char *name, dissector_handle_t handle) dissector_add_for_decode_as(const char *name, dissector_handle_t handle)
{ {
dissector_table_t sub_dissectors = find_dissector_table( name); dissector_table_t sub_dissectors = find_dissector_table(name);
GSList *entry; GSList *entry;
dissector_handle_t dup_handle; dissector_handle_t dup_handle;
@ -2320,7 +2319,7 @@ dissector_all_tables_foreach_list_func (gpointer key, gpointer user_data)
dissector_table_t table; dissector_table_t table;
dissector_foreach_table_info_t *info; dissector_foreach_table_info_t *info;
table = (dissector_table_t)g_hash_table_lookup( dissector_tables, key ); table = (dissector_table_t)g_hash_table_lookup(dissector_tables, key);
info = (dissector_foreach_table_info_t *)user_data; info = (dissector_foreach_table_info_t *)user_data;
(*info->caller_func)((gchar*)key, table->ui_name, info->caller_data); (*info->caller_func)((gchar*)key, table->ui_name, info->caller_data);
} }
@ -2359,7 +2358,7 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
dissector_table_t sub_dissectors; dissector_table_t sub_dissectors;
/* Make sure the registration is unique */ /* Make sure the registration is unique */
if(g_hash_table_lookup( dissector_tables, name )) { if (g_hash_table_lookup(dissector_tables, name)) {
g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name); g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name);
} }
@ -2377,26 +2376,26 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
* so we use "g_direct_hash()" and "g_direct_equal()". * so we use "g_direct_hash()" and "g_direct_equal()".
*/ */
sub_dissectors->hash_func = g_direct_hash; sub_dissectors->hash_func = g_direct_hash;
sub_dissectors->hash_table = g_hash_table_new_full( g_direct_hash, sub_dissectors->hash_table = g_hash_table_new_full(g_direct_hash,
g_direct_equal, g_direct_equal,
NULL, NULL,
&g_free ); &g_free);
break; break;
case FT_STRING: case FT_STRING:
case FT_STRINGZ: case FT_STRINGZ:
case FT_STRINGZPAD: case FT_STRINGZPAD:
sub_dissectors->hash_func = g_str_hash; sub_dissectors->hash_func = g_str_hash;
sub_dissectors->hash_table = g_hash_table_new_full( g_str_hash, sub_dissectors->hash_table = g_hash_table_new_full(g_str_hash,
g_str_equal, g_str_equal,
&g_free, &g_free,
&g_free ); &g_free);
break; break;
case FT_GUID: case FT_GUID:
sub_dissectors->hash_table = g_hash_table_new_full( uuid_hash, sub_dissectors->hash_table = g_hash_table_new_full(uuid_hash,
uuid_equal, uuid_equal,
NULL, NULL,
&g_free ); &g_free);
break; break;
case FT_NONE: case FT_NONE:
@ -2404,10 +2403,10 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
dissectors so this will always be a hash table size of 1 just dissectors so this will always be a hash table size of 1 just
to store the single dtbl_entry_t */ to store the single dtbl_entry_t */
sub_dissectors->hash_func = g_direct_hash; sub_dissectors->hash_func = g_direct_hash;
sub_dissectors->hash_table = g_hash_table_new_full( g_direct_hash, sub_dissectors->hash_table = g_hash_table_new_full(g_direct_hash,
g_direct_equal, g_direct_equal,
NULL, NULL,
&g_free ); &g_free);
break; break;
default: default:
@ -2420,7 +2419,7 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
sub_dissectors->param = param; sub_dissectors->param = param;
sub_dissectors->protocol = find_protocol_by_id(proto); sub_dissectors->protocol = find_protocol_by_id(proto);
sub_dissectors->supports_decode_as = FALSE; sub_dissectors->supports_decode_as = FALSE;
g_hash_table_insert( dissector_tables, (gpointer)name, (gpointer) sub_dissectors ); g_hash_table_insert(dissector_tables, (gpointer)name, (gpointer) sub_dissectors);
return sub_dissectors; return sub_dissectors;
} }
@ -2430,7 +2429,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
dissector_table_t sub_dissectors; dissector_table_t sub_dissectors;
/* Make sure the registration is unique */ /* Make sure the registration is unique */
if(g_hash_table_lookup( dissector_tables, name )) { if (g_hash_table_lookup(dissector_tables, name)) {
g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name); g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name);
} }
@ -2441,7 +2440,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
sub_dissectors->hash_table = g_hash_table_new_full(hash_func, sub_dissectors->hash_table = g_hash_table_new_full(hash_func,
key_equal_func, key_equal_func,
&g_free, &g_free,
&g_free ); &g_free);
sub_dissectors->dissector_handles = NULL; sub_dissectors->dissector_handles = NULL;
sub_dissectors->ui_name = ui_name; sub_dissectors->ui_name = ui_name;
@ -2449,7 +2448,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
sub_dissectors->param = BASE_NONE; sub_dissectors->param = BASE_NONE;
sub_dissectors->protocol = find_protocol_by_id(proto); sub_dissectors->protocol = find_protocol_by_id(proto);
sub_dissectors->supports_decode_as = FALSE; sub_dissectors->supports_decode_as = FALSE;
g_hash_table_insert( dissector_tables, (gpointer)name, (gpointer) sub_dissectors ); g_hash_table_insert(dissector_tables, (gpointer)name, (gpointer) sub_dissectors);
return sub_dissectors; return sub_dissectors;
} }
@ -2584,7 +2583,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
static int static int
find_matching_heur_dissector( gconstpointer a, gconstpointer b) { find_matching_heur_dissector(gconstpointer a, gconstpointer b) {
const heur_dtbl_entry_t *hdtbl_entry_a = (const heur_dtbl_entry_t *) a; const heur_dtbl_entry_t *hdtbl_entry_a = (const heur_dtbl_entry_t *) a;
const heur_dtbl_entry_t *hdtbl_entry_b = (const heur_dtbl_entry_t *) b; const heur_dtbl_entry_t *hdtbl_entry_b = (const heur_dtbl_entry_t *) b;
@ -3163,7 +3162,7 @@ void call_heur_dissector_direct(heur_dtbl_entry_t *heur_dtbl_entry, tvbuff_t *tv
pinfo->heur_list_name = heur_dtbl_entry->list_name; pinfo->heur_list_name = heur_dtbl_entry->list_name;
/* call the dissector, in case of failure call data handle (might happen with exported PDUs) */ /* call the dissector, in case of failure call data handle (might happen with exported PDUs) */
if(!(*heur_dtbl_entry->dissector)(tvb, pinfo, tree, data)) { if (!(*heur_dtbl_entry->dissector)(tvb, pinfo, tree, data)) {
call_dissector_work(data_handle, tvb, pinfo, tree, TRUE, NULL); call_dissector_work(data_handle, tvb, pinfo, tree, TRUE, NULL);
/* /*