summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-09 17:33:23 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-09 17:33:23 +0000
commit3512e485ca7cbea07c193f87f029cf5f6959d864 (patch)
tree41b31c399a92ff8fdd4281ab78884c37e6846e78 /epan
parentd3174f0d03940b7dce1dcf625002b206b27b92fd (diff)
downloadwireshark-3512e485ca7cbea07c193f87f029cf5f6959d864.tar.gz
Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail.
svn path=/trunk/; revision=29354
Diffstat (limited to 'epan')
-rw-r--r--epan/proto.c8
-rw-r--r--epan/proto.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 4c5ffdc2ca..25182b1ec5 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -549,7 +549,7 @@ free_node_tree_data(tree_data_t *tree_data)
static gboolean
proto_tree_free_node(proto_node *node, gpointer data _U_)
{
- field_info *finfo = PITEM_FINFO(node);
+ field_info *finfo = PNODE_FINFO(node);
#if 0
proto_node *parent = node->parent;
#endif
@@ -5063,7 +5063,7 @@ typedef struct {
static gboolean
find_finfo(proto_node *node, gpointer data)
{
- field_info *fi = PITEM_FINFO(node);
+ field_info *fi = PNODE_FINFO(node);
if (fi && fi->hfinfo) {
if (fi->hfinfo->id == ((ffdata_t*)data)->id) {
g_ptr_array_add(((ffdata_t*)data)->array, fi);
@@ -5097,7 +5097,7 @@ proto_find_finfo(proto_tree *tree, int id)
static gboolean
every_finfo(proto_node *node, gpointer data)
{
- field_info *fi = PITEM_FINFO(node);
+ field_info *fi = PNODE_FINFO(node);
if (fi && fi->hfinfo) {
g_ptr_array_add(((ffdata_t*)data)->array, fi);
}
@@ -5130,7 +5130,7 @@ typedef struct {
static gboolean
check_for_offset(proto_node *node, gpointer data)
{
- field_info *fi = PITEM_FINFO(node);
+ field_info *fi = PNODE_FINFO(node);
offset_search_t *offsearch = data;
/* !fi == the top most container node which holds nothing */
diff --git a/epan/proto.h b/epan/proto.h
index 37e8fcda7e..32e83a0ac2 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -345,8 +345,11 @@ extern gboolean proto_tree_traverse_post_order(proto_tree *tree,
extern void proto_tree_children_foreach(proto_tree *tree,
proto_tree_foreach_func func, gpointer data);
+/** Retrieve the field_info from a proto_node */
+#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
+
/** Retrieve the field_info from a proto_item */
-#define PITEM_FINFO(proto_item) ((proto_item)->finfo)
+#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
/** Retrieve the tree_data_t from a proto_tree */
#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)