[Ffmpeg-devel] [PATCH] Fix some compiler warnings

Pieter Hollants pieter
Sat Jun 24 16:49:49 CEST 2006

Hash: SHA1

Michael Niedermayer schrieb:
>> The attached patch fixes some compiler warnings in the current SVN code.
>> The typecasts should be pretty self-explainatory, 
> yes you cast const to non const to hide warnings, this is unacceptable
> warnings can be hidden with compiler flags or the code can be fixed by 
> marking things which are const as such

The point is not to "hide" warnings which are there for a purpose, but
to fix them. Of course not const to non-const, perhaps I missed that
last night. To which hunk are you referring here?

>> for the byte shifting
>> operations I added the module operator, which makes sure the apparantly
>> desired shift results are reached without exceeding the variable's width.
> wtf?! RTF 5lines of code you changed, the code is perfectly fine for 
> FRAC_BITS from 0 to 8, and above 8 it will not work, your change might
> hide one of 2 warnings a FRAC_BITS of 9 should generate but it doesnt even
> partly fix the code in that case
> and FRAC_BITS is #defied to 8 

Accepted, but then what would be your suggestion to fix that part for
the mean time? Is it correct to change the if-statement into
"if(FRAC_BITS < 8)" and throw a #warning in an else-clause, until
someone steps up and fixes the whole thing for FRAC_BITS > 8?

>> And yes, I know that's code that probably needs a rewrite anyway, 
> no, the code is mostly fine, sure it can be cleaned up though but a
> rewrite is certainly not appropriate

That's why I said "probably", for I am not to judge, but someone might
have stepped up with the argument "no need for little fixes, we need a
large fix".

- --
Pieter "Fate" Hollants <pieter at hollants.com>
(a current GnuPG key is available at www.hollants.com/gnupg.txt)
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the ffmpeg-devel mailing list