renames int and longint distance and compare functions according to the new scheme

Mon, 14 May 2018 18:25:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 14 May 2018 18:25:20 +0200
changeset 314
5d28dc8f0765
parent 313
b7753273f0fd
child 315
5b97de37aada

renames int and longint distance and compare functions according to the new scheme

docs/src/modules.md file | annotate | diff | comparison | revisions
src/ucx/utils.h file | annotate | diff | comparison | revisions
src/utils.c file | annotate | diff | comparison | revisions
--- 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)
     ) {
--- 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.
--- 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;

mercurial