From 00e46951ad2d2a4e4f6f703f4e2150478f7df53d Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Tue, 27 Sep 2011 12:04:29 +0000 Subject: In proto_tree_add_bits... use const guint encoding to be consistent with proto_tree_add_item(). svn path=/trunk/; revision=39163 --- epan/proto.c | 16 ++++++++-------- epan/proto.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'epan') diff --git a/epan/proto.c b/epan/proto.c index 0a0b92f758..e83859d8bf 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -7212,13 +7212,13 @@ proto_tree_add_bitmask_text(proto_tree *parent_tree, tvbuff_t *tvb, proto_item * proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, - const gboolean little_endian) + const guint encoding) { header_field_info *hfinfo; TRY_TO_FAKE_THIS_ITEM(tree, hf_index, hfinfo); - return proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, NULL, little_endian); + return proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, NULL, encoding); } /* @@ -7230,7 +7230,7 @@ proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, static proto_item * _proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, - guint64 *return_value, const gboolean little_endian) + guint64 *return_value, const guint encoding) { gint offset; guint length; @@ -7267,11 +7267,11 @@ _proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb if (no_of_bits < 9){ value = tvb_get_bits8(tvb, bit_offset, no_of_bits); }else if(no_of_bits < 17){ - value = tvb_get_bits16(tvb, bit_offset, no_of_bits, little_endian); + value = tvb_get_bits16(tvb, bit_offset, no_of_bits, encoding); }else if(no_of_bits < 33){ - value = tvb_get_bits32(tvb, bit_offset, no_of_bits, little_endian); + value = tvb_get_bits32(tvb, bit_offset, no_of_bits, encoding); }else if(no_of_bits < 65){ - value = tvb_get_bits64(tvb, bit_offset, no_of_bits, little_endian); + value = tvb_get_bits64(tvb, bit_offset, no_of_bits, encoding); }else{ DISSECTOR_ASSERT_NOT_REACHED(); return NULL; @@ -7352,11 +7352,11 @@ _proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb proto_item * proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, - guint64 *return_value, const gboolean little_endian) + guint64 *return_value, const guint encoding) { proto_item *item; - if ((item = _proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, return_value, little_endian))) { + if ((item = _proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, return_value, encoding))) { FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_OFFSET(bit_offset)); FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_SIZE(no_of_bits)); } diff --git a/epan/proto.h b/epan/proto.h index 98ef9c522f..799c770bd2 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1842,7 +1842,7 @@ proto_tree_add_bitmask_text(proto_tree *tree, tvbuff_t *tvb, const guint offset, @param little_endian big or little endian byte representation @return the newly created item */ extern proto_item * -proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const gboolean little_endian); +proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const guint encoding); /** Add bits to a proto_tree, using the text label registered to that item. The item is extracted from the tvbuff handed to it. @@ -1855,7 +1855,7 @@ proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, co @param little_endian big or little endian byte representation @return the newly created item */ extern proto_item * -proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint64 *return_value, const gboolean little_endian); +proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint64 *return_value, const guint encoding); /** Add bits for a FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 header field to a proto_tree, with the format generating the -- cgit v1.2.1