Mercurial > hg > Gears > GearsAgda
changeset 141:4f6a660c14a1 stack-interface
stack interface worked
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 09 Nov 2016 15:43:22 +0900 |
parents | f31b4e4bf4bb |
children | 92eef2161a87 |
files | src/parallel_execution/origin_cs.c src/parallel_execution/rb_tree.c src/parallel_execution/stack.c |
diffstat | 3 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/origin_cs.c Wed Nov 09 13:26:53 2016 +0900 +++ b/src/parallel_execution/origin_cs.c Wed Nov 09 15:43:22 2016 +0900 @@ -3,7 +3,7 @@ #include "context.h" __code meta(struct Context* context, enum Code next) { - printf("meta %d\n",next); + // printf("meta %d\n",next); goto (context->code[next])(context); }
--- a/src/parallel_execution/rb_tree.c Wed Nov 09 13:26:53 2016 +0900 +++ b/src/parallel_execution/rb_tree.c Wed Nov 09 15:43:22 2016 +0900 @@ -205,7 +205,7 @@ __code insertCase5(struct Context* context, struct Traverse* traverse,struct Stack *nodeStack) { nodeStack->stack = (union Data*)traverse->nodeStack; nodeStack->next = InsertCase51; - goto meta(context, traverse->nodeStack->get2); + goto meta(context, traverse->nodeStack->pop2); } __code insert5_stub(struct Context* context) { @@ -309,7 +309,7 @@ __code stackClear(struct Context* context, struct Traverse* traverse) { traverse->current = 0; - struct SingleLinkedStack* nodeStack = &context->data[Traverse]->traverse.nodeStack->stack->singleLinkedStack; + struct SingleLinkedStack* nodeStack = (struct SingleLinkedStack*)traverse->nodeStack->stack; nodeStack->top = NULL; goto meta(context, context->next);
--- a/src/parallel_execution/stack.c Wed Nov 09 13:26:53 2016 +0900 +++ b/src/parallel_execution/stack.c Wed Nov 09 15:43:22 2016 +0900 @@ -90,7 +90,10 @@ } __code getSingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data** data, enum Code next) { - *data = stack->top->data; + if (stack->top) + *data = stack->top->data; + else + *data = NULL; goto meta(context, next); }