[FFmpeg-devel] [RFC]lavu/opt: Use && instead of * in boolean expression

Michael Niedermayer michael at niedermayer.cc
Fri May 5 14:43:03 EEST 2017


On Fri, May 05, 2017 at 09:26:05AM +0200, Carl Eugen Hoyos wrote:
> 2017-05-05 3:12 GMT+02:00 Aaron Levinson <alevinsn at aracnet.com>:
> > On 5/4/2017 4:32 PM, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> It may be better to disable the warning.
> >>
> >> Carl Eugen
> >>
> >> -        num = den ? num * intnum / den : (num * intnum ? INFINITY : NAN);
> >> +        num = den ? num * intnum / den : (num && intnum ? INFINITY : NAN);
> >
> > In order to preserve the original logic, why not do the following:
> >
> > +        num = den ? num * intnum / den : (((num * intnum) != 0) ? INFINITY : NAN);
> 
> Simpler patch attached.
> 
> Carl Eugen

>  configure |    1 +
>  1 file changed, 1 insertion(+)
> 06cf250153c05fb3392bd88c4a88f8fa056c26f2  0001-configure-Silence-a-less-useful-warning.patch
> From 65811b8d63aee1bb02dc3d379bfba74b72524e67 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
> Date: Fri, 5 May 2017 09:24:28 +0200
> Subject: [PATCH] configure: Silence a less useful warning.
> 
> Silences the following warning:
> warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
> ---
>  configure |    1 +
>  1 file changed, 1 insertion(+)

probably ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170505/c7678aa4/attachment.sig>


More information about the ffmpeg-devel mailing list