diff options
author | Michael Mann <mmann78@netscape.net> | 2013-09-15 01:48:30 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-09-15 01:48:30 +0000 |
commit | b38ee917b1953104c615056481d6df008ae94b53 (patch) | |
tree | 55024f9c53f083dc056540b6d887fc4550064008 /epan/dissectors/packet-p_mul.c | |
parent | a17cf67635c6e190c174bc131707804edca5c8f4 (diff) | |
download | wireshark-b38ee917b1953104c615056481d6df008ae94b53.tar.gz |
Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.
The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.
svn path=/trunk/; revision=52045
Diffstat (limited to 'epan/dissectors/packet-p_mul.c')
-rw-r--r-- | epan/dissectors/packet-p_mul.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c index 693904c836..4a3097cf76 100644 --- a/epan/dissectors/packet-p_mul.c +++ b/epan/dissectors/packet-p_mul.c @@ -842,8 +842,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; /* MAP / PDU_Type */ - en = proto_tree_add_uint_format (p_mul_tree, hf_pdu_type, tvb, offset, 1, - pdu_type, "PDU Type: %s (0x%02x)", + en = proto_tree_add_uint_format_value(p_mul_tree, hf_pdu_type, tvb, offset, 1, + pdu_type, "%s (0x%02x)", get_type (pdu_type), pdu_type); field_tree = proto_item_add_subtree (en, ett_pdu_type); @@ -963,9 +963,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) message_id_offset = message_id; } message_id -= message_id_offset; - proto_tree_add_uint_format (p_mul_tree, hf_message_id, tvb, offset, 4, - message_id, "Message ID (MSID): %u" - " (relative message id)", message_id); + proto_tree_add_uint_format_value(p_mul_tree, hf_message_id, tvb, offset, 4, + message_id, "%u (relative message id)", message_id); } else { proto_tree_add_item (p_mul_tree, hf_message_id, tvb, offset, 4, ENC_BIG_ENDIAN); } @@ -1102,9 +1101,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) message_id_offset = message_id; } message_id -= message_id_offset; - proto_tree_add_uint_format (field_tree, hf_message_id, tvb, offset, 4, - message_id, "Message ID (MSID): %u" - " (relative message id)", message_id); + proto_tree_add_uint_format_value(field_tree, hf_message_id, tvb, offset, 4, + message_id, "%u (relative message id)", message_id); } else { proto_tree_add_item (field_tree, hf_message_id, tvb, offset, 4, ENC_BIG_ENDIAN); } @@ -1140,9 +1138,9 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) missing_tree = proto_item_add_subtree (en, ett_range_entry); for (sno = ack_seq_no; sno <= end_seq_no; sno++) { - en = proto_tree_add_uint_format (missing_tree, hf_miss_seq_no, + en = proto_tree_add_uint_format_value(missing_tree, hf_miss_seq_no, tvb, offset, 6, sno, - "Missing Data PDU Seq Number: %d", sno); + "%d", sno); PROTO_ITEM_SET_GENERATED (en); } tot_no_missing += (end_seq_no - ack_seq_no + 1); |