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 |
1.1 --- a/src/ucx/avl.h Mon May 14 18:19:16 2018 +0200 1.2 +++ b/src/ucx/avl.h Mon May 14 18:20:56 2018 +0200 1.3 @@ -166,11 +166,12 @@ 1.4 1.5 /** 1.6 * Macro for initializing a new UcxAVLTree with the default allocator and a 1.7 - * ucx_ptrcmp() compare function. 1.8 + * ucx_cmp_ptr() compare function. 1.9 * 1.10 * @return a new default UcxAVLTree object 1.11 */ 1.12 -#define ucx_avl_default_new() ucx_avl_new_a(ucx_ptrcmp, ucx_default_allocator()) 1.13 +#define ucx_avl_default_new() \ 1.14 + ucx_avl_new_a(ucx_cmp_ptr, ucx_default_allocator()) 1.15 1.16 /** 1.17 * Gets the node from the tree, that is associated with the specified key.
2.1 --- a/src/ucx/utils.h Mon May 14 18:19:16 2018 +0200 2.2 +++ b/src/ucx/utils.h Mon May 14 18:20:56 2018 +0200 2.3 @@ -232,7 +232,7 @@ 2.4 * @return -1 if ptr1 is less than ptr2, 0 if both are equal, 2.5 * 1 if ptr1 is greater than ptr2 2.6 */ 2.7 -int ucx_ptrcmp(const void *ptr1, const void *ptr2, void *data); 2.8 +int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data); 2.9 2.10 /** 2.11 * Compares two memory areas.
3.1 --- a/src/utils.c Mon May 14 18:19:16 2018 +0200 3.2 +++ b/src/utils.c Mon May 14 18:20:56 2018 +0200 3.3 @@ -156,7 +156,7 @@ 3.4 } 3.5 } 3.6 3.7 -int ucx_ptrcmp(const void *ptr1, const void *ptr2, void *data) { 3.8 +int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data) { 3.9 const intptr_t p1 = (const intptr_t) ptr1; 3.10 const intptr_t p2 = (const intptr_t) ptr2; 3.11 if (p1 == p2) {
4.1 --- a/test/avl_tests.c Mon May 14 18:19:16 2018 +0200 4.2 +++ b/test/avl_tests.c Mon May 14 18:20:56 2018 +0200 4.3 @@ -75,11 +75,11 @@ 4.4 } 4.5 4.6 UCX_TEST(test_ucx_avl_put) { 4.7 - UcxAVLTree *tree1 = ucx_avl_new(ucx_ptrcmp); 4.8 - UcxAVLTree *tree2 = ucx_avl_new(ucx_ptrcmp); 4.9 - UcxAVLTree *tree3 = ucx_avl_new(ucx_ptrcmp); 4.10 - UcxAVLTree *tree4 = ucx_avl_new(ucx_ptrcmp); 4.11 - UcxAVLTree *tree5 = ucx_avl_new(ucx_ptrcmp); 4.12 + UcxAVLTree *tree1 = ucx_avl_new(ucx_cmp_ptr); 4.13 + UcxAVLTree *tree2 = ucx_avl_new(ucx_cmp_ptr); 4.14 + UcxAVLTree *tree3 = ucx_avl_new(ucx_cmp_ptr); 4.15 + UcxAVLTree *tree4 = ucx_avl_new(ucx_cmp_ptr); 4.16 + UcxAVLTree *tree5 = ucx_avl_new(ucx_cmp_ptr); 4.17 4.18 char *data1 = (char*)"data1"; 4.19 char *data2 = (char*)"data2"; 4.20 @@ -144,10 +144,10 @@ 4.21 } 4.22 4.23 UCX_TEST(test_ucx_avl_remove) { 4.24 - UcxAVLTree *tree1 = ucx_avl_new(ucx_ptrcmp); 4.25 - UcxAVLTree *tree2 = ucx_avl_new(ucx_ptrcmp); 4.26 - UcxAVLTree *tree3 = ucx_avl_new(ucx_ptrcmp); 4.27 - UcxAVLTree *tree4 = ucx_avl_new(ucx_ptrcmp); 4.28 + UcxAVLTree *tree1 = ucx_avl_new(ucx_cmp_ptr); 4.29 + UcxAVLTree *tree2 = ucx_avl_new(ucx_cmp_ptr); 4.30 + UcxAVLTree *tree3 = ucx_avl_new(ucx_cmp_ptr); 4.31 + UcxAVLTree *tree4 = ucx_avl_new(ucx_cmp_ptr); 4.32 4.33 char *data1 = (char*)"data1"; 4.34 char *data2 = (char*)"data2"; 4.35 @@ -229,7 +229,7 @@ 4.36 } 4.37 4.38 UCX_TEST(test_ucx_avl_find) { 4.39 - UcxAVLTree *tree = ucx_avl_new(ucx_ptrcmp); 4.40 + UcxAVLTree *tree = ucx_avl_new(ucx_cmp_ptr); 4.41 4.42 size_t len = 12; 4.43 int val[] = {10, 15, 3, 4, -30, 20, 14, -11, 12, -5, 1, 13}; 4.44 @@ -284,7 +284,7 @@ 4.45 } 4.46 4.47 UCX_TEST(test_ucx_avl_traverse) { 4.48 - UcxAVLTree *tree = ucx_avl_new(ucx_ptrcmp); 4.49 + UcxAVLTree *tree = ucx_avl_new(ucx_cmp_ptr); 4.50 4.51 size_t len = 12; 4.52