# HG changeset patch # User Mario de Sousa # Date 1333204568 -3600 # Node ID 5b7a0d9838d2d46e14680e597e83ddd12497427f # Parent fa43fed1084c78dd54ca36f1969569a289da741b# Parent 7b5d67d1aeef21ec733187abe88f7222d4e210e0 merging with Laurent's changes. diff -r fa43fed1084c -r 5b7a0d9838d2 lib/accessor.h --- a/lib/accessor.h Sat Mar 31 15:34:33 2012 +0100 +++ b/lib/accessor.h Sat Mar 31 15:36:08 2012 +0100 @@ -57,7 +57,6 @@ __INIT_RETAIN(domain##__##name, retained) #define __INIT_EXTERNAL(type, global, name, retained)\ {\ - type* __GET_GLOBAL_##global();\ name.value = __GET_GLOBAL_##global();\ __INIT_RETAIN(name, retained)\ } diff -r fa43fed1084c -r 5b7a0d9838d2 lib/iec_types_all.h --- a/lib/iec_types_all.h Sat Mar 31 15:34:33 2012 +0100 +++ b/lib/iec_types_all.h Sat Mar 31 15:36:08 2012 +0100 @@ -86,7 +86,8 @@ #define __DECLARE_DERIVED_TYPE(type, base)\ typedef base type;\ -typedef __IEC_##base##_t __IEC_##type##_t; +typedef __IEC_##base##_t __IEC_##type##_t;\ +typedef __IEC_##base##_p __IEC_##type##_p; #define __DECLARE_COMPLEX_STRUCT(type)\ typedef struct {\ diff -r fa43fed1084c -r 5b7a0d9838d2 stage4/generate_c/generate_c_il.cc --- a/stage4/generate_c/generate_c_il.cc Sat Mar 31 15:34:33 2012 +0100 +++ b/stage4/generate_c/generate_c_il.cc Sat Mar 31 15:36:08 2012 +0100 @@ -472,12 +472,18 @@ symbol_c* fb_symbol = NULL, symbol_c* fb_value = NULL, bool negative = false) { - unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); - bool type_is_complex = search_varfb_instance_type->type_is_complex(); - if (vartype == search_var_instance_decl_c::external_vt) - s4o.print(SET_EXTERNAL); - else if (vartype == search_var_instance_decl_c::located_vt) - s4o.print(SET_LOCATED); + + bool type_is_complex = false; + if (fb_symbol == NULL) { + unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); + type_is_complex = search_varfb_instance_type->type_is_complex(); + if (vartype == search_var_instance_decl_c::external_vt) + s4o.print(SET_EXTERNAL); + else if (vartype == search_var_instance_decl_c::located_vt) + s4o.print(SET_LOCATED); + else + s4o.print(SET_VAR); + } else s4o.print(SET_VAR); s4o.print("("); diff -r fa43fed1084c -r 5b7a0d9838d2 stage4/generate_c/generate_c_sfcdecl.cc --- a/stage4/generate_c/generate_c_sfcdecl.cc Sat Mar 31 15:34:33 2012 +0100 +++ b/stage4/generate_c/generate_c_sfcdecl.cc Sat Mar 31 15:36:08 2012 +0100 @@ -130,7 +130,7 @@ wanted_sfcdeclaration = sfcinit_sd; /* steps table initialisation */ - s4o.print(s4o.indent_spaces + "static const STEP temp_step = {{0, 0}, 0, 0};\n"); + s4o.print(s4o.indent_spaces + "static const STEP temp_step = {{0, 0}, 0, {0, 0}};\n"); s4o.print(s4o.indent_spaces + "for(i = 0; i < "); print_variable_prefix(); s4o.print("__nb_steps; i++) {\n"); @@ -156,7 +156,7 @@ wanted_sfcdeclaration = sfcinit_sd; /* actions table initialisation */ - s4o.print(s4o.indent_spaces + "static const ACTION temp_action = {0, 0, 0, 0, 0, 0};\n"); + s4o.print(s4o.indent_spaces + "static const ACTION temp_action = {0, 0, 0, 0, {0, 0}, {0, 0}};\n"); s4o.print(s4o.indent_spaces + "for(i = 0; i < "); print_variable_prefix(); s4o.print("__nb_actions; i++) {\n"); diff -r fa43fed1084c -r 5b7a0d9838d2 stage4/generate_c/generate_c_st.cc --- a/stage4/generate_c/generate_c_st.cc Sat Mar 31 15:34:33 2012 +0100 +++ b/stage4/generate_c/generate_c_st.cc Sat Mar 31 15:36:08 2012 +0100 @@ -170,14 +170,19 @@ symbol_c* fb_symbol = NULL, symbol_c* fb_value = NULL) { - unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); - bool type_is_complex = search_varfb_instance_type->type_is_complex(); - if (vartype == search_var_instance_decl_c::external_vt) - s4o.print(SET_EXTERNAL); - else if (vartype == search_var_instance_decl_c::located_vt) - s4o.print(SET_LOCATED); + bool type_is_complex = false; + if (fb_symbol == NULL) { + unsigned int vartype = search_varfb_instance_type->get_vartype(symbol); + type_is_complex = search_varfb_instance_type->type_is_complex(); + if (vartype == search_var_instance_decl_c::external_vt) + s4o.print(SET_EXTERNAL); + else if (vartype == search_var_instance_decl_c::located_vt) + s4o.print(SET_LOCATED); + else + s4o.print(SET_VAR); + } else - s4o.print(SET_VAR); + s4o.print(SET_VAR); s4o.print("("); if (fb_symbol != NULL) {