From 44d2f1ccfa73b2c04a0de6c15a96b83c64cf7771 Mon Sep 17 00:00:00 2001 From: ppisa Date: Thu, 9 Dec 2004 00:24:27 +0000 Subject: [PATCH] Fixed bug in evaluation of return value in gavl_search_node() function. Bug reported by Neal H. Walfield. It slipped into code 23 Oct 2003 and has been unnoticed until now, because all CAN code switched to custom tree version before bug introduction. --- ulut/ul_gavl.c | 2 +- ulut/ul_gavlchk.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ulut/ul_gavl.c b/ulut/ul_gavl.c index 88e714a..1ecf029 100644 --- a/ulut/ul_gavl.c +++ b/ulut/ul_gavl.c @@ -150,7 +150,7 @@ gavl_search_node(const gavl_root_t *root, const void *key, cmp=0; } *nodep=p; - return cmp; + return (mode&GAVL_FCMP)?cmp:1; } /** diff --git a/ulut/ul_gavlchk.c b/ulut/ul_gavlchk.c index 45b9dd6..2393853 100644 --- a/ulut/ul_gavlchk.c +++ b/ulut/ul_gavlchk.c @@ -335,7 +335,7 @@ void cust_timing_test(void) { int i; int items_cnt=100000; - cust2_item_t *items; + cust2_item_t *items, *item; struct timeval time_start, time_stop; printf("\nRunning custom tree timing test for %d items\n",items_cnt); @@ -361,8 +361,11 @@ void cust_timing_test(void) gettimeofday(&time_start,NULL); for(i=0;imy_val!=i) + printf("gavl_find mismatch\n"); } gettimeofday(&time_stop,NULL); timing_test_print(&time_start,&time_stop,"cust find"); -- 2.39.2