--- a/stage4/generate_c/generate_c.cc Fri Dec 30 18:25:39 2011 +0100
+++ b/stage4/generate_c/generate_c.cc Wed Jan 25 01:16:30 2012 +0100
@@ -1939,12 +1939,12 @@
s4o.print("extern unsigned long long common_ticktime__;\n\n");
s4o.print("#include \"accessor.h\"\n");
+ s4o.print("#include \"POUS.h\"\n\n");
s4o.print("#include \"");
configuration_name = true;
current_configuration->accept(*this);
configuration_name = false;
s4o.print(".h\"\n");
- s4o.print("#include \"POUS.h\"\n\n");
/* (A.2) Global variables... */
if (current_global_vars != NULL) {
@@ -2379,7 +2379,10 @@
generate_var_list_c generate_var_list(&variables_s4o, symbol);
generate_var_list.generate_programs(symbol);
generate_var_list.generate_variables(symbol);
-
+ variables_s4o.print("\n// Ticktime\n");
+ variables_s4o.print_long_long_integer(common_ticktime, false);
+ variables_s4o.print("\n");
+
generate_location_list_c generate_location_list(&located_variables_s4o);
symbol->accept(generate_location_list);
return NULL;
--- a/stage4/stage4.cc Fri Dec 30 18:25:39 2011 +0100
+++ b/stage4/stage4.cc Wed Jan 25 01:16:30 2012 +0100
@@ -127,15 +127,17 @@
return NULL;
}
-void *stage4out_c::print_long_integer(unsigned long l_integer) {
- if (!allow_output) return NULL;
- *out << l_integer << "UL";
- return NULL;
-}
-
-void *stage4out_c::print_long_long_integer(unsigned long long ll_integer) {
- if (!allow_output) return NULL;
- *out << ll_integer << "ULL";
+void *stage4out_c::print_long_integer(unsigned long l_integer, bool suffix) {
+ if (!allow_output) return NULL;
+ *out << l_integer;
+ if (suffix) *out << "UL";
+ return NULL;
+}
+
+void *stage4out_c::print_long_long_integer(unsigned long long ll_integer, bool suffix) {
+ if (!allow_output) return NULL;
+ *out << ll_integer;
+ if (suffix) *out << "ULL";
return NULL;
}
--- a/stage4/stage4.hh Fri Dec 30 18:25:39 2011 +0100
+++ b/stage4/stage4.hh Wed Jan 25 01:16:30 2012 +0100
@@ -61,8 +61,8 @@
void *print(std::string str);
void *print_integer(int integer);
- void *print_long_integer(unsigned long l_integer);
- void *print_long_long_integer(unsigned long long ll_integer);
+ void *print_long_integer(unsigned long l_integer, bool suffix=true);
+ void *print_long_long_integer(unsigned long long ll_integer, bool suffix=true);
void *printupper(const char *str);
void *printupper(std::string str);