diff src/parallel_execution/rb_tree.c @ 144:d529c024e5a5

name fixes
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 10 Nov 2016 07:33:10 +0900
parents 34a7a21edc36
children cc071cf1ba85
line wrap: on
line diff
--- a/src/parallel_execution/rb_tree.c	Wed Nov 09 22:33:16 2016 +0900
+++ b/src/parallel_execution/rb_tree.c	Thu Nov 10 07:33:10 2016 +0900
@@ -31,10 +31,10 @@
     if (root) {
         traverse->current = root;
         traverse->result = compare(traverse->current, node);
-        goto meta(context, Replace);
+        goto meta(context, C_replaceNode);
     }
 
-    goto meta(context, Insert);
+    goto meta(context, C_insertNode);
 }
 
 __code put_stub(struct Context* context) {
@@ -54,7 +54,7 @@
     *newNode = *oldNode;
     nodeStack->stack = (union Data*)traverse->nodeStack;
     nodeStack->data = (union Data*)(newNode);
-    nodeStack->next = Replace1;
+    nodeStack->next = C_replaceNode1;
     goto meta(context, traverse->nodeStack->push);
 }
 
@@ -81,9 +81,9 @@
     traverse->newNode = newnewNode;
     if (traverse->current) {
         traverse->result = compare(traverse->current, node);
-        goto meta(context, Replace);
+        goto meta(context, C_replaceNode);
     }
-    goto meta(context, Insert);
+    goto meta(context, C_insertNode);
 
 }
 
@@ -103,7 +103,7 @@
     newNode->color = Red;
     traverse->current = newNode;
     nodeStack->stack = (union Data*)traverse->nodeStack;
-    nodeStack->next = InsertCase1;
+    nodeStack->next = C_insertCase1;
     goto meta(context, traverse->nodeStack->get2);
 }
 
@@ -119,13 +119,13 @@
     if (parent != NULL) {
         traverse->parent = parent;
         traverse->grandparent = grandparent;
-        goto meta(context,InsertCase2); 
+        goto meta(context,C_insertCase2); 
     }
     tree->root->color = Black;
-    goto meta(context, StackClear);
+    goto meta(context, C_stackClear);
 }
 
-__code insert1_stub(struct Context* context) {
+__code insertCase1_stub(struct Context* context) {
     goto insertCase1(context, 
         &context->data[Traverse]->traverse,
         &context->data[Tree]->tree,
@@ -135,12 +135,12 @@
 
 __code insertCase2(struct Context* context, struct Traverse* traverse) {
     if (traverse->parent->color == Black) {
-        goto meta(context, StackClear);
+        goto meta(context, C_stackClear);
     }
-    goto meta(context,InsertCase3); 
+    goto meta(context,C_insertCase3); 
 }
 
-__code insert2_stub(struct Context* context) {
+__code insertCase2_stub(struct Context* context) {
     goto insertCase2(context, &context->data[Traverse]->traverse); 
 }
 
@@ -159,13 +159,13 @@
         traverse->grandparent->color = Red;
         traverse->current = traverse->grandparent;
         nodeStack->stack = (union Data*)traverse->nodeStack;
-        nodeStack->next = InsertCase1;
+        nodeStack->next = C_insertCase1;
         goto meta(context, traverse->nodeStack->pop2);
     }
-    goto meta(context, InsertCase4);
+    goto meta(context, C_insertCase4);
 }
 
-__code insert3_stub(struct Context* context) {
+__code insertCase3_stub(struct Context* context) {
     goto insertCase3(context, &context->data[Traverse]->traverse,
                      &context->data[Stack]->stack
         );
@@ -176,34 +176,34 @@
 
     if ((traverse->current == traverse->parent->right) && (traverse->parent == traverse->grandparent->left)) {
         traverse->current = traverse->current->left;
-        traverse->rotateNext = InsertCase5;
+        traverse->rotateNext = C_insertCase5;
         traverse->parent = traverse->grandparent;
         nodeStack->stack = (union Data*)traverse->nodeStack;
-        nodeStack->next = RotateL;
+        nodeStack->next = C_rotateLeft;
         goto meta(context, nodeStack->pop);
     } else if ((traverse->current == traverse->parent->left) && (traverse->parent == traverse->grandparent->right)) {
         traverse->current = traverse->current->right;
-        traverse->rotateNext = InsertCase5;
+        traverse->rotateNext = C_insertCase5;
         traverse->parent = traverse->grandparent;
         nodeStack->stack = (union Data*)traverse->nodeStack;
-        nodeStack->next = RotateR;
+        nodeStack->next = C_rotateRight;
         goto meta(context, nodeStack->pop);
     }
 
-    goto meta(context, InsertCase5);
+    goto meta(context, C_insertCase5);
 }
 
-__code insert4_stub(struct Context* context) {
+__code insertCase4_stub(struct Context* context) {
     goto insertCase4(context, &context->data[Traverse]->traverse);
 }
 
 __code insertCase5(struct Context* context, struct Traverse* traverse,struct Stack *nodeStack) {
     nodeStack->stack = (union Data*)traverse->nodeStack;
-    nodeStack->next = InsertCase51;
+    nodeStack->next = C_insertCase51;
     goto meta(context, traverse->nodeStack->pop2);
 }
 
-__code insert5_stub(struct Context* context) {
+__code insertCase5_stub(struct Context* context) {
     goto insertCase5(context, &context->data[Traverse]->traverse, &context->data[Stack]->stack);
 }
 
@@ -215,23 +215,22 @@
     grandparent->color = Red;
 
     traverse->current = grandparent;
-    traverse->rotateNext = StackClear;
+    traverse->rotateNext = C_stackClear;
     if ((current == parent->left) && (parent == grandparent->left))
-        goto meta(context, RotateR);
+        goto meta(context, C_rotateRight);
     else
-        goto meta(context, RotateL);
+        goto meta(context, C_rotateLeft);
 }
 
-__code insert51_stub(struct Context* context) {
+__code insertCase51_stub(struct Context* context) {
     struct Node* parent = &context->data[Stack]->stack.data->node;
     struct Node* grandparent = &context->data[Stack]->stack.data1->node;
     goto insertCase51(context, &context->data[Traverse]->traverse, context->data[Traverse]->traverse.current, parent, grandparent);
 }
 
-// put rotateLeft's continuation as argument
 __code rotateLeft(struct Context* context, struct Traverse* traverse,struct Stack* nodeStack) {
     nodeStack->stack = (union Data*)traverse->nodeStack;
-    nodeStack->next = RotateL1;
+    nodeStack->next = C_rotateLeft1;
     goto meta(context, traverse->nodeStack->get);
 }
 
@@ -269,7 +268,7 @@
 
 __code rotateRight(struct Context* context, struct Traverse* traverse,struct Stack *nodeStack) {
     nodeStack->stack = (union Data*)traverse->nodeStack;
-    nodeStack->next = RotateR1;
+    nodeStack->next = C_rotateRight1;
     goto meta(context, traverse->nodeStack->get);
 }
 
@@ -322,7 +321,7 @@
     if (tree->root) {
         traverse->current = tree->root;
 
-        goto meta(context, Search);
+        goto meta(context, C_search);
     }
 
     goto meta(context, traverse->next);
@@ -346,7 +345,7 @@
     }
         
     if (traverse->current)
-        goto meta(context, Search);
+        goto meta(context, C_search);
 
     goto meta(context, traverse->next);
 }