[FFmpeg-cvslog] aviobuf: Fix warning about discarded qualifier

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Jul 27 18:50:51 CEST 2012


On Fri, Jul 27, 2012 at 06:47:39PM +0200, Michael Niedermayer wrote:
> On Fri, Jul 27, 2012 at 06:30:52PM +0200, Reimar Döffinger wrote:
> > On Fri, Jul 27, 2012 at 01:15:30PM +0200, jamal wrote:
> > > ffmpeg | branch: master | jamal <jamrial at gmail.com> | Fri Jul 27 05:23:23 2012 -0300| [c49e0d2cdd8b91161f4b8c22b130ab4bd6e71b71] | committer: Michael Niedermayer
> > > 
> > > aviobuf: Fix warning about discarded qualifier
> > > 
> > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > 
> > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c49e0d2cdd8b91161f4b8c22b130ab4bd6e71b71
> > > ---
> > > 
> > >  libavformat/aviobuf.c |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> > > index 05df001..f6a914a 100644
> > > --- a/libavformat/aviobuf.c
> > > +++ b/libavformat/aviobuf.c
> > > @@ -122,7 +122,7 @@ AVIOContext *avio_alloc_context(
> > >  static void writeout(AVIOContext *s, const uint8_t *data, int len)
> > >  {
> > >      if (s->write_packet && !s->error){
> > > -        int ret= s->write_packet(s->opaque, data, len);
> > > +        int ret= s->write_packet(s->opaque, (uint8_t *)data, len);
> > 
> > Doesn't that rather just hide that the write_packet definition is
> > just wrong,
> 
> its not wrong, read only fields do not "need" to be const.

Well, it isn't documented that write_packet may not write into data
either.
I'd kind of consider code that breaks when a user fails to magically
guess a non-documented constraint at least kind of broken.


More information about the ffmpeg-cvslog mailing list