diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-15 13:01:27 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-16 03:04:11 +0000 |
commit | 232cb9a2dd87ea9cc9c88d4c32bfb7b452705130 (patch) | |
tree | ff1b2039727322c1f8e332f2040f0ba5d83c4f43 /epan/dissectors/packet-usb-ccid.c | |
parent | 8efb7fece1ffefd26dacd79f5ec8722c4e01e827 (diff) |
Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.
Many proto_item_append_text calls were just adding a unit string to a field.
There's a better way to do that now.
Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78
Reviewed-on: https://code.wireshark.org/review/19289
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-usb-ccid.c')
-rw-r--r-- | epan/dissectors/packet-usb-ccid.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c index 2352ac6cb7..596991de1b 100644 --- a/epan/dissectors/packet-usb-ccid.c +++ b/epan/dissectors/packet-usb-ccid.c @@ -345,13 +345,11 @@ dissect_usb_ccid_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, ENC_LITTLE_ENDIAN); offset += 4; - freq_item = proto_tree_add_item(desc_tree, hf_ccid_dwDefaultClock, tvb, + proto_tree_add_item(desc_tree, hf_ccid_dwDefaultClock, tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_item_append_text(freq_item, " kHz"); offset += 4; - freq_item = proto_tree_add_item(desc_tree, hf_ccid_dwMaximumClock, tvb, + proto_tree_add_item(desc_tree, hf_ccid_dwMaximumClock, tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_item_append_text(freq_item, " kHz"); offset += 4; num_clock_supp = tvb_get_guint8(tvb, offset); freq_item = proto_tree_add_item(desc_tree, hf_ccid_bNumClockSupported, tvb, @@ -693,10 +691,10 @@ proto_register_ccid(void) TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, {&hf_ccid_dwDefaultClock, { "default clock frequency", "usbccid.dwDefaultClock", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_khz, 0x0, NULL, HFILL }}, {&hf_ccid_dwMaximumClock, { "maximum clock frequency", "usbccid.dwMaximumClock", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_khz, 0x0, NULL, HFILL }}, {&hf_ccid_bNumClockSupported, { "number of supported clock frequencies", "usbccid.bNumClockSupported", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, |