aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_a_common.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-15 13:01:27 -0500
committerMichael Mann <mmann78@netscape.net>2016-12-16 03:04:11 +0000
commit232cb9a2dd87ea9cc9c88d4c32bfb7b452705130 (patch)
treeff1b2039727322c1f8e332f2040f0ba5d83c4f43 /epan/dissectors/packet-gsm_a_common.c
parent8efb7fece1ffefd26dacd79f5ec8722c4e01e827 (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-gsm_a_common.c')
-rw-r--r--epan/dissectors/packet-gsm_a_common.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c
index 7d1b7cb13f..686b8ea81b 100644
--- a/epan/dissectors/packet-gsm_a_common.c
+++ b/epan/dissectors/packet-gsm_a_common.c
@@ -1047,8 +1047,7 @@ dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pi
proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
curr_offset += 2;
break;
case 1:
@@ -1061,14 +1060,12 @@ dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pi
proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Vertical Speed Octet 5
* Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
*/
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
curr_offset++;
break;
case 2:
@@ -1079,8 +1076,7 @@ dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pi
proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Uncertainty Speed Octet 5
* Uncertainty speed is encoded in increments of 1 kilometre per hour using an 8 bit binary coded number N. The value of
@@ -1105,14 +1101,12 @@ dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, packet_info *pi
proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
curr_offset += 2;
/* Vertical Speed Octet 5
* Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
*/
- velocity_item = proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_item_append_text(velocity_item, " km/h");
+ proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
curr_offset++;
/* Horizontal Uncertainty Speed Octet 6 */
@@ -4581,12 +4575,12 @@ proto_register_gsm_a_common(void)
},
{ &hf_gsm_a_horizontal_speed,
{ "Horizontal Speed", "gsm_a.gad.horizontal_velocity",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0x0,
NULL, HFILL }
},
{ &hf_gsm_a_vertical_speed,
{ "Vertical Speed", "gsm_a.gad.vertical_speed",
- FT_UINT8, BASE_DEC, NULL, 0x0,
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0x0,
NULL, HFILL }
},
{ &hf_gsm_a_uncertainty_speed,