diff src/parallel_execution/SingleLinkedStack.cbc @ 259:195518ab62fc

fix type gathering pattern match in generate_stub.pl
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 28 Jan 2017 12:37:22 +0900
parents ebc13549394c
children 6b5444bbea8a
line wrap: on
line diff
--- a/src/parallel_execution/SingleLinkedStack.cbc	Fri Jan 27 21:20:07 2017 +0900
+++ b/src/parallel_execution/SingleLinkedStack.cbc	Sat Jan 28 12:37:22 2017 +0900
@@ -1,33 +1,33 @@
-#include "context.h"
-#include "origin_cs.h"
+#include "../context.h"
+#include "../origin_cs.h"
 #include <stdio.h>
 
-typedef struct SingleLinkedStack {
-    struct Element* top;
-} SingleLinkedStack;
+// typedef struct SingleLinkedStack {
+//     struct Element* top;
+// } SingleLinkedStack;
 
-Stack* createSingleLinkedStack() {
+Stack* createSingleLinkedStack(struct Context *context) {
     struct Stack* stack = new Stack();
     struct SingleLinkedStack* singleLinkedStack = new SingleLinkedStack();
-    stack->stack = singleLinkedStack;
+    stack->stack = (union Data*)singleLinkedStack;
     singleLinkedStack->top = NULL;
-    stack->push = pushSingleLinkedStack;
-    stack->pop  = popSingleLinkedStack;
-    stack->pop2  = pop2SingleLinkedStack;
-    stack->get  = getSingleLinkedStack;
-    stack->get2  = get2SingleLinkedStack;
-    stack->isEmpty = isEmptySingleLinkedStack;
-    stack->clear = clearSingleLinkedStack;
+    stack->push = C_pushSingleLinkedStack;
+    stack->pop  = C_popSingleLinkedStack;
+    stack->pop2  = C_pop2SingleLinkedStack;
+    stack->get  = C_getSingleLinkedStack;
+    stack->get2  = C_get2SingleLinkedStack;
+    stack->isEmpty = C_isEmptySingleLinkedStack;
+    stack->clear = C_clearSingleLinkedStack;
     return stack;
 }
 
 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);
     }
 }