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-assa_r3.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-assa_r3.c')
-rw-r--r-- | epan/dissectors/packet-assa_r3.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c index 777781d30a..635abd33a7 100644 --- a/epan/dissectors/packet-assa_r3.c +++ b/epan/dissectors/packet-assa_r3.c @@ -5956,16 +5956,16 @@ dissect_r3_cmd_downloadfirmware (tvbuff_t *tvb, guint32 start_offset, guint32 le cmdLen - 2, 0x0000)) == packetCRC) - proto_tree_add_uint_format (dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, + proto_tree_add_uint_format_value(dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, cmdLen - 2 - 2, 2, - packetCRC, "CRC: 0x%04x (correct)", packetCRC); + packetCRC, "0x%04x (correct)", packetCRC); else { proto_item *tmp_item; - proto_tree_add_uint_format (dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, + proto_tree_add_uint_format_value(dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, cmdLen - 2 - 2, 2, - packetCRC, "CRC: 0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); + packetCRC, "0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); tmp_item = proto_tree_add_boolean (dlfw_tree, hf_r3_firmwaredownload_crc_bad, payload_tvb, cmdLen - 2 - 2, 2, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); @@ -6705,26 +6705,26 @@ dissect_r3_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *r3_tree) guint32 calculatedCRC; if ((calculatedCRC = utilCrcCalculate (tvb_get_ptr (tvb, 1, packetLen - 3), packetLen - 3, 0x0000)) == packetCRC) - proto_tree_add_uint_format (tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, "CRC: 0x%04x (correct)", packetCRC); + proto_tree_add_uint_format_value(tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, "0x%04x (correct)", packetCRC); else { proto_item *tmp_item; - proto_tree_add_uint_format (tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, - "CRC: 0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); + proto_tree_add_uint_format_value(tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, + "0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); tmp_item = proto_tree_add_boolean (tail_tree, hf_r3_crc_bad, tvb, offset, 2, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); } if ((packetLen ^ 0xff) == packetXor) - proto_tree_add_uint_format (tail_tree, hf_r3_xor, tvb, offset + 2, 1, packetXor, - "XOR: 0x%02x (correct)", packetXor); + proto_tree_add_uint_format_value(tail_tree, hf_r3_xor, tvb, offset + 2, 1, packetXor, + "0x%02x (correct)", packetXor); else { proto_item *tmp_item; - proto_tree_add_uint_format (tail_tree, hf_r3_xor, tvb, offset + 7, 1, packetXor, - "XOR: 0x%02x (incorrect, should be 0x%02x)", packetXor, packetLen ^ 0xff); + proto_tree_add_uint_format_value(tail_tree, hf_r3_xor, tvb, offset + 7, 1, packetXor, + "0x%02x (incorrect, should be 0x%02x)", packetXor, packetLen ^ 0xff); tmp_item = proto_tree_add_boolean (tail_tree, hf_r3_xor_bad, tvb, offset + 7, 1, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); } |