[FFmpeg-devel] [PATCH] fix warning in libavutil/fifo.c

Baptiste Coudurier baptiste.coudurier
Tue Jan 13 21:52:01 CET 2009


Hi,

Michael Niedermayer wrote:
> On Mon, Jan 12, 2009 at 10:33:12PM +0100, Diego Biurrun wrote:
>> On Mon, Jan 12, 2009 at 09:13:58PM +0100, Michael Niedermayer wrote:
>>> On Sun, Jan 11, 2009 at 10:17:18PM +0100, Diego Biurrun wrote:
>>>> Here is a patch to fix
>>>>
>>>> fifo.c:79: warning: cast discards qualifiers from pointer target type
>>>>
>>>> --- libavutil/fifo.c	(revision 16549)
>>>> +++ libavutil/fifo.c	(working copy)
>>>> @@ -74,7 +74,7 @@
>>>>  
>>>> -void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size)
>>>> +void av_fifo_write(AVFifoBuffer *f, uint8_t *buf, int size)
>>> I belive av_fifo_write does not change the content of buf thus const
>>> is correct
>> Umm, I beg to differ. av_fifo_write is just a wrapper for
>> av_fifo_generic_write, 
> 
> 
>> which does modify buf, hence the warning.
> 
> where does it modify the _CONTENT_OF_ buf?
> 
> It does not do this anywhere in the case where it is called through
> av_fifo_write thus the const is correct.
> av_fifo_write can be used with const arrays, if you remove the cont in the
> parameter of av_fifo_write() you will have a warning for every use of
> av_fifo_write() with a const argument, i doubt you prefer this ...

Would changing the prototype of 'func' to take const void * fix it ?


-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org




More information about the ffmpeg-devel mailing list