[FFmpeg-devel] & vs. &&

Benoit Fouet benoit.fouet
Mon Oct 12 16:28:42 CEST 2009


On 2009-10-12 16:11, M?ns Rullg?rd wrote:
> Kostya <kostya.shishkov at gmail.com> writes:
> 
>> On Mon, Oct 12, 2009 at 02:21:06PM +0200, Benoit Fouet wrote:
>>> Hi,
>>>
>> [...]
>>> second one:
>>> libavcodec/vc1dec.c:2318: warning: suggest parentheses around operand of
>>> ?!? or change ?&? to ?&&? or ?!? to ?~?
>>> =========== ><8 ===========
>>> if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i];
>>> =========== 8>< ===========
>>>
>>> although this is the same functionnaly as '!is_intra[i] && is_coded[i]',
>>> I find the latter more close to what we really want to test.
>>>
>>> I'd suspect the second case should be fixed as suggested (i.e. '&' =>
>>> '&&'), but would like to hear knowledgeable people for the first one.
>> Yep, it should be the same for the second case, so change it if you like.
> 
> Beware, the && version might be slower.
> 

I suspected something like that... I have no strong opinion for this
case, anyway; but the first one was a real bug.

Ben



More information about the ffmpeg-devel mailing list