--- a/stage4/generate_c/generate_c_sfcdecl.cc Tue Dec 01 09:03:33 2009 +0100
+++ b/stage4/generate_c/generate_c_sfcdecl.cc Wed Dec 02 16:11:01 2009 +0100
@@ -99,12 +99,12 @@
s4o.print(s4o.indent_spaces + "UINT __nb_actions;\n");
/* transitions table declaration */
- s4o.print(s4o.indent_spaces + "BOOL __transition_list[");
+ s4o.print(s4o.indent_spaces + "__IEC_BOOL_t __transition_list[");
s4o.print_integer(transition_number);
s4o.print("];\n");
/* transitions debug table declaration */
- s4o.print(s4o.indent_spaces + "BOOL __debug_transition_list[");
+ s4o.print(s4o.indent_spaces + "__IEC_BOOL_t __debug_transition_list[");
s4o.print_integer(transition_number);
s4o.print("];\n");
@@ -128,7 +128,7 @@
wanted_sfcdeclaration = sfcinit_sd;
/* steps table initialisation */
- s4o.print(s4o.indent_spaces + "STEP temp_step = {0, 0, 0};\n");
+ s4o.print(s4o.indent_spaces + "static const STEP temp_step = {{0, 0}, 0, 0};\n");
s4o.print(s4o.indent_spaces + "for(i = 0; i < ");
print_variable_prefix();
s4o.print("__nb_steps; i++) {\n");
@@ -154,7 +154,7 @@
wanted_sfcdeclaration = sfcinit_sd;
/* actions table initialisation */
- s4o.print(s4o.indent_spaces + "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};\n");
s4o.print(s4o.indent_spaces + "for(i = 0; i < ");
print_variable_prefix();
s4o.print("__nb_actions; i++) {\n");
@@ -208,10 +208,12 @@
break;
case sfcinit_sd:
s4o.print(s4o.indent_spaces);
+ s4o.print(SET_VAR);
+ s4o.print("(");
print_variable_prefix();
s4o.print("__step_list[");
s4o.print_integer(step_number);
- s4o.print("].state = 1;\n");
+ s4o.print("].state,1);\n");
step_number++;
break;
case stepdef_sd: