src/ucx/cx/compare.h

changeset 490
d218607f5a7e
parent 415
d938228c382e
--- a/src/ucx/cx/compare.h	Sat Mar 25 17:18:51 2023 +0100
+++ b/src/ucx/cx/compare.h	Fri May 05 18:02:11 2023 +0200
@@ -37,6 +37,8 @@
 #ifndef UCX_COMPARE_H
 #define UCX_COMPARE_H
 
+#include "common.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -180,17 +182,36 @@
  * @return -1, if *d1 is less than *d2, 0 if both are equal,
  * 1 if *d1 is greater than *d2
  */
-int cx_cmp_double(void const *d1, void const *d2);
+int cx_cmp_double(
+        void const *d1,
+        void const *d2
+);
 
 /**
- * Compares two pointers.
+ * Compares the integer representation of two pointers.
  *
- * @param ptr1 pointer one
- * @param ptr2 pointer two
- * @return -1 if ptr1 is less than ptr2, 0 if both are equal,
- * 1 if ptr1 is greater than ptr2
+ * @param ptr1 pointer to pointer one (intptr_t const*)
+ * @param ptr2 pointer to pointer two (intptr_t const*)
+ * @return -1 if *ptr1 is less than *ptr2, 0 if both are equal,
+ * 1 if *ptr1 is greater than *ptr2
  */
-int cx_cmp_ptr(void const *ptr1, void const *ptr2);
+int cx_cmp_intptr(
+        void const *ptr1,
+        void const *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*)
+ * @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
+);
 
 #ifdef __cplusplus
 } // extern "C"

mercurial