Commit 4ec237e5 authored by Chris Müller's avatar Chris Müller
Browse files

fix some another typos within symbollist

parent 82eafe6d
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <gc.h> #include <gc.h>
#include <string.h> #include <string.h>
#include <assert.h>
enum RbNodeColor { RED, BLACK }; enum RbNodeColor { RED, BLACK };
...@@ -123,7 +124,7 @@ rbnode_trinode_restructering(struct RbNode* node) ...@@ -123,7 +124,7 @@ rbnode_trinode_restructering(struct RbNode* node)
if(RB_PARENT(node)->left == node) if(RB_PARENT(node)->left == node)
root = rbnode_rotate_right(root); root = rbnode_rotate_right(root);
else { else {
lq_rbnode_rotate_left(RB_PARENT(node)); rbnode_rotate_left(RB_PARENT(node));
root = rbnode_rotate_right(root); root = rbnode_rotate_right(root);
} }
...@@ -131,7 +132,7 @@ rbnode_trinode_restructering(struct RbNode* node) ...@@ -131,7 +132,7 @@ rbnode_trinode_restructering(struct RbNode* node)
if(RB_PARENT(node)->right == node) if(RB_PARENT(node)->right == node)
root = rbnode_rotate_left(root); root = rbnode_rotate_left(root);
else { else {
lq_rbnode_rotate_right(RB_PARENT(node)); rbnode_rotate_right(RB_PARENT(node));
root = rbnode_rotate_left(root); root = rbnode_rotate_left(root);
} }
} }
...@@ -143,7 +144,8 @@ rbnode_trinode_restructering(struct RbNode* node) ...@@ -143,7 +144,8 @@ rbnode_trinode_restructering(struct RbNode* node)
static void static void
rbnode_remedy_double_red(struct org_cherry_symbollist* tree, struct RbNode* node_z) rbnode_remedy_double_red(struct org_cherry_symbollist* tree, struct RbNode* node_z)
{ {
assert(tree != 0 && node_z != 0); assert(tree != 0);
assert(node_z != 0);
if(tree->root == RB_PARENT(node_z)) if(tree->root == RB_PARENT(node_z))
return; return;
...@@ -177,7 +179,7 @@ rbnode_remedy_double_red(struct org_cherry_symbollist* tree, struct RbNode* node ...@@ -177,7 +179,7 @@ rbnode_remedy_double_red(struct org_cherry_symbollist* tree, struct RbNode* node
static void static void
rbnode_remedey_double_black(struct org_cherry_symbollist* tree, struct RbNode* node_x, struct RbNode* node_r) rbnode_remedy_double_black(struct org_cherry_symbollist* tree, struct RbNode* node_x, struct RbNode* node_r)
{ {
assert(node_x != 0); assert(node_x != 0);
...@@ -317,11 +319,10 @@ org_cherry_symbollist_get(struct org_cherry_symbollist* tree, cy_byte_t* name) ...@@ -317,11 +319,10 @@ org_cherry_symbollist_get(struct org_cherry_symbollist* tree, cy_byte_t* name)
} else { } else {
return node->symbol; return node->symbol;
} }
rbnode_remedy_double_red(tree, current_node);
return current_node->symbol;
} }
rbnode_remedy_double_red(tree, current_node);
return current_node->symbol;
} }
......
...@@ -156,6 +156,7 @@ org_cherry_primitive_add(struct org_cherry_pair* pair) ...@@ -156,6 +156,7 @@ org_cherry_primitive_add(struct org_cherry_pair* pair)
void void
org_cherry_initialize(struct org_cherry_pair* arguments) org_cherry_initialize(struct org_cherry_pair* arguments)
{ {
GC_INIT();
org_cherry_global_symbollist = org_cherry_symbollist(); org_cherry_global_symbollist = org_cherry_symbollist();
org_cherry_symbol_true = org_cherry_value_alloc(); org_cherry_symbol_true = org_cherry_value_alloc();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment