diff src/parallel_execution/stack.c @ 195:119c035e0e36

replace Array and Stack for array and stack
author ikkun
date Fri, 16 Dec 2016 23:27:14 +0900
parents 473b7d990a1f
children c34e6aa10967
line wrap: on
line diff
--- 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);
 }