apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1666479 - /apr/apr/branches/1.5.x/test/testskiplist.c
Date Fri, 13 Mar 2015 15:20:54 GMT
Author: jim
Date: Fri Mar 13 15:20:53 2015
New Revision: 1666479

URL: http://svn.apache.org/r1666479
Log:
For positioning tests, use the likely API to be used by clients.
ie: apr_skiplist_insert w/ "tricky" comp functions.

Modified:
    apr/apr/branches/1.5.x/test/testskiplist.c

Modified: apr/apr/branches/1.5.x/test/testskiplist.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/test/testskiplist.c?rev=1666479&r1=1666478&r2=1666479&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/test/testskiplist.c (original)
+++ apr/apr/branches/1.5.x/test/testskiplist.c Fri Mar 13 15:20:53 2015
@@ -261,17 +261,17 @@ typedef struct elem {
 static void add_int_to_skiplist(apr_skiplist *list, int n){
     int* a = apr_skiplist_alloc(list, sizeof(int));
     *a = n;
-    apr_skiplist_add(list, a);
+    apr_skiplist_insert(list, a);
 }
 
 static void add_elem_to_skiplist(apr_skiplist *list, elem n){
     elem* a = apr_skiplist_alloc(list, sizeof(elem));
     *a = n;
-    apr_skiplist_add(list, a);
+    apr_skiplist_insert(list, a);
 }
 
 static int comp(void *a, void *b){
-    return *((int*) a) - *((int*) b);
+    return (*((int*) a) < *((int*) b)) ? -1 : 1;
 }
 
 static int compk(void *a, void *b){
@@ -279,7 +279,7 @@ static int compk(void *a, void *b){
 }
 
 static int scomp(void *a, void *b){
-    return ((elem*) a)->a - ((elem*) b)->a;
+    return (((elem*) a)->a < ((elem*) b)->a) ? -1 : 1;
 }
 
 static int scompk(void *a, void *b){



Mime
View raw message