changeset 196:119c035e0e36

replace Array and Stack for array and stack
author ikkun
date Fri, 16 Dec 2016 23:27:14 +0900
parents 081607dcf893
children de7c0bbfc91f
files src/parallel_execution/main.c src/parallel_execution/rb_tree.c src/parallel_execution/stack.c src/parallel_execution/twice.c
diffstat 4 files changed, 47 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/main.c	Fri Dec 16 19:40:42 2016 +0900
+++ b/src/parallel_execution/main.c	Fri Dec 16 23:27:14 2016 +0900
@@ -22,7 +22,7 @@
 
 void print_tree(struct Node* node) {
     if (node != 0) {
-        printf("%d\n", node->value->array.index);
+        printf("%d\n", node->value->Array.index);
         print_tree(node->left);
         print_tree(node->right);
     }
@@ -66,7 +66,7 @@
 }
 
 __code code2_stub(struct Context* context) {
-    goto code2(context, &context->data[D_Node]->node.value->array, &context->data[D_LoopCounter]->loopCounter);
+    goto code2(context, &context->data[D_Node]->node.value->Array, &context->data[D_LoopCounter]->loopCounter);
 }
 
 __code createData1(struct Context* context, struct Allocate* allocate, struct LoopCounter* loopCounter) {
@@ -106,7 +106,7 @@
 __code createData2_stub(struct Context* context) {
     goto createData2(context,
             &context->data[D_LoopCounter]->loopCounter,
-            &context->data[context->dataNum]->array,
+            &context->data[context->dataNum]->Array,
             &context->data[D_Node]->node,
             Gearef(context, Tree));
 }
@@ -128,7 +128,7 @@
     goto createTask1(context,
             &context->data[D_LoopCounter]->loopCounter,
             task,
-            &context->data[D_Element]->element);
+            &context->data[D_Element]->Element);
 }
 
 //__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Queue* waitMe, struct OdsQueue* waitI, struct Element* element, struct Queue* activeQueue) {
--- a/src/parallel_execution/rb_tree.c	Fri Dec 16 19:40:42 2016 +0900
+++ b/src/parallel_execution/rb_tree.c	Fri Dec 16 23:27:14 2016 +0900
@@ -52,7 +52,7 @@
 __code putRedBlackTree_stub(struct Context* context) {
     struct Node* newNode = &ALLOCATE(context, Node)->node;
     goto putRedBlackTree(context,
-             &context->data[D_Stack]->stack,
+             &context->data[D_Stack]->Stack,
              &context->data[D_RedBlackTree]->RedBlackTree,
              &context->data[D_Node]->node,
              context->data[D_RedBlackTree]->RedBlackTree.root,
@@ -75,7 +75,7 @@
                   context->data[D_RedBlackTree]->RedBlackTree.current,
                   //context->data[D_RedBlackTree]->RedBlackTree.newNode,
                   Gearef(context, RedBlackTree)->newNode,
-                  &context->data[D_Stack]->stack);
+                  &context->data[D_Stack]->Stack);
 }
 
 __code replaceNode1(struct Context* context, struct RedBlackTree* traverse, struct Node* node, struct Node* oldNode, struct Node* newNode, struct Node* newnewNode, int result, enum Code next) {
@@ -123,7 +123,7 @@
 __code insertNode_stub(struct Context* context) {
     goto insertNode(context,
                     &context->data[D_RedBlackTree]->RedBlackTree,
-                    &context->data[D_Stack]->stack,
+                    &context->data[D_Stack]->Stack,
                     &context->data[D_Node]->node,
                     context->data[D_RedBlackTree]->RedBlackTree.newNode);
 }
@@ -141,8 +141,8 @@
 __code insertCase1_stub(struct Context* context) {
     goto insertCase1(context, 
         &context->data[D_RedBlackTree]->RedBlackTree,
-        &context->data[D_Stack]->stack.data->node,
-        &context->data[D_Stack]->stack.data1->node);
+        &context->data[D_Stack]->Stack.data->node,
+        &context->data[D_Stack]->Stack.data1->node);
 }
 
 __code insertCase2(struct Context* context, struct RedBlackTree* traverse) {
@@ -179,7 +179,7 @@
 
 __code insertCase3_stub(struct Context* context) {
     goto insertCase3(context, &context->data[D_RedBlackTree]->RedBlackTree,
-                     &context->data[D_Stack]->stack
+                     &context->data[D_Stack]->Stack
         );
 }
 
@@ -222,7 +222,7 @@
 }
 
 __code insertCase5_stub(struct Context* context) {
-    goto insertCase5(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_Stack]->stack);
+    goto insertCase5(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_Stack]->Stack);
 }
 
 __code insertCase51(struct Context* context, struct RedBlackTree* traverse, struct RotateTree *rotateTree, struct Node* current, struct Node* parent, struct Node* grandparent) {
@@ -244,8 +244,8 @@
 }
 
 __code insertCase51_stub(struct Context* context) {
-    struct Node* parent = &context->data[D_Stack]->stack.data->node;
-    struct Node* grandparent = &context->data[D_Stack]->stack.data1->node;
+    struct Node* parent = &context->data[D_Stack]->Stack.data->node;
+    struct Node* grandparent = &context->data[D_Stack]->Stack.data1->node;
     goto insertCase51(context, &context->data[D_RedBlackTree]->RedBlackTree,&context->data[D_RotateTree]->rotateTree, context->data[D_RedBlackTree]->RedBlackTree.current, parent, grandparent);
 }
 
@@ -257,7 +257,7 @@
 
 __code rotateLeft_stub(struct Context* context) {
     struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse;
-    goto rotateLeft(context, traverse, &context->data[D_Stack]->stack);
+    goto rotateLeft(context, traverse, &context->data[D_Stack]->Stack);
 }
 
 __code rotateLeft1(struct Context* context, struct Node* node, struct RedBlackTree* traverse, struct Node *parent,struct RotateTree *rotateTree) {
@@ -281,7 +281,7 @@
     
 __code rotateLeft1_stub(struct Context* context) {
     struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse;
-    struct Node* parent = &context->data[D_Stack]->stack.data->node;
+    struct Node* parent = &context->data[D_Stack]->Stack.data->node;
     goto rotateLeft1(context,
                     traverse->current,
                     traverse,
@@ -297,7 +297,7 @@
 
 __code rotateRight_stub(struct Context* context) {
     struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse;
-    goto rotateLeft(context, traverse, &context->data[D_Stack]->stack);
+    goto rotateLeft(context, traverse, &context->data[D_Stack]->Stack);
 }
 
 __code rotateRight1(struct Context* context, struct Node* node, struct RedBlackTree* traverse,struct Node *parent,struct RotateTree *rotateTree) {
@@ -321,7 +321,7 @@
 
 __code rotateRight1_stub(struct Context* context) {
     struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse;
-    struct Node* parent = &context->data[D_Stack]->stack.data->node;
+    struct Node* parent = &context->data[D_Stack]->Stack.data->node;
     goto rotateRight1(context,
                      traverse->current,
                      traverse,
@@ -337,7 +337,7 @@
 }
 
 __code stackClear_stub(struct Context* context) {
-    goto stackClear(context, &context->data[D_RedBlackTree]->RedBlackTree,&context->data[D_Stack]->stack,
+    goto stackClear(context, &context->data[D_RedBlackTree]->RedBlackTree,&context->data[D_Stack]->Stack,
         Gearef(context, Tree)->next);
 }
     
--- a/src/parallel_execution/stack.c	Fri Dec 16 19:40:42 2016 +0900
+++ b/src/parallel_execution/stack.c	Fri Dec 16 23:27:14 2016 +0900
@@ -4,8 +4,8 @@
 #include <stdio.h>
 
 union Data* createSingleLinkedStack(struct Context* context) {
-    struct Stack* stack = &ALLOCATE(context, Stack)->stack;
-    struct SingleLinkedStack* singleLinkedStack = &ALLOCATE(context, SingleLinkedStack)->singleLinkedStack;
+    struct Stack* stack = &ALLOCATE(context, Stack)->Stack;
+    struct SingleLinkedStack* singleLinkedStack = &ALLOCATE(context, SingleLinkedStack)->SingleLinkedStack;
     stack->stack = (union Data*)singleLinkedStack;
     singleLinkedStack->top = NULL;
     stack->push = C_pushSingleLinkedStack;
@@ -19,12 +19,12 @@
 }
 
 void printStack1(union Data* data) {
-    struct Node* node = &data->element.data->node;
+    struct Node* node = &data->Element.data->node;
     if (node == NULL) {
         printf("NULL");
     } else {
         printf("key = %d ,", node->key);
-        printStack1((union Data*)data->element.next);
+        printStack1((union Data*)data->Element.next);
     }
 }
 
@@ -39,7 +39,7 @@
 }
 
 __code clearSingleLinkedStack_stub(struct Context* context) {
-    goto clearSingleLinkedStack(context, (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack, context->data[D_Stack]->stack.next);
+    goto clearSingleLinkedStack(context, (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack, context->data[D_Stack]->Stack.next);
 }
 
 __code pushSingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, struct Element* element, union Data* data, enum Code next) {
@@ -50,12 +50,12 @@
 }
 
 __code pushSingleLinkedStack_stub(struct Context* context) {
-    struct Element* element = &ALLOCATE(context, Element)->element;
+    struct Element* element = &ALLOCATE(context, Element)->Element;
     goto pushSingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
                                element,
-                               context->data[D_Stack]->stack.data,
-                               context->data[D_Stack]->stack.next);
+                               context->data[D_Stack]->Stack.data,
+                               context->data[D_Stack]->Stack.next);
 }
 
 __code popSingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data** data, enum Code next) {
@@ -70,9 +70,9 @@
 
 __code popSingleLinkedStack_stub(struct Context* context) {
     goto popSingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
-                               &context->data[D_Stack]->stack.data,
-                               context->data[D_Stack]->stack.next);
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
+                               &context->data[D_Stack]->Stack.data,
+                               context->data[D_Stack]->Stack.next);
 }
 
 __code pop2SingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data** data, union Data** data1, enum Code next) {
@@ -93,10 +93,10 @@
 
 __code pop2SingleLinkedStack_stub(struct Context* context) {
     goto pop2SingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
-                               &context->data[D_Stack]->stack.data,
-                               &context->data[D_Stack]->stack.data1,
-                               context->data[D_Stack]->stack.next);
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
+                               &context->data[D_Stack]->Stack.data,
+                               &context->data[D_Stack]->Stack.data1,
+                               context->data[D_Stack]->Stack.next);
 }
 
 __code getSingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data** data, enum Code next) {
@@ -109,9 +109,9 @@
 
 __code getSingleLinkedStack_stub(struct Context* context) {
     goto getSingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
-                               &context->data[D_Stack]->stack.data,
-                               context->data[D_Stack]->stack.next);
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
+                               &context->data[D_Stack]->Stack.data,
+                               context->data[D_Stack]->Stack.next);
 }
 
 __code get2SingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data** data, union Data** data1, enum Code next) {
@@ -131,10 +131,10 @@
 
 __code get2SingleLinkedStack_stub(struct Context* context) {
     goto get2SingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
-                               &context->data[D_Stack]->stack.data,
-                               &context->data[D_Stack]->stack.data1,
-                               context->data[D_Stack]->stack.next);
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
+                               &context->data[D_Stack]->Stack.data,
+                               &context->data[D_Stack]->Stack.data1,
+                               context->data[D_Stack]->Stack.next);
 }
 
 __code isEmptySingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, enum Code next,enum Code whenEmpty) {
@@ -146,8 +146,8 @@
 
 __code isEmptySingleLinkedStack_stub(struct Context* context) {
     goto isEmptySingleLinkedStack(context,
-                               (struct SingleLinkedStack *)context->data[D_Stack]->stack.stack->stack.stack,
-                               context->data[D_Stack]->stack.next,
-                               context->data[D_Stack]->stack.whenEmpty);
+                               (struct SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack,
+                               context->data[D_Stack]->Stack.next,
+                               context->data[D_Stack]->Stack.whenEmpty);
 }
 
--- a/src/parallel_execution/twice.c	Fri Dec 16 19:40:42 2016 +0900
+++ b/src/parallel_execution/twice.c	Fri Dec 16 23:27:14 2016 +0900
@@ -22,7 +22,7 @@
 __code twice_stub(struct Context* context) {
     goto twice(context,
                &context->data[D_LoopCounter]->loopCounter,
-               context->data[D_Node]->node.value->array.index,
-               context->data[D_Node]->node.value->array.prefix,
-               context->data[D_Node]->node.value->array.array);
+               context->data[D_Node]->node.value->Array.index,
+               context->data[D_Node]->node.value->Array.prefix,
+               context->data[D_Node]->node.value->Array.array);
 }