diff mbox series

[1/8] fix GCC enum warning

Message ID 20200727031456.232955-2-rosenp@gmail.com (mailing list archive)
State New, archived
Headers show
Series v4l-utils: C++11 modernization | expand

Commit Message

Rosen Penev July 27, 2020, 3:14 a.m. UTC
Found with -Wenum-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 utils/common/v4l-helpers.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans Verkuil Aug. 3, 2020, 10:13 a.m. UTC | #1
On 27/07/2020 05:14, Rosen Penev wrote:
> Found with -Wenum-compare

Can you copy the warning in this commit log?

Regards,

	Hans

> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  utils/common/v4l-helpers.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
> index e093e717..edd21c16 100644
> --- a/utils/common/v4l-helpers.h
> +++ b/utils/common/v4l-helpers.h
> @@ -877,7 +877,7 @@ v4l_format_g_hsv_enc(const struct v4l2_format *fmt)
>  {
>  	unsigned hsv_enc = v4l_format_g_ycbcr_enc(fmt);
>  
> -	return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc;
> +	return hsv_enc < V4L2_HSV_ENC_180 ? unsigned(V4L2_HSV_ENC_180) : hsv_enc;
>  }
>  
>  static inline void v4l_format_s_quantization(struct v4l2_format *fmt,
>
diff mbox series

Patch

diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
index e093e717..edd21c16 100644
--- a/utils/common/v4l-helpers.h
+++ b/utils/common/v4l-helpers.h
@@ -877,7 +877,7 @@  v4l_format_g_hsv_enc(const struct v4l2_format *fmt)
 {
 	unsigned hsv_enc = v4l_format_g_ycbcr_enc(fmt);
 
-	return hsv_enc < V4L2_HSV_ENC_180 ? V4L2_HSV_ENC_180 : hsv_enc;
+	return hsv_enc < V4L2_HSV_ENC_180 ? unsigned(V4L2_HSV_ENC_180) : hsv_enc;
 }
 
 static inline void v4l_format_s_quantization(struct v4l2_format *fmt,