convert cable freq, symbol rate into doubles

Change-Id: Iaddd3c4847e803af855c847212ae822b2529ff06
Reviewed-on: https://code.wireshark.org/review/1860
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
This commit is contained in:
Martin Kaiser 2014-05-29 17:56:17 +02:00
parent 91dac2771b
commit 7aecd47be7
1 changed files with 12 additions and 12 deletions

View File

@ -834,13 +834,13 @@ static value_string_ext mpeg_descr_cable_delivery_fec_inner_vals_ext = VALUE_STR
static void
proto_mpeg_descriptor_dissect_cable_delivery(tvbuff_t *tvb, guint offset, proto_tree *tree) {
float frequency, symbol_rate;
double frequency, symbol_rate;
frequency = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)) * 100.0f +
frequency = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)) * 100.0 +
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+1)) +
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+2)) / 100.0f +
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)) / 10000.f;
proto_tree_add_float_format_value(tree, hf_mpeg_descr_cable_delivery_frequency,
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+2)) / 100.0 +
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)) / 10000.0;
proto_tree_add_double_format_value(tree, hf_mpeg_descr_cable_delivery_frequency,
tvb, offset, 4, frequency, "%4.4f MHz", frequency);
offset += 4;
@ -851,12 +851,12 @@ proto_mpeg_descriptor_dissect_cable_delivery(tvbuff_t *tvb, guint offset, proto_
proto_tree_add_item(tree, hf_mpeg_descr_cable_delivery_modulation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
symbol_rate = 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 +
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+2)) / 1000.0f +
symbol_rate = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)) * 10.0 +
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 +
/* symbol rate is 28 bits, only the upper 4 bits of this byte are used */
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)>>4) / 10000.0f;
proto_tree_add_float_format_value(tree, hf_mpeg_descr_cable_delivery_symbol_rate,
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)>>4) / 10000.0;
proto_tree_add_double_format_value(tree, hf_mpeg_descr_cable_delivery_symbol_rate,
tvb, offset, 4, symbol_rate, "%3.4f KSymbol/s", symbol_rate);
offset += 3;
proto_tree_add_item(tree, hf_mpeg_descr_cable_delivery_fec_inner, tvb, offset, 1, ENC_BIG_ENDIAN);
@ -3332,7 +3332,7 @@ proto_register_mpeg_descriptor(void)
/* 0x44 Cable Delivery System Descriptor */
{ &hf_mpeg_descr_cable_delivery_frequency, {
"Frequency", "mpeg_descr.cable_delivery.freq",
FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL
FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL
} },
{ &hf_mpeg_descr_cable_delivery_reserved, {
@ -3353,7 +3353,7 @@ proto_register_mpeg_descriptor(void)
{ &hf_mpeg_descr_cable_delivery_symbol_rate, {
"Symbol Rate", "mpeg_descr.cable_delivery.sym_rate",
FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL
FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL
} },
{ &hf_mpeg_descr_cable_delivery_fec_inner, {