Mon, 14 May 2018 18:20:56 +0200
renames ucx_ptrcmp() to ucx_cmp_ptr()
src/ucx/avl.h | file | annotate | diff | comparison | revisions | |
src/ucx/utils.h | file | annotate | diff | comparison | revisions | |
src/utils.c | file | annotate | diff | comparison | revisions | |
test/avl_tests.c | file | annotate | diff | comparison | revisions |
--- a/src/ucx/avl.h Mon May 14 18:19:16 2018 +0200 +++ b/src/ucx/avl.h Mon May 14 18:20:56 2018 +0200 @@ -166,11 +166,12 @@ /** * Macro for initializing a new UcxAVLTree with the default allocator and a - * ucx_ptrcmp() compare function. + * ucx_cmp_ptr() compare function. * * @return a new default UcxAVLTree object */ -#define ucx_avl_default_new() ucx_avl_new_a(ucx_ptrcmp, ucx_default_allocator()) +#define ucx_avl_default_new() \ + ucx_avl_new_a(ucx_cmp_ptr, ucx_default_allocator()) /** * Gets the node from the tree, that is associated with the specified key.
--- a/src/ucx/utils.h Mon May 14 18:19:16 2018 +0200 +++ b/src/ucx/utils.h Mon May 14 18:20:56 2018 +0200 @@ -232,7 +232,7 @@ * @return -1 if ptr1 is less than ptr2, 0 if both are equal, * 1 if ptr1 is greater than ptr2 */ -int ucx_ptrcmp(const void *ptr1, const void *ptr2, void *data); +int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data); /** * Compares two memory areas.
--- a/src/utils.c Mon May 14 18:19:16 2018 +0200 +++ b/src/utils.c Mon May 14 18:20:56 2018 +0200 @@ -156,7 +156,7 @@ } } -int ucx_ptrcmp(const void *ptr1, const void *ptr2, void *data) { +int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data) { const intptr_t p1 = (const intptr_t) ptr1; const intptr_t p2 = (const intptr_t) ptr2; if (p1 == p2) {
--- a/test/avl_tests.c Mon May 14 18:19:16 2018 +0200 +++ b/test/avl_tests.c Mon May 14 18:20:56 2018 +0200 @@ -75,11 +75,11 @@ } UCX_TEST(test_ucx_avl_put) { - UcxAVLTree *tree1 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree2 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree3 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree4 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree5 = ucx_avl_new(ucx_ptrcmp); + UcxAVLTree *tree1 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree2 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree3 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree4 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree5 = ucx_avl_new(ucx_cmp_ptr); char *data1 = (char*)"data1"; char *data2 = (char*)"data2"; @@ -144,10 +144,10 @@ } UCX_TEST(test_ucx_avl_remove) { - UcxAVLTree *tree1 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree2 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree3 = ucx_avl_new(ucx_ptrcmp); - UcxAVLTree *tree4 = ucx_avl_new(ucx_ptrcmp); + UcxAVLTree *tree1 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree2 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree3 = ucx_avl_new(ucx_cmp_ptr); + UcxAVLTree *tree4 = ucx_avl_new(ucx_cmp_ptr); char *data1 = (char*)"data1"; char *data2 = (char*)"data2"; @@ -229,7 +229,7 @@ } UCX_TEST(test_ucx_avl_find) { - UcxAVLTree *tree = ucx_avl_new(ucx_ptrcmp); + UcxAVLTree *tree = ucx_avl_new(ucx_cmp_ptr); size_t len = 12; int val[] = {10, 15, 3, 4, -30, 20, 14, -11, 12, -5, 1, 13}; @@ -284,7 +284,7 @@ } UCX_TEST(test_ucx_avl_traverse) { - UcxAVLTree *tree = ucx_avl_new(ucx_ptrcmp); + UcxAVLTree *tree = ucx_avl_new(ucx_cmp_ptr); size_t len = 12;