[FFmpeg-cvslog] r11404 - trunk/libavutil/tree.c

michael subversion
Fri Jan 4 19:58:36 CET 2008


Author: michael
Date: Fri Jan  4 19:58:36 2008
New Revision: 11404

Log:
Flip key and element so types match, not that it matters for any code
using it in libav*.


Modified:
   trunk/libavutil/tree.c

Modified: trunk/libavutil/tree.c
==============================================================================
--- trunk/libavutil/tree.c	(original)
+++ trunk/libavutil/tree.c	Fri Jan  4 19:58:36 2008
@@ -32,10 +32,10 @@ const int av_tree_node_size = sizeof(AVT
 
 void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const void *b), void *next[2]){
     if(t){
-        unsigned int v= cmp(t->elem, key);
+        unsigned int v= cmp(key, t->elem);
         if(v){
-            if(next) next[(v>>31)^1]= t->elem;
-            return av_tree_find(t->child[v>>31], key, cmp, next);
+            if(next) next[v>>31]= t->elem;
+            return av_tree_find(t->child[(v>>31)^1], key, cmp, next);
         }else{
             if(next){
                 av_tree_find(t->child[0], key, cmp, next);




More information about the ffmpeg-cvslog mailing list