Add time struct creation in variable initial value declaration
authorlbessard
Fri, 06 Apr 2007 18:07:56 +0200
changeset 21 ae19aa4ff2d9
parent 20 81a06a308b7e
child 22 08bcc40be1fa
Add time struct creation in variable initial value declaration
stage4/generate_cc/generate_cc_sfc.cc
--- a/stage4/generate_cc/generate_cc_sfc.cc	Tue Mar 27 09:39:31 2007 +0200
+++ b/stage4/generate_cc/generate_cc_sfc.cc	Fri Apr 06 18:07:56 2007 +0200
@@ -102,9 +102,7 @@
     void print_reset_step(symbol_c *step_name) {
       s4o.print(s4o.indent_spaces);
       print_step_argument(step_name, "state");
-      s4o.print(" = 0;\n" + s4o.indent_spaces);
-      print_step_argument(step_name, "elapsed_time");
-      s4o.print(" = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
+      s4o.print(" = 0;\n");
     }
 
 /*********************************************/
@@ -190,7 +188,9 @@
     void print_set_step(symbol_c *step_name) {
       s4o.print(s4o.indent_spaces);
       print_step_argument(step_name, "state");
-      s4o.print(" = 1;\n");
+      s4o.print(" = 1;\n" + s4o.indent_spaces);
+      print_step_argument(step_name, "elapsed_time");
+      s4o.print(" = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
     }
 
 /*********************************************/
@@ -288,9 +288,7 @@
     void print_reset_step(symbol_c *step_name) {
       s4o.print(s4o.indent_spaces);
       print_step_argument(step_name, "state");
-      s4o.print(" = 0;\n" + s4o.indent_spaces);
-      print_step_argument(step_name, "elapsed_time");
-      s4o.print(" = __time_to_timespec(1, 0, 0, 0, 0, 0);\n");
+      s4o.print(" = 0;\n");
     }
 
 /*********************************************/