diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-12 13:22:05 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-13 22:56:36 +0000 |
commit | a869ec6f55160622a90bc437517dee91d57f85d5 (patch) | |
tree | ea55cf7ba5f820af87e01d2a28d38d6b6ebe547e /epan/dissectors/packet-mpeg-descriptor.c | |
parent | e150235ef14cf6a9ada7d74c534e4aee469f3ac5 (diff) |
Adjust proto_tree_add_[float|double]_format_value calls to use unit string
Several calls to proto_tree_add_[float|double]_xxx could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field.
Added a few more "common" unit string values to unit_strings.[ch]
Change-Id: Id0da7b579403898d20c2667d6c4abcd59d5a48d4
Reviewed-on: https://code.wireshark.org/review/19241
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-mpeg-descriptor.c')
-rw-r--r-- | epan/dissectors/packet-mpeg-descriptor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c index db1eca1cc4..73d8b8c4fc 100644 --- a/epan/dissectors/packet-mpeg-descriptor.c +++ b/epan/dissectors/packet-mpeg-descriptor.c @@ -749,14 +749,14 @@ proto_mpeg_descriptor_dissect_satellite_delivery(tvbuff_t *tvb, guint offset, pr MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+1)) / 10.0 + MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+2)) / 1000.0 + MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)) / 100000.0; - proto_tree_add_double_format_value(tree, hf_mpeg_descr_satellite_delivery_frequency, - tvb, offset, 4, frequency, "%f GHz", frequency); + proto_tree_add_double(tree, hf_mpeg_descr_satellite_delivery_frequency, + tvb, offset, 4, frequency); offset += 4; orbital_position = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)) * 10.0f + MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+1)) / 10.0f; - proto_tree_add_float_format_value(tree, hf_mpeg_descr_satellite_delivery_orbital_position, - tvb, offset, 2, orbital_position, "%f degrees", orbital_position); + proto_tree_add_float(tree, hf_mpeg_descr_satellite_delivery_orbital_position, + tvb, offset, 2, orbital_position); offset += 2; modulation_system = tvb_get_guint8(tvb, offset) & MPEG_DESCR_SATELLITE_DELIVERY_MODULATION_SYSTEM_MASK; @@ -3481,12 +3481,12 @@ proto_register_mpeg_descriptor(void) /* 0x43 Satellite Delivery System Descriptor */ { &hf_mpeg_descr_satellite_delivery_frequency, { "Frequency", "mpeg_descr.sat_delivery.freq", - FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL + FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, &units_ghz, 0, NULL, HFILL } }, { &hf_mpeg_descr_satellite_delivery_orbital_position, { "Orbital Position", "mpeg_descr.sat_delivery.orbital_pos", - FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_degree_degrees, 0, NULL, HFILL } }, { &hf_mpeg_descr_satellite_delivery_west_east_flag, { |