# HG changeset patch # User laurent # Date 1327450590 -3600 # Node ID 85151b2f35cafae7a5d2fffe55093b5e97a0e9ad # Parent 155560bfe83770563d13b073c0a0d6165dd51594 Adding Common_Ticktime to informations printed in VARIABLES.csv file diff -r 155560bfe837 -r 85151b2f35ca stage4/generate_c/generate_c.cc --- 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; diff -r 155560bfe837 -r 85151b2f35ca stage4/stage4.cc --- 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; } diff -r 155560bfe837 -r 85151b2f35ca stage4/stage4.hh --- 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);