]> git.mdlowis.com Git - projs/libcds.git/commitdiff
hide default comparator
authora bellenir <a@bellenir.com>
Tue, 19 Aug 2014 15:15:49 +0000 (15:15 +0000)
committera bellenir <a@bellenir.com>
Tue, 19 Aug 2014 15:15:49 +0000 (15:15 +0000)
source/rbt/rbt.c
source/rbt/rbt.h
tests/test_rbt.c

index e7480c0e3495b31295a3f22db51927cb76fa878f..830ef7e5b05eddab7929a6945bbfcf0799b02966 100644 (file)
@@ -2,7 +2,7 @@
 #include "rbt.h"
 
 //nodes are compared by memory address by default
-int rbt_default_comparator(void* v_a, void* v_b){
+static int rbt_default_comparator(void* v_a, void* v_b){
        uintptr_t a = (intptr_t)v_a;
        uintptr_t b = (intptr_t)v_b;
        return (a == b ? 0 : (a<b ? -1 : 1 ));
index 5c5462c675989024b34af58fc57b5e8bf0179de9..dff00c232dd91185fb4640bfc0cd2ab22c3968f8 100644 (file)
@@ -106,16 +106,6 @@ rbt_node_t* rbt_insert(rbt_t* tree, void* value);
  */
 void rbt_delete(rbt_t* tree, void* value);
 
-
-/**
- * @brief default comparator
- *
- * @param v_a  pointer to thing being compared 
- * @param v_b  thing to which v_a is being compared
- *
- * @return -1, 0, or 1 if v_a's address is <, ==, or > v_b's (respectively)
- */
-int rbt_default_comparator(void* v_a, void* v_b);
 #ifdef __cplusplus
 }
 #endif
index 5d39b36a5297faad54847e5d0c9209705d8dcc5a..172f10534a4b04406cda101a608cbb47d43c19ef 100644 (file)
@@ -2587,11 +2587,5 @@ TEST_SUITE(RBT) {
                mem_release(vals);
                mem_release(tree);
        }
-
-       TEST(Verify_default_comparator){
-               CHECK( 1 == rbt_default_comparator((void*)0x8888, (void*)0x4242));
-               CHECK( -1 == rbt_default_comparator((void*)0x2a2a, (void*)0x4242));
-               CHECK( 0 == rbt_default_comparator((void*)0x8888, (void*)0x8888));
-       }
 }