diff mbox series

[5/5] utils: fix double promotions

Message ID 20200423211040.14275-5-rosenp@gmail.com
State New
Headers show
Series None | expand

Commit Message

Rosen Penev April 23, 2020, 9:10 p.m. UTC
Found with -Wdouble-promotion

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/rds-ctl/rds-ctl.cpp                   | 4 ++--
 utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index 0e497b2a..558f5d76 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -521,7 +521,7 @@  static void print_rds_statistics(const struct v4l2_rds_statistics *statistics)
 	printf("received blocks / received groups: %u / %u\n",
 		statistics->block_cnt, statistics->group_cnt);
 
-	float block_error_percentage = 0;
+	double block_error_percentage = 0;
 
 	if (statistics->block_cnt)
 		block_error_percentage =
@@ -530,7 +530,7 @@  static void print_rds_statistics(const struct v4l2_rds_statistics *statistics)
 		statistics->block_error_cnt,
 		block_error_percentage, statistics->group_error_cnt);
 
-	float block_corrected_percentage = 0;
+	double block_corrected_percentage = 0;
 
 	if (statistics->block_cnt)
 		block_corrected_percentage = (
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 561a3376..26947724 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -2597,7 +2597,7 @@  static void streamFmt(struct node *node, __u32 pixelformat, __u32 w, __u32 h,
 	char hz[32] = "";
 
 	if (!frame_count)
-		frame_count = f ? static_cast<unsigned>(1.0f / fract2f(f)) : 10;
+		frame_count = f ? static_cast<unsigned>(1.0 / fract2f(f)) : 10;
 	node->g_fmt(fmt);
 	fmt.s_pixelformat(pixelformat);
 	fmt.s_width(w);