# HG changeset patch # User Mike Becker # Date 1526314856 -7200 # Node ID e1e3b768ae8be8ec001c9546ca47e0c90735a146 # Parent e1f3248576bc9cd3f4573285af549227360e63d9 renames ucx_ptrcmp() to ucx_cmp_ptr() diff -r e1f3248576bc -r e1e3b768ae8b src/ucx/avl.h --- 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. diff -r e1f3248576bc -r e1e3b768ae8b src/ucx/utils.h --- 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. diff -r e1f3248576bc -r e1e3b768ae8b src/utils.c --- 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) { diff -r e1f3248576bc -r e1e3b768ae8b test/avl_tests.c --- 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;