# HG changeset patch # User mjsousa # Date 1396624915 -3600 # Node ID 4893e6b11b2566c75585a1d0a53daf98326af981 # Parent a5e2eedeef53464d21b29f51a2e8286f2e4750d8 Remove call to type_is_complex() in ST code generation. diff -r a5e2eedeef53 -r 4893e6b11b25 stage4/generate_c/generate_c_st.cc --- a/stage4/generate_c/generate_c_st.cc Mon Mar 31 20:05:49 2014 +0100 +++ b/stage4/generate_c/generate_c_st.cc Fri Apr 04 16:21:55 2014 +0100 @@ -176,11 +176,9 @@ symbol_c* value, symbol_c* fb_symbol = NULL, symbol_c* fb_value = NULL) { - - bool type_is_complex = false; + if (fb_symbol == NULL) { unsigned int vartype = analyse_variable_c::first_nonfb_vardecltype(symbol, scope_); - type_is_complex = analyse_variable_c::contains_complex_type(symbol); if (vartype == search_var_instance_decl_c::external_vt) { if (!get_datatype_info_c::is_type_valid (symbol->datatype)) ERROR; if ( get_datatype_info_c::is_function_block(symbol->datatype)) @@ -201,26 +199,27 @@ s4o.print(SET_VAR); } s4o.print("("); - if (fb_symbol != NULL) { print_variable_prefix(); + // It is my (MJS) conviction that by this time the following will always be true... + // wanted_variablegeneration == expression_vg; fb_symbol->accept(*this); s4o.print(".,"); + symbol->accept(*this); + s4o.print(","); + s4o.print(","); } else { - wanted_variablegeneration = complextype_base_vg; print_variable_prefix(); s4o.print(","); - } - - symbol->accept(*this); - s4o.print(","); - if (type_is_complex) { + wanted_variablegeneration = complextype_base_vg; + symbol->accept(*this); + s4o.print(","); wanted_variablegeneration = complextype_suffix_vg; symbol->accept(*this); - } - s4o.print(","); + s4o.print(","); + } wanted_variablegeneration = expression_vg; print_check_function(type, value, fb_value); s4o.print(")");