[vlc-devel] [PATCH 3/4] vlc_common.h: Ensure clip_uint8_vlc returns an uint8_t
Steve Lhomme
robux4 at ycbcr.xyz
Thu Oct 22 09:53:10 CEST 2020
LGTM
On 2020-10-22 9:49, Hugo Beauzée-Luyssen wrote:
> Even though the modified branch is logically guaranteed to return a
> number that fits in an uint8, some compilers will complain that a signed
> 32 bits integer is returned
> ---
> include/vlc_common.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/vlc_common.h b/include/vlc_common.h
> index 323df74653..9742d2b943 100644
> --- a/include/vlc_common.h
> +++ b/include/vlc_common.h
> @@ -585,7 +585,7 @@ VLC_USED
> static inline uint8_t clip_uint8_vlc( int32_t a )
> {
> if( a&(~255) ) return (-a)>>31;
> - else return a;
> + else return (uint8_t)a;
> }
>
> /**
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list