Alex Converse <alex.conve...@gmail.com> writes:

> 2012/1/23 Måns Rullgård <m...@mansr.com>:
>> Alex Converse <alex.conve...@gmail.com> writes:
>>
>>> ---
>>>  libavcodec/aacenc.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
>>> index b4045ab..32c8101 100644
>>> --- a/libavcodec/aacenc.c
>>> +++ b/libavcodec/aacenc.c
>>> @@ -464,7 +464,7 @@ static void put_bitstream_info(AVCodecContext *avctx, 
>>> AACEncContext *s,
>>>      if (namelen >= 15)
>>>          put_bits(&s->pb, 8, namelen - 14);
>>>      put_bits(&s->pb, 4, 0); //extension type - filler
>>> -    padbits = 8 - (put_bits_count(&s->pb) & 7);
>>> +    padbits = (-put_bits_count(&s->pb)) & 7;
>>
>> Unnecessary parentheses.
>
> I'm aware they are unnecessary. Fairly often I'm asked to put in extra
> parenthesis anyway, particularly around 'and' and 'or' operators. Is
> there a list of cases where libav developers demand unnecessary
> parentheses?

Unary operators all have higher precedence than binary ones, and the
spaces make this obvious as well.  In situations like this, seeing the
parentheses forces me to spend time looking extra carefully to be sure
there isn't something funny going on.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to