]> git.sesse.net Git - ffmpeg/commitdiff
dict: const correctness for av_dict_get() and av_dict_copy()
authorDiego Biurrun <diego@biurrun.de>
Wed, 4 Jun 2014 11:58:33 +0000 (04:58 -0700)
committerDiego Biurrun <diego@biurrun.de>
Thu, 5 Jun 2014 16:16:15 +0000 (09:16 -0700)
libavutil/dict.c
libavutil/dict.h

index 3b95aba46066078c046711ea01eb236fe6b635b3..7b4dbf29ac755e05081305a9edd5390f5a67820e 100644 (file)
@@ -35,7 +35,7 @@ int av_dict_count(const AVDictionary *m)
     return m ? m->count : 0;
 }
 
-AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key,
+AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,
                                const AVDictionaryEntry *prev, int flags)
 {
     unsigned int i, j;
@@ -178,7 +178,7 @@ void av_dict_free(AVDictionary **pm)
     av_freep(pm);
 }
 
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)
+void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
 {
     AVDictionaryEntry *t = NULL;
 
index e0a91ae8367c54a9e468d3a458dcffbc68085409..e4aee27ca3b1f32472fe74b52a9d65f7fdfc9d49 100644 (file)
@@ -83,8 +83,8 @@ typedef struct AVDictionary AVDictionary;
  * @param flags Allows case as well as suffix-insensitive comparisons.
  * @return Found entry or NULL, changing key or value leads to undefined behavior.
  */
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,
+                               const AVDictionaryEntry *prev, int flags);
 
 /**
  * Get number of entries in dictionary.
@@ -131,7 +131,7 @@ int av_dict_parse_string(AVDictionary **pm, const char *str,
  * @param flags flags to use when setting entries in *dst
  * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
  */
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
 
 /**
  * Free all the memory allocated for an AVDictionary struct