Re: [PATCH 07/12] utils: fix implicit double promotion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/04/2020 02:37, Rosen Penev wrote:
> Found with -Wimplicit-float-conversion
> 
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
>  utils/rds-ctl/rds-ctl.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
> index 0e497b2a..cc1d3bf7 100644
> --- a/utils/rds-ctl/rds-ctl.cpp
> +++ b/utils/rds-ctl/rds-ctl.cpp
> @@ -525,7 +525,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics)
>  
>  	if (statistics->block_cnt)
>  		block_error_percentage =
> -			(static_cast<float>(statistics->block_error_cnt) / statistics->block_cnt) * 100.0;
> +			(static_cast<float>(statistics->block_error_cnt) / statistics->block_cnt) * 100.0f;
>  	printf("block errors / group errors: %u (%3.2f%%) / %u \n",
>  		statistics->block_error_cnt,
>  		block_error_percentage, statistics->group_error_cnt);
> @@ -534,7 +534,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics)
>  
>  	if (statistics->block_cnt)
>  		block_corrected_percentage = (
> -			static_cast<float>(statistics->block_corrected_cnt) / statistics->block_cnt) * 100.0;
> +			static_cast<float>(statistics->block_corrected_cnt) / statistics->block_cnt) * 100.0f;
>  	printf("corrected blocks: %u (%3.2f%%)\n",
>  		statistics->block_corrected_cnt, block_corrected_percentage);
>  	for (int i = 0; i < 16; i++)
> 

I think this patch can be removed once the type of block_error_percentage and
block_corrected_percentage is changed to double, so I am skipping this patch.

Regards,

	Hans



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux