]> git.mdlowis.com Git - projs/libcds.git/commitdiff
s/comparitor/comparator/
authora bellenir <a@bellenir.com>
Wed, 13 Aug 2014 02:39:55 +0000 (02:39 +0000)
committera bellenir <a@bellenir.com>
Wed, 13 Aug 2014 02:39:55 +0000 (02:39 +0000)
source/rbt/rbt.c
source/rbt/rbt.h

index c4e4e015a1cffe4aaf8d2bfa9f7f42c26e37e813..630e6e1187a15a93e06873922618862ed64905bd 100644 (file)
@@ -18,7 +18,7 @@ static void rbt_node_free(void* v_node){
        }
 }
 
-static int rbt_default_comparitor(void* a, void* b){
+static int rbt_default_comparator(void* a, void* b){
        return (a == b ? 0 : (a<b ? -1 : 1 ));
 }
 
@@ -32,10 +32,10 @@ rbt_node_t* rbt_node_new(void* contents){
        return node;
 }
 
-rbt_t* rbt_new(comparitor_t comparitor){
+rbt_t* rbt_new(comparator_t comparator){
        rbt_t* tree = mem_allocate(sizeof(rbt_t), &rbt_free);
        tree->root = NULL;
-       tree->comp = comparitor ? comparitor : rbt_default_comparitor;
+       tree->comp = comparator ? comparator : rbt_default_comparator;
        return tree;
 }
 
index 3b20f36538d1d7b63d3918028ef6a15b5cf53c3f..c1c30c2a45bd920f456036e6cdce5a1e8b5f229e 100644 (file)
@@ -23,7 +23,7 @@ typedef enum {
        SELF_REFERENCE,
 } rbt_status_t;
  
-typedef int (*comparitor_t)(void* p_a, void* p_b);
+typedef int (*comparator_t)(void* p_a, void* p_b);
 
 typedef struct rbt_node_t {
        struct rbt_node_t* left;
@@ -35,12 +35,12 @@ typedef struct rbt_node_t {
 
 typedef struct {
        rbt_node_t* root;
-       comparitor_t comp;
+       comparator_t comp;
 } rbt_t;
 
 
 rbt_node_t* rbt_node_new(void* contents);
-rbt_t* rbt_new(comparitor_t comparitor);
+rbt_t* rbt_new(comparator_t comparator);
 //returns a pointer to the new node
 rbt_node_t* rbt_insert(rbt_t* tree, void* value);
 void rbt_delete(rbt_t* tree, void* value);