From 99b76a5bc3db9579351c0fc7251086660f4f003f Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 16 May 2017 14:48:34 -0400 Subject: Use proto_tree_add_item instead of proto_tree_add_xxx. It's a little more efficient to use proto_tree_add_item, than proto_tree_add_xxx, passing it the returned tvb_get_xxx value. Change-Id: I22ddd7ab36e1ee5aae78fc693d7dbac4b4f802f2 Reviewed-on: https://code.wireshark.org/review/21691 Petri-Dish: Anders Broman Reviewed-by: Anders Broman --- epan/dissectors/packet-lmi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-lmi.c') diff --git a/epan/dissectors/packet-lmi.c b/epan/dissectors/packet-lmi.c index 9d5cf26798..64f343589d 100644 --- a/epan/dissectors/packet-lmi.c +++ b/epan/dissectors/packet-lmi.c @@ -109,27 +109,27 @@ static const value_string pvc_status_act_str[] = { static void dissect_lmi_report_type(tvbuff_t *tvb, int offset, proto_tree *tree) { - proto_tree_add_uint(tree, hf_lmi_rcd_type, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_rcd_type, tvb, offset, 1, ENC_NA); } static void dissect_lmi_link_int(tvbuff_t *tvb, int offset, proto_tree *tree) { - proto_tree_add_uint(tree, hf_lmi_send_seq, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_send_seq, tvb, offset, 1, ENC_NA); ++offset; - proto_tree_add_uint(tree, hf_lmi_recv_seq, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_recv_seq, tvb, offset, 1, ENC_NA); } static void dissect_lmi_pvc_status(tvbuff_t *tvb, int offset, proto_tree *tree) { - proto_tree_add_uint(tree, hf_lmi_dlci_high, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_dlci_high, tvb, offset, 1, ENC_NA); ++offset; - proto_tree_add_uint(tree, hf_lmi_dlci_low, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_dlci_low, tvb, offset, 1, ENC_NA); ++offset; - proto_tree_add_uint(tree, hf_lmi_new, tvb, offset, 1, tvb_get_guint8( tvb, offset)); - proto_tree_add_uint(tree, hf_lmi_act, tvb, offset, 1, tvb_get_guint8( tvb, offset)); + proto_tree_add_item(tree, hf_lmi_new, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_lmi_act, tvb, offset, 1, ENC_NA); } static int -- cgit v1.2.3