# HG changeset patch # User Tatsuki IHA # Date 1482224149 -32400 # Node ID 7470b8382672e871a1bacfe341406442243b4bd3 # Parent bd11fa6891b6491241d389142369376fa2ae8f7d Fix compile error to stack_test diff -r bd11fa6891b6 -r 7470b8382672 src/parallel_execution/context.h --- a/src/parallel_execution/context.h Tue Dec 20 17:19:54 2016 +0900 +++ b/src/parallel_execution/context.h Tue Dec 20 17:55:49 2016 +0900 @@ -1,6 +1,7 @@ /* Context definition for llrb example */ #ifndef CONTEXT_H #define CONTEXT_H +#include #include #ifdef USE_CUDA #include diff -r bd11fa6891b6 -r 7470b8382672 src/parallel_execution/stack.h --- a/src/parallel_execution/stack.h Tue Dec 20 17:19:54 2016 +0900 +++ b/src/parallel_execution/stack.h Tue Dec 20 17:55:49 2016 +0900 @@ -1,1 +1,2 @@ +#include "context.h" extern union Data* createSingleLinkedStack(struct Context* context); diff -r bd11fa6891b6 -r 7470b8382672 src/parallel_execution/test/stack_test.c --- a/src/parallel_execution/test/stack_test.c Tue Dec 20 17:19:54 2016 +0900 +++ b/src/parallel_execution/test/stack_test.c Tue Dec 20 17:55:49 2016 +0900 @@ -2,7 +2,7 @@ #include "../context.h" #include "../origin_cs.h" #include - +extern __code initContext(struct Context* context); __code stack_test1(struct Context* context, struct Task* task, struct Stack* stack) { task->code = C_stack_test1; @@ -18,7 +18,7 @@ context->data[D_Stack]->Stack.stack = (union Data*)stack; goto stack_test1(context, task, - context->data[D_Stack]->Stack.stack); + &context->data[D_Stack]->Stack.stack->Stack); } __code stack_test2(struct Context* context, struct Task* task, struct Stack* stack) { @@ -29,32 +29,32 @@ } __code stack_test2_stub(struct Context* context) { - assert(((struct Task)context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data)->code == C_stack_test1); + assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test1); Task* task = &ALLOCATE(context, Task)->Task; goto stack_test2(context, task, - context->data[D_Stack]->Stack.stack); + &context->data[D_Stack]->Stack.stack->Stack); } __code stack_test3(struct Context* context, struct Stack* stack) { stack->next = C_stack_test4; - goto meta(context, stack->take) + goto meta(context, stack->pop); } __code stack_test3_stub(struct Context* context) { - assert(((struct Task)context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data)->code == C_stack_test2); - assert(((struct Task)context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data)->code == C_stack_test1); + assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test2); + assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test1); goto stack_test3(context, - context->data[D_Stack]->Stack.stack); + &context->data[D_Stack]->Stack.stack->Stack); } __code stack_test4(struct Context* context) { - goto meta(context, C_exit); + goto meta(context, C_exit_code); } __code stack_test4_stub(struct Context* context) { - assert(((struct Task)context->data[D_Stack]->stack.stack.data)->code == C_StackTest1); - assert(((struct Task)context->data[D_Stack]->stack.stack.last->data)->code == C_StackTest2); + assert(context->data[D_Stack]->Stack.stack->Stack.data->Task.code == C_stack_test1); + assert(context->data[D_Stack]->Stack.stack->Stack.stack->SingleLinkedStack.top->data->Task.code == C_stack_test1); goto stack_test4(context); }