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/file-png.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/file-png.c')
-rw-r--r-- | epan/dissectors/file-png.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c index cb5d962c13..60f38b6f33 100644 --- a/epan/dissectors/file-png.c +++ b/epan/dissectors/file-png.c @@ -386,43 +386,43 @@ dissect_png_chrm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) gint offset = 0; wx = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_white_x, - tvb, offset, 4, wx, "%f", wx); + proto_tree_add_float(tree, &hfi_png_chrm_white_x, + tvb, offset, 4, wx); offset += 4; wy = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_white_y, - tvb, offset, 4, wy, "%f", wy); + proto_tree_add_float(tree, &hfi_png_chrm_white_y, + tvb, offset, 4, wy); offset += 4; rx = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_red_x, - tvb, offset, 4, rx, "%f", rx); + proto_tree_add_float(tree, &hfi_png_chrm_red_x, + tvb, offset, 4, rx); offset += 4; ry = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_red_y, - tvb, offset, 4, ry, "%f", ry); + proto_tree_add_float(tree, &hfi_png_chrm_red_y, + tvb, offset, 4, ry); offset += 4; gx = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_green_x, - tvb, offset, 4, gx, "%f", gx); + proto_tree_add_float(tree, &hfi_png_chrm_green_x, + tvb, offset, 4, gx); offset += 4; gy = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_green_y, - tvb, offset, 4, gy, "%f", gy); + proto_tree_add_float(tree, &hfi_png_chrm_green_y, + tvb, offset, 4, gy); offset += 4; bx = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_blue_x, - tvb, offset, 4, bx, "%f", bx); + proto_tree_add_float(tree, &hfi_png_chrm_blue_x, + tvb, offset, 4, bx); offset += 4; by = tvb_get_ntohl(tvb, offset) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_chrm_blue_y, - tvb, offset, 4, by, "%f", by); + proto_tree_add_float(tree, &hfi_png_chrm_blue_y, + tvb, offset, 4, by); } static void @@ -431,8 +431,8 @@ dissect_png_gama(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) float gamma; gamma = tvb_get_ntohl(tvb, 0) / 100000.0f; - proto_tree_add_float_format_value(tree, &hfi_png_gama_gamma, - tvb, 0, 4, gamma, "%f", gamma); + proto_tree_add_float(tree, &hfi_png_gama_gamma, + tvb, 0, 4, gamma); } static gint |