# HG changeset patch # User Mike Becker # Date 1526315120 -7200 # Node ID 5d28dc8f076555859d962ab6e5d32242be32ca6a # Parent b7753273f0fd23cb011b46c3c2b42a5d66e5fc7d renames int and longint distance and compare functions according to the new scheme diff -r b7753273f0fd -r 5d28dc8f0765 docs/src/modules.md --- a/docs/src/modules.md Mon May 14 18:23:35 2018 +0200 +++ b/docs/src/modules.md Mon May 14 18:25:20 2018 +0200 @@ -69,7 +69,7 @@ * Source code */ -UcxAVLTree* tree = ucx_avl_new(ucx_longintcmp); +UcxAVLTree* tree = ucx_avl_new(ucx_cmp_longint); /* ... populate tree with objects, use '& MyObject.ts' as key ... */ @@ -81,7 +81,7 @@ for ( UcxAVLNode* node = ucx_avl_find_node( tree, (intptr_t) &ts_start, - ucx_longintdist, UCX_AVL_FIND_LOWER_BOUNDED); + ucx_dist_longint, UCX_AVL_FIND_LOWER_BOUNDED); node && (*(time_t*)node->key) <= ts_end; node = ucx_avl_succ(node) ) { diff -r b7753273f0fd -r 5d28dc8f0765 src/ucx/utils.h --- a/src/ucx/utils.h Mon May 14 18:23:35 2018 +0200 +++ b/src/ucx/utils.h Mon May 14 18:25:20 2018 +0200 @@ -172,7 +172,7 @@ * @return -1, if *i1 is less than *i2, 0 if both are equal, * 1 if *i1 is greater than *i2 */ -int ucx_intcmp(const void *i1, const void *i2, void *data); +int ucx_cmp_int(const void *i1, const void *i2, void *data); /** * Compares two integers of type long int. @@ -182,7 +182,7 @@ * @return -1, if *i1 is less than *i2, 0 if both are equal, * 1 if *i1 is greater than *i2 */ -int ucx_longintcmp(const void *i1, const void *i2, void *data); +int ucx_cmp_longint(const void *i1, const void *i2, void *data); /** @@ -192,7 +192,7 @@ * @param data omitted * @return i1 minus i2 */ -intmax_t ucx_intdist(const void *i1, const void *i2, void *data); +intmax_t ucx_dist_int(const void *i1, const void *i2, void *data); /** * Distance function for integers of type long int. @@ -201,7 +201,7 @@ * @param data omitted * @return i1 minus i2 */ -intmax_t ucx_longintdist(const void *i1, const void *i2, void *data); +intmax_t ucx_dist_longint(const void *i1, const void *i2, void *data); /** * Compares two real numbers of type float. diff -r b7753273f0fd -r 5d28dc8f0765 src/utils.c --- a/src/utils.c Mon May 14 18:23:35 2018 +0200 +++ b/src/utils.c Mon May 14 18:25:20 2018 +0200 @@ -102,7 +102,7 @@ return sstrcmp(a, b); } -int ucx_intcmp(const void *i1, const void *i2, void *data) { +int ucx_cmp_int(const void *i1, const void *i2, void *data) { int a = *((const int*) i1); int b = *((const int*) i2); if (a == b) { @@ -112,7 +112,7 @@ } } -int ucx_longintcmp(const void *i1, const void *i2, void *data) { +int ucx_cmp_longint(const void *i1, const void *i2, void *data) { int a = *((const long int*) i1); int b = *((const long int*) i2); if (a == b) { @@ -122,13 +122,13 @@ } } -intmax_t ucx_intdist(const void *i1, const void *i2, void *data) { +intmax_t ucx_dist_int(const void *i1, const void *i2, void *data) { intmax_t a = *((const int*) i1); intmax_t b = *((const int*) i2); return a - b; } -intmax_t ucx_longintdist(const void *i1, const void *i2, void *data) { +intmax_t ucx_dist_longint(const void *i1, const void *i2, void *data) { intmax_t a = *((const long int*) i1); intmax_t b = *((const long int*) i2); return a - b;