From 7c8fcbbde3a299096974f9061c8b5be0e526f4c2 Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde Date: Sat, 24 Oct 2015 17:53:21 -0400 Subject: avutil/tree: add additional const qualifier to the comparator libc's qsort comparator has a const qualifier on both arguments. This adds a missing const qualifier to exactly match the comparator API. Existing usages of av_tree_find, av_tree_insert are appropriately modified: type signature changes of the comparators, and removal of unnecessary void * casts of function pointers. Reviewed-by: Henrik Gramner Reviewed-by: wm4 Signed-off-by: Ganesh Ajjanagadde --- libavutil/tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavutil/tree.h') diff --git a/libavutil/tree.h b/libavutil/tree.h index f04f02d..337a44c 100644 --- a/libavutil/tree.h +++ b/libavutil/tree.h @@ -62,7 +62,7 @@ struct AVTreeNode *av_tree_node_alloc(void); * exists in the tree. */ void *av_tree_find(const struct AVTreeNode *root, void *key, - int (*cmp)(void *key, const void *b), void *next[2]); + int (*cmp)(const void *key, const void *b), void *next[2]); /** * Insert or remove an element. @@ -109,7 +109,7 @@ void *av_tree_find(const struct AVTreeNode *root, void *key, * should make no assumptions that it's one or the other in the code. */ void *av_tree_insert(struct AVTreeNode **rootp, void *key, - int (*cmp)(void *key, const void *b), + int (*cmp)(const void *key, const void *b), struct AVTreeNode **next); void av_tree_destroy(struct AVTreeNode *t); -- cgit v1.1