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-ipmi.c | |
parent | a17cf67635c6e190c174bc131707804edca5c8f4 (diff) |
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-ipmi.c')
-rw-r--r-- | epan/dissectors/packet-ipmi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index 00ad008526..d1924c5ffa 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -1283,8 +1283,8 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d offs++; /* Command */ - proto_tree_add_uint_format(hdr_tree, hf_ipmi_header_command, tvb, offs++, 1, - hdr.cmd, "Command: %s (0x%02x)", cdesc, hdr.cmd); + proto_tree_add_uint_format_value(hdr_tree, hf_ipmi_header_command, tvb, offs++, 1, + hdr.cmd, "%s (0x%02x)", cdesc, hdr.cmd); /* Response code (if present) */ if (is_resp) { @@ -1316,14 +1316,14 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d data_exp_crc = (0 - data_exp_crc) & 0xff; if (data_crc == data_exp_crc) { - proto_tree_add_uint_format(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, - data_crc, "Data checksum: 0x%02x (correct)", data_crc); + proto_tree_add_uint_format_value(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, + data_crc, "0x%02x (correct)", data_crc); } else { ti = proto_tree_add_boolean(hdr_tree, hf_ipmi_bad_checksum, tvb, 0, 0, TRUE); PROTO_ITEM_SET_HIDDEN(ti); - proto_tree_add_uint_format(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, - data_crc, "Data checksum: 0x%02x (incorrect, expected 0x%02x)", + proto_tree_add_uint_format_value(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, + data_crc, "0x%02x (incorrect, expected 0x%02x)", data_crc, data_exp_crc); } } |