[FFmpeg-devel] [PATCH 5/5] Fix constness for the return value of av_stristr().

Stefano Sabatini stefano.sabatini-lala
Sun Jun 13 13:53:04 CEST 2010


On date Sunday 2010-06-13 11:29:35 +0100, M?ns Rullg?rd encoded:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> 
> > Fix gcc warnings:
> > avstring.c: In function `av_stristr':
> > avstring.c:54: warning: return discards qualifiers from pointer target type
> > avstring.c:58: warning: return discards qualifiers from pointer target type
> > ---
> >  libavutil/avstring.c |    2 +-
> >  libavutil/avstring.h |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavutil/avstring.c b/libavutil/avstring.c
> > index 4844e28..c9751da 100644
> > --- a/libavutil/avstring.c
> > +++ b/libavutil/avstring.c
> > @@ -48,7 +48,7 @@ int av_stristart(const char *str, const char *pfx, const char **ptr)
> >      return !*pfx;
> >  }
> >
> > -char *av_stristr(const char *s1, const char *s2)
> > +const char *av_stristr(const char *s1, const char *s2)
> 
> This will introduce warnings in many places where the function is used
> instead.  There is no solution.

Looks semantically more correct, the other warnings can be fixed using
intermediate variables.

Regards.
-- 
FFmpeg = Forgiving Freak Mysterious Portable Exxagerate Gnome



More information about the ffmpeg-devel mailing list