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

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


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)
 {
     if (!*s2)
         return s1;
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 01c2391..13c85db 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -58,7 +58,7 @@ int av_stristart(const char *str, const char *pfx, const char **ptr);
  * @return         pointer to the located match within haystack
  *                 or a null pointer if no match
  */
-char *av_stristr(const char *haystack, const char *needle);
+const char *av_stristr(const char *haystack, const char *needle);
 
 /**
  * Copy the string src to dst, but no more than size - 1 bytes, and
-- 
1.7.1




More information about the ffmpeg-devel mailing list