diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-03 21:10:24 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-05 07:36:26 +0000 |
commit | 9d5f9141af289d3d8b253907eaaae101da1bd9fd (patch) | |
tree | 4d2816511482c04e3e8af66bd6251f5f7ce2dc2f /epan/dissectors/packet-etch.c | |
parent | edbb9edf3928e79b41f9b84d2399205810febef2 (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the area.
Change-Id: Id8d957d3d68a2e3dd5089f490bd59d773e1be967
Reviewed-on: https://code.wireshark.org/review/3427
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-etch.c')
-rw-r--r-- | epan/dissectors/packet-etch.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c index b86f7d1a46..abb455b774 100644 --- a/epan/dissectors/packet-etch.c +++ b/epan/dissectors/packet-etch.c @@ -117,7 +117,7 @@ static gint ett_etch_value = -1; static int hf_etch_sig = -1; static int hf_etch_length = -1; static int hf_etch_version = -1; -/* static int hf_etch_typecode = -1; */ +static int hf_etch_typecode = -1; static int hf_etch_value = -1; static int hf_etch_bytes = -1; static int hf_etch_byte = -1; @@ -379,11 +379,9 @@ read_type(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree) { guint32 type_code; - const gchar *type_as_string; type_code = tvb_get_guint8(tvb, *offset); - type_as_string = val_to_str(type_code, tc_lookup_table, "Etch TypeCode: 0x%02x"); - proto_tree_add_text(etch_tree, tvb, *offset, 1, "%s", type_as_string); + proto_tree_add_item(etch_tree, hf_etch_typecode, tvb, *offset, 1, ENC_NA); (*offset)++; return type_code; } @@ -835,14 +833,12 @@ void proto_register_etch(void) NULL, 0x0, NULL, HFILL} }, -#if 0 {&hf_etch_typecode, {"Etch TypeCode", "etch.typecode", - FT_STRING, BASE_NONE, /* FT_INT8 */ - NULL, 0x0, + FT_UINT8, BASE_HEX, + VALS(tc_lookup_table), 0x0, NULL, HFILL} }, -#endif {&hf_etch_value, {"Etch Value", "etch.value", FT_UINT64, BASE_DEC, |