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

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


-----BEGIN PGP SIGNED MESSAGE-----
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)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEnVENa8/cc5b1WpwRAv8bAKDR4ji3qGC50s0uB+9BfnoM60nwmQCgnFI8
3k5CZVC9AepbsD0IdxjYFoo=
=rzYW
-----END PGP SIGNATURE-----




More information about the ffmpeg-devel mailing list