ucx/cx/compare.h

branch
newapi
changeset 324
ce13a778654a
parent 253
087cc9216f28
--- a/ucx/cx/compare.h	Thu Oct 03 18:54:19 2024 +0200
+++ b/ucx/cx/compare.h	Sun Oct 06 12:00:31 2024 +0200
@@ -48,8 +48,8 @@
  * A comparator function comparing two collection elements.
  */
 typedef int(*cx_compare_func)(
-        void const *left,
-        void const *right
+        const void *left,
+        const void *right
 );
 #endif // CX_COMPARE_FUNC_DEFINED
 
@@ -61,7 +61,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_int(void const *i1, void const *i2);
+int cx_cmp_int(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type long int.
@@ -71,7 +71,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_longint(void const *i1, void const *i2);
+int cx_cmp_longint(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type long long.
@@ -81,7 +81,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_longlong(void const *i1, void const *i2);
+int cx_cmp_longlong(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type int16_t.
@@ -91,7 +91,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_int16(void const *i1, void const *i2);
+int cx_cmp_int16(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type int32_t.
@@ -101,7 +101,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_int32(void const *i1, void const *i2);
+int cx_cmp_int32(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type int64_t.
@@ -111,7 +111,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_int64(void const *i1, void const *i2);
+int cx_cmp_int64(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type unsigned int.
@@ -121,7 +121,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_uint(void const *i1, void const *i2);
+int cx_cmp_uint(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type unsigned long int.
@@ -131,7 +131,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_ulongint(void const *i1, void const *i2);
+int cx_cmp_ulongint(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type unsigned long long.
@@ -141,7 +141,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_ulonglong(void const *i1, void const *i2);
+int cx_cmp_ulonglong(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type uint16_t.
@@ -151,7 +151,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_uint16(void const *i1, void const *i2);
+int cx_cmp_uint16(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type uint32_t.
@@ -161,7 +161,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_uint32(void const *i1, void const *i2);
+int cx_cmp_uint32(const void *i1, const void *i2);
 
 /**
  * Compares two integers of type uint64_t.
@@ -171,7 +171,7 @@
  * @return -1, if *i1 is less than *i2, 0 if both are equal,
  * 1 if *i1 is greater than *i2
  */
-int cx_cmp_uint64(void const *i1, void const *i2);
+int cx_cmp_uint64(const void *i1, const void *i2);
 
 /**
  * Compares two real numbers of type float with precision 1e-6f.
@@ -182,7 +182,7 @@
  * 1 if *f1 is greater than *f2
  */
 
-int cx_cmp_float(void const *f1, void const *f2);
+int cx_cmp_float(const void *f1, const void *f2);
 
 /**
  * Compares two real numbers of type double with precision 1e-14.
@@ -193,34 +193,34 @@
  * 1 if *d1 is greater than *d2
  */
 int cx_cmp_double(
-        void const *d1,
-        void const *d2
+        const void *d1,
+        const void *d2
 );
 
 /**
  * Compares the integer representation of two pointers.
  *
- * @param ptr1 pointer to pointer one (intptr_t const*)
- * @param ptr2 pointer to pointer two (intptr_t const*)
+ * @param ptr1 pointer to pointer one (const intptr_t*)
+ * @param ptr2 pointer to pointer two (const intptr_t*)
  * @return -1 if *ptr1 is less than *ptr2, 0 if both are equal,
  * 1 if *ptr1 is greater than *ptr2
  */
 int cx_cmp_intptr(
-        void const *ptr1,
-        void const *ptr2
+        const void *ptr1,
+        const void *ptr2
 );
 
 /**
  * Compares the unsigned integer representation of two pointers.
  *
- * @param ptr1 pointer to pointer one (uintptr_t const*)
- * @param ptr2 pointer to pointer two (uintptr_t const*)
+ * @param ptr1 pointer to pointer one (const uintptr_t*)
+ * @param ptr2 pointer to pointer two (const uintptr_t*)
  * @return -1 if *ptr1 is less than *ptr2, 0 if both are equal,
  * 1 if *ptr1 is greater than *ptr2
  */
 int cx_cmp_uintptr(
-        void const *ptr1,
-        void const *ptr2
+        const void *ptr1,
+        const void *ptr2
 );
 
 /**
@@ -232,8 +232,8 @@
  * 1 if ptr1 is greater than ptr2
  */
 int cx_cmp_ptr(
-        void const *ptr1,
-        void const *ptr2
+        const void *ptr1,
+        const void *ptr2
 );
 
 #ifdef __cplusplus

mercurial