diff --git a/org.lflang/src/org/lflang/generator/c/CReactionGenerator.java b/org.lflang/src/org/lflang/generator/c/CReactionGenerator.java index c257a1ef3f..d0ed2d6c4f 100644 --- a/org.lflang/src/org/lflang/generator/c/CReactionGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CReactionGenerator.java @@ -569,7 +569,7 @@ private static String generateInputVariablesInReaction( inputName+"->value = NULL;", // Prevent payload from being freed. "if ("+inputName+"->is_present) {", " "+inputName+"->length = "+inputName+"->token->length;", - " "+inputName+"->token = lf_writable_copy((token_template_t*)self->_lf_"+inputName+");", + " "+inputName+"->token = lf_writable_copy((lf_port_base_t*)self->_lf_"+inputName+");", " "+inputName+"->value = ("+types.getTargetType(inputType)+")"+inputName+"->token->value;", "} else {", " "+inputName+"->length = 0;", @@ -592,7 +592,7 @@ private static String generateInputVariablesInReaction( " if ("+inputName+"[i]->is_present) {", " "+inputName+"[i]->length = "+inputName+"[i]->token->length;", " token_template_t* _lf_input = (token_template_t*)self->_lf_"+inputName+"[i];", - " "+inputName+"[i]->token = lf_writable_copy(_lf_input);", + " "+inputName+"[i]->token = lf_writable_copy((lf_port_base_t*)_lf_input);", " "+inputName+"[i]->value = ("+types.getTargetType(inputType)+")"+inputName+"[i]->token->value;", " } else {", " "+inputName+"[i]->length = 0;",