Mercurial > hg > GearsTemplate
view src/parallel_execution/twice.cbc @ 330:a258505bf9fd examples_directory
Add assert calc examples
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Apr 2017 18:58:16 +0900 |
parents | f1b0cc555b6e |
children |
line wrap: on
line source
#include <stdio.h> #include "../context.h" __code twice(struct LoopCounter* loopCounter, int index, int prefix, int* array) { int i = loopCounter->i; if (i < prefix) { array[i+index*prefix] = array[i+index*prefix]*2; loopCounter->i++; goto meta(context, C_twice); } loopCounter->i = 0; goto meta(context, context->next); } __code twice_stub(struct Context* context) { struct LoopCounter* loopCounter = &context->data[context->dataNum]->LoopCounter; struct Array* array = &context->data[context->dataNum+1]->Array; goto twice(context, loopCounter, array->index, array->prefix, array->array); }