Bug with standard functions nb_params count on Windows fixed
authorlbessard
Mon, 01 Dec 2008 14:13:58 +0100
changeset 291 e580c945c62a
parent 290 56c4fe6b7012
child 292 800e100038ae
Bug with standard functions nb_params count on Windows fixed
generate_IEC_std.py
--- a/generate_IEC_std.py	Wed Nov 26 09:08:04 2008 +0100
+++ b/generate_IEC_std.py	Mon Dec 01 14:13:58 2008 +0100
@@ -188,9 +188,9 @@
                 res += "function_name = (symbol_c*)(new pragma_c(\"%s\"));\n"%code_gen[1]
             if fdecl["extensible"]:
                 res += """
-char nb_param_str[10];
+char* nb_param_str = new char[10];
 sprintf(nb_param_str, "%d", nb_param);
-ADD_PARAM_LIST((symbol_c*)(new integer_c(nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
+ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 """
             for paramname,paramtype,unused in fdecl["inputs"]:
                 res += "ADD_PARAM_LIST(%(input_name)s_param_value, %(input_name)s_type_symbol, function_param_iterator_c::direction_in)\n"%{"input_name" : paramname}