[FFmpeg-devel] [PATCH]lavc/utvideo: Use "&" instead of "&&" in expressions with "~"

Ronald S. Bultje rsbultje at gmail.com
Sun Oct 8 02:58:15 EEST 2017


Hi,

On Sat, Oct 7, 2017 at 7:05 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> Hi!
>
> Attached patch silences two warnings when compiling with gcc-7:
> libavcodec/utvideodec.c:242:107: warning: ‘~’ on a boolean expression
> [-Wbool-operation]
>      const int cmask = c->interlaced ? ~(1 + 2 * (!plane_no &&
> c->avctx->pix_fmt == AV_PIX_FMT_YUV420P)) : ~(!plane_no &&
> c->avctx->pix_fmt == AV_PIX_FMT_YUV420P);
>
> Please comment, Carl Eugen
>

I personally think the warning is dumb... But I guess that's just me.

(I understand why it exists for javascript developers dipping their toes in
My First Pony C. But we're not these kind of developers.)

Ronald


More information about the ffmpeg-devel mailing list