view src/parallel_execution/examples/calc/mult.cbc @ 1032:793b21a8ea12

fix include
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 24 Oct 2023 12:25:40 +0900
parents 13267f35c286
children
line wrap: on
line source

#include <stdio.h>
__code mult(struct Integer* input1, struct Integer* input2, __code next(struct Integer* output, ...)) {

    output->value = input1->value * input2->value;
    printf("%d * %d = %d\n", input1->value, input2->value, output->value);
    *O_output = output;
    goto meta(context, next);
}

__code mult_stub(struct Context* context) {
    Integer** O_output = (struct Integer **)&context->data[context->odg];
    goto mult(context,
            &context->data[context->idg]->Integer,
            &context->data[context->idg + 1]->Integer,
            context->next,
            O_output);
}