--- a/stage4/generate_c/generate_c_base.cc Thu Apr 22 00:29:30 2010 +0200
+++ b/stage4/generate_c/generate_c_base.cc Thu Apr 22 07:03:18 2010 +0200
@@ -249,15 +249,21 @@
s4o.print("(");
}
if (fb_name != NULL) {
+ s4o.print(GET_VAR);
+ s4o.print("(");
print_variable_prefix();
fb_name->accept(*this);
s4o.print(".");
+ value->accept(*this);
+ s4o.print(")");
}
- if (temp)
- s4o.print(TEMP_VAR);
- value->accept(*this);
+ else {
+ if (temp)
+ s4o.print(TEMP_VAR);
+ value->accept(*this);
+ }
if (is_subrange)
- s4o.print(")");
+ s4o.print(")");
return NULL;
}
--- a/stage4/generate_c/generate_c_il.cc Thu Apr 22 00:29:30 2010 +0200
+++ b/stage4/generate_c/generate_c_il.cc Thu Apr 22 07:03:18 2010 +0200
@@ -1144,6 +1144,7 @@
function_block_type_name->accept(*this);
s4o.print(FB_FUNCTION_SUFFIX);
s4o.print("(&");
+ print_variable_prefix();
symbol->fb_name->accept(*this);
s4o.print(")");
@@ -1167,8 +1168,9 @@
if ((param_direction == function_param_iterator_c::direction_out) ||
(param_direction == function_param_iterator_c::direction_inout)) {
symbol_c *param_type = search_varfb_instance_type->get_rawtype(param_value);
+ s4o.print(";\n" + s4o.indent_spaces);
if (this->is_variable_prefix_null()) {
- param_value->accept(*this);
+ param_value->accept(*this);
s4o.print(" = ");
print_check_function(param_type, param_name, symbol->fb_name);
}
@@ -1575,7 +1577,15 @@
C_modifier();
this->current_operand->accept(*this);
- s4o.print(search_expression_type->is_bool_type(this->current_operand_type)?" = true":" = 1");
+ s4o.print(" = __");
+ if (search_expression_type->is_bool_type(this->current_operand_type))
+ s4o.print("BOOL_LITERAL(TRUE)");
+ else if (search_expression_type->is_integer_type(this->current_operand_type)) {
+ this->current_operand_type->accept(*this);
+ s4o.print("_LITERAL(1)");
+ }
+ else
+ ERROR;
/* the data type resulting from this operation is unchanged! */
return NULL;
}
@@ -1585,7 +1595,15 @@
C_modifier();
this->current_operand->accept(*this);
- s4o.print(search_expression_type->is_bool_type(this->current_operand_type)?" = false":" = 0");
+ s4o.print(" = __");
+ if (search_expression_type->is_bool_type(this->current_operand_type))
+ s4o.print("BOOL_LITERAL(FALSE)");
+ else if (search_expression_type->is_integer_type(this->current_operand_type)) {
+ this->current_operand_type->accept(*this);
+ s4o.print("_LITERAL(0)");
+ }
+ else
+ ERROR;
/* the data type resulting from this operation is unchanged! */
return NULL;
}
--- a/stage4/generate_c/generate_c_st.cc Thu Apr 22 00:29:30 2010 +0200
+++ b/stage4/generate_c/generate_c_st.cc Thu Apr 22 07:03:18 2010 +0200
@@ -875,6 +875,7 @@
if ((param_direction == function_param_iterator_c::direction_out) ||
(param_direction == function_param_iterator_c::direction_inout)) {
symbol_c *param_type = search_varfb_instance_type->get_rawtype(param_value);
+ s4o.print(";\n" + s4o.indent_spaces);
if (this->is_variable_prefix_null()) {
param_value->accept(*this);
s4o.print(" = ");