changed API of sort algorithms (no further hint for the algorithms used in preparation for the upcomming change from qsort to natural merge sort)

Thu, 16 Aug 2012 11:31:16 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 16 Aug 2012 11:31:16 +0200
changeset 36
a9d656e4f7ce
parent 35
fdabd1240b69
child 37
ec296899d12f

changed API of sort algorithms (no further hint for the algorithms used in preparation for the upcomming change from qsort to natural merge sort)

test/dlist_tests.c file | annotate | diff | comparison | revisions
test/dlist_tests.h file | annotate | diff | comparison | revisions
test/list_tests.c file | annotate | diff | comparison | revisions
test/list_tests.h file | annotate | diff | comparison | revisions
test/main.c file | annotate | diff | comparison | revisions
ucx/dlist.c file | annotate | diff | comparison | revisions
ucx/dlist.h file | annotate | diff | comparison | revisions
ucx/list.c file | annotate | diff | comparison | revisions
ucx/list.h file | annotate | diff | comparison | revisions
     1.1 --- a/test/dlist_tests.c	Wed Aug 15 19:32:29 2012 +0200
     1.2 +++ b/test/dlist_tests.c	Thu Aug 16 11:31:16 2012 +0200
     1.3 @@ -166,7 +166,7 @@
     1.4      ucx_dlist_free(copy);
     1.5  }
     1.6  
     1.7 -UCX_TEST_IMPLEMENT(test_ucx_dlist_qsort) {
     1.8 +UCX_TEST_IMPLEMENT(test_ucx_dlist_sort) {
     1.9      UcxDlist *list = ucx_dlist_append(NULL, "this");
    1.10      list = ucx_dlist_append(list, "is");
    1.11      list = ucx_dlist_append(list, "a");
    1.12 @@ -183,7 +183,7 @@
    1.13      expected = ucx_dlist_append(expected, "test");
    1.14      expected = ucx_dlist_append(expected, "this");
    1.15  
    1.16 -    list = ucx_dlist_qsort(list, cmp_string, NULL);
    1.17 +    list = ucx_dlist_sort(list, cmp_string, NULL);
    1.18  
    1.19      UCX_TEST_BEGIN
    1.20      UCX_TEST_ASSERT(
     2.1 --- a/test/dlist_tests.h	Wed Aug 15 19:32:29 2012 +0200
     2.2 +++ b/test/dlist_tests.h	Thu Aug 16 11:31:16 2012 +0200
     2.3 @@ -32,7 +32,7 @@
     2.4  UCX_TEST_DECLARE(test_ucx_dlist_get)
     2.5  UCX_TEST_DECLARE(test_ucx_dlist_remove)
     2.6  UCX_TEST_DECLARE(test_ucx_dlist_clone)
     2.7 -UCX_TEST_DECLARE(test_ucx_dlist_qsort)
     2.8 +UCX_TEST_DECLARE(test_ucx_dlist_sort)
     2.9  
    2.10  #ifdef	__cplusplus
    2.11  }
     3.1 --- a/test/list_tests.c	Wed Aug 15 19:32:29 2012 +0200
     3.2 +++ b/test/list_tests.c	Thu Aug 16 11:31:16 2012 +0200
     3.3 @@ -154,7 +154,7 @@
     3.4      ucx_list_free(copy);
     3.5  }
     3.6  
     3.7 -UCX_TEST_IMPLEMENT(test_ucx_list_qsort) {
     3.8 +UCX_TEST_IMPLEMENT(test_ucx_list_sort) {
     3.9      UcxList *list = ucx_list_append(NULL, "this");
    3.10      list = ucx_list_append(list, "is");
    3.11      list = ucx_list_append(list, "a");
    3.12 @@ -171,7 +171,7 @@
    3.13      expected = ucx_list_append(expected, "test");
    3.14      expected = ucx_list_append(expected, "this");
    3.15  
    3.16 -    list = ucx_list_qsort(list, cmp_string, NULL);
    3.17 +    list = ucx_list_sort(list, cmp_string, NULL);
    3.18  
    3.19      UCX_TEST_BEGIN
    3.20      UCX_TEST_ASSERT(
     4.1 --- a/test/list_tests.h	Wed Aug 15 19:32:29 2012 +0200
     4.2 +++ b/test/list_tests.h	Thu Aug 16 11:31:16 2012 +0200
     4.3 @@ -31,7 +31,7 @@
     4.4  UCX_TEST_DECLARE(test_ucx_list_get)
     4.5  UCX_TEST_DECLARE(test_ucx_list_remove)
     4.6  UCX_TEST_DECLARE(test_ucx_list_clone)
     4.7 -UCX_TEST_DECLARE(test_ucx_list_qsort)
     4.8 +UCX_TEST_DECLARE(test_ucx_list_sort)
     4.9  
    4.10  #ifdef	__cplusplus
    4.11  }
     5.1 --- a/test/main.c	Wed Aug 15 19:32:29 2012 +0200
     5.2 +++ b/test/main.c	Thu Aug 16 11:31:16 2012 +0200
     5.3 @@ -116,7 +116,7 @@
     5.4          ucx_test_register(suite, test_ucx_list_get);
     5.5          ucx_test_register(suite, test_ucx_list_remove);
     5.6          ucx_test_register(suite, test_ucx_list_clone);
     5.7 -        ucx_test_register(suite, test_ucx_list_qsort);
     5.8 +        ucx_test_register(suite, test_ucx_list_sort);
     5.9          
    5.10          /* UcxDlist Tests */
    5.11          ucx_test_register(suite, test_ucx_dlist_append);
    5.12 @@ -129,7 +129,7 @@
    5.13          ucx_test_register(suite, test_ucx_dlist_get);
    5.14          ucx_test_register(suite, test_ucx_dlist_remove);
    5.15          ucx_test_register(suite, test_ucx_dlist_clone);
    5.16 -        ucx_test_register(suite, test_ucx_dlist_qsort);
    5.17 +        ucx_test_register(suite, test_ucx_dlist_sort);
    5.18  
    5.19          /* UcxMemPool Tests */
    5.20          ucx_test_register(suite, test_ucx_mempool_new);
     6.1 --- a/ucx/dlist.c	Wed Aug 15 19:32:29 2012 +0200
     6.2 +++ b/ucx/dlist.c	Thu Aug 16 11:31:16 2012 +0200
     6.3 @@ -145,7 +145,7 @@
     6.4      }
     6.5  }
     6.6  
     6.7 -UcxDlist *ucx_dlist_qsort(UcxDlist *l, cmp_func fnc, void *data) {
     6.8 +UcxDlist *ucx_dlist_sort(UcxDlist *l, cmp_func fnc, void *data) {
     6.9      if (l == NULL) {
    6.10          return NULL;
    6.11      }
     7.1 --- a/ucx/dlist.h	Wed Aug 15 19:32:29 2012 +0200
     7.2 +++ b/ucx/dlist.h	Thu Aug 16 11:31:16 2012 +0200
     7.3 @@ -30,7 +30,7 @@
     7.4  UcxDlist *ucx_dlist_get(UcxDlist *l, int index);
     7.5  size_t ucx_dlist_size(UcxDlist *l);
     7.6  
     7.7 -UcxDlist *ucx_dlist_qsort(UcxDlist *l, cmp_func fnc, void *data);
     7.8 +UcxDlist *ucx_dlist_sort(UcxDlist *l, cmp_func fnc, void *data);
     7.9  
    7.10  /* dlist specific functions */
    7.11  UcxDlist *ucx_dlist_first(UcxDlist *l);
     8.1 --- a/ucx/list.c	Wed Aug 15 19:32:29 2012 +0200
     8.2 +++ b/ucx/list.c	Thu Aug 16 11:31:16 2012 +0200
     8.3 @@ -141,7 +141,7 @@
     8.4      }
     8.5  }
     8.6  
     8.7 -UcxList *ucx_list_qsort(UcxList *l, cmp_func fnc, void *data) {
     8.8 +UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data) {
     8.9      if (l == NULL) {
    8.10          return NULL;
    8.11      }
     9.1 --- a/ucx/list.h	Wed Aug 15 19:32:29 2012 +0200
     9.2 +++ b/ucx/list.h	Thu Aug 16 11:31:16 2012 +0200
     9.3 @@ -29,7 +29,7 @@
     9.4  UcxList *ucx_list_get(UcxList *l, int index);
     9.5  size_t ucx_list_size(UcxList *l);
     9.6  
     9.7 -UcxList *ucx_list_qsort(UcxList *l, cmp_func fnc, void *data);
     9.8 +UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
     9.9  
    9.10  /* list specific functions */
    9.11  UcxList *ucx_list_remove(UcxList *l, UcxList *e);

mercurial