fix SFC timed qualifier (D, L, ...) with variable time (was generating wrong C code)
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 25 Jan 2017 18:25:35 +0000
changeset 1030 9aba95daf81a
parent 1029 37145f381bb0
child 1031 ce026aee03e0
fix SFC timed qualifier (D, L, ...) with variable time (was generating wrong C code)
stage4/generate_c/generate_c_sfc.cc
--- a/stage4/generate_c/generate_c_sfc.cc	Wed Jan 25 18:22:41 2017 +0000
+++ b/stage4/generate_c/generate_c_sfc.cc	Wed Jan 25 18:25:35 2017 +0000
@@ -577,7 +577,7 @@
               s4o.print(s4o.indent_spaces + "if (active && __time_cmp(");
               print_step_argument(current_step, "T.value");
               s4o.print(", ");
-              symbol->action_time->accept(*this);
+              symbol->action_time->accept(*generate_c_st);
               if (strcmp(qualifier, "L") == 0)
                 s4o.print(") < 0) ");
               else
@@ -618,7 +618,7 @@
               s4o.print(" = 1;\n" + s4o.indent_spaces);
               print_action_argument(current_action, "reset_remaining_time");
               s4o.print(" = ");
-              symbol->action_time->accept(*this);
+              symbol->action_time->accept(*generate_c_st);
               s4o.print(";\n");
               s4o.indent_left();
               s4o.print(s4o.indent_spaces + "}\n");
@@ -632,7 +632,7 @@
               s4o.print("\n" + s4o.indent_spaces);
               print_action_argument(current_action, "set_remaining_time");
               s4o.print(" = ");
-              symbol->action_time->accept(*this);
+              symbol->action_time->accept(*generate_c_st);
               s4o.print(";\n");
               s4o.indent_left();
               s4o.print(s4o.indent_spaces + "}\n");