[Ffmpeg-devel] [PATCH] Fix some compiler warnings
Sat Jun 24 17:31:23 CEST 2006
Pieter Hollants <pieter at hollants.com> writes:
> 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?
Most of them.
>>> 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?
Huh? C doesn't work like that.
mru at inprovide.com
More information about the ffmpeg-devel