diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-06-26 19:56:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-06-26 19:56:52 +0000 |
commit | ab797734ddebd50f40deae437f27392ca4651c92 (patch) | |
tree | 82a95df0652f9df59634fd7a7f8dd36026fa4ea7 /epan/dissectors/packet-ipp.c | |
parent | 2b07720c2fde93c0ee91e88969e76493ee7f86de (diff) |
Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have
"match_strval()" call it.
Make those routines, and "val_to_str()", return a "const" pointer.
Update dissectors as necessary to squelch compiler warnings produced by
that.
Use "val_to_str()" rather than using "match_strval()" and then, if the
result is null, substituting a specific string. Clean up some other
"match_strval()"/"val_to_str()" usages.
Add a null pointer check in the NDPS dissector's "attribute_value()"
routine, as it's not clear that "global_attribute_name" won't be null at
that point.
Make some global variables in the AFS4INT dissector local.
Make some routines not used outside the module they're in static.
Make some tables "static const".
Clean up white space.
Fix Gerald's address in some files.
svn path=/trunk/; revision=14786
Diffstat (limited to 'epan/dissectors/packet-ipp.c')
-rw-r--r-- | epan/dissectors/packet-ipp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c index 4b01e19cd2..88e72fe829 100644 --- a/epan/dissectors/packet-ipp.c +++ b/epan/dissectors/packet-ipp.c @@ -141,18 +141,18 @@ static const value_string status_vals[] = { static int parse_attributes(tvbuff_t *tvb, int offset, proto_tree *tree); static proto_tree *add_integer_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length, guint8 tag); -static void add_integer_value(gchar *tag_desc, proto_tree *tree, +static void add_integer_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length, guint8 tag); static proto_tree *add_octetstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length); -static void add_octetstring_value(gchar *tag_desc, proto_tree *tree, +static void add_octetstring_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length); static proto_tree *add_charstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length); -static void add_charstring_value(gchar *tag_desc, proto_tree *tree, +static void add_charstring_value(const gchar *tag_desc, proto_tree *tree, + tvbuff_t *tvb, int offset, int name_length, int value_length); +static int add_value_head(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length); -static int add_value_head(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, - int offset, int name_length, int value_length); static void dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -298,7 +298,7 @@ static int parse_attributes(tvbuff_t *tvb, int offset, proto_tree *tree) { guint8 tag; - gchar *tag_desc; + const gchar *tag_desc; int name_length, value_length; proto_tree *as_tree = tree; proto_item *tas = NULL; @@ -494,7 +494,7 @@ add_integer_tree(proto_tree *tree, tvbuff_t *tvb, int offset, } static void -add_integer_value(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, +add_integer_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length, guint8 tag) { guint8 bool_val; @@ -539,7 +539,7 @@ add_octetstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, } static void -add_octetstring_value(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, +add_octetstring_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length) { offset = add_value_head(tag_desc, tree, tvb, offset, name_length, @@ -565,7 +565,7 @@ add_charstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, } static void -add_charstring_value(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, +add_charstring_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, int value_length) { offset = add_value_head(tag_desc, tree, tvb, offset, name_length, @@ -575,8 +575,8 @@ add_charstring_value(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, } static int -add_value_head(gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, - int name_length, int value_length) +add_value_head(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, + int offset, int name_length, int value_length) { proto_tree_add_text(tree, tvb, offset, 1, "Tag: %s", tag_desc); offset += 1; |