aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-04-02 20:05:14 -0700
committerGuy Harris <guy@alum.mit.edu>2014-04-03 03:05:43 +0000
commit9bd093289c61361104250269af70b3dd3d08bda6 (patch)
treee7a3c9b2918b71d1b764cf7f933e5961632c9e11 /epan
parent0d6f511f22d79d2678d710efee2f4f1409c2a239 (diff)
For single-precision calculations, use single-precision constants.
Otherwise the calculation is done in double precision, and some compilers complain of a double-precision value being assigned to a single-precision variable. Change-Id: I41699fa69e21a2c42d54867765f9fa35a9ab7414 Reviewed-on: https://code.wireshark.org/review/933 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/file-png.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c
index 34ac4e16fc..ce68f934ce 100644
--- a/epan/dissectors/file-png.c
+++ b/epan/dissectors/file-png.c
@@ -381,42 +381,42 @@ dissect_png_chrm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
float wx, wy, rx, ry, gx, gy, bx, by;
gint offset = 0;
- wx = tvb_get_ntohl(tvb, offset) / 100000.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);
offset += 4;
- wy = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- rx = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- ry = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- gx = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- gy = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- bx = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
offset += 4;
- by = tvb_get_ntohl(tvb, offset) / 100000.0;
+ 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);
}