# HG changeset patch # User laurent # Date 1260646892 -3600 # Node ID 3d23a68183d3db1518d3e86875f5f6f5f470dccb # Parent 29ab336873334a1eaf96badb43a6a6fd231a7fe9 Bug on standard functions called with literals fixed Checking that number of parameters in function call doesn't exceed the maximum diff -r 29ab33687333 -r 3d23a68183d3 absyntax_utils/function_param_iterator.cc --- a/absyntax_utils/function_param_iterator.cc Fri Dec 11 13:01:17 2009 +0100 +++ b/absyntax_utils/function_param_iterator.cc Sat Dec 12 20:41:32 2009 +0100 @@ -159,6 +159,7 @@ identifier_c *identifier; param_count = 0; + en_eno_param_implicit = false; next_param++; current_operation = function_param_iterator_c::iterate_op; res = f_decl->accept(*this); @@ -196,6 +197,11 @@ return current_param_type; } +/* Returns if currently referenced parameter is an implicit defined EN/ENO parameter. */ +bool function_param_iterator_c::is_en_eno_param_implicit(void) { + return en_eno_param_implicit; +} + /* Returns the currently referenced parameter's data passing direction. * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT */ @@ -203,6 +209,11 @@ return current_param_direction; } +void *function_param_iterator_c::visit(implicit_definition_c *symbol) { + en_eno_param_implicit = current_operation == function_param_iterator_c::iterate_op; + return NULL; +} + /****************************************/ /* 1.4.3 - Declaration & Initialisation */ /****************************************/ @@ -224,6 +235,8 @@ * variables will get overwritten when we visit the next * var1_init_decl_c list! */ + symbol->method->accept(*this); + current_param_default_value = symbol->value; current_param_type = symbol->type; @@ -251,14 +264,12 @@ * variables will get overwritten when we visit the next * var1_init_decl_c list! */ + symbol->method->accept(*this); + current_param_default_value = NULL; current_param_type = symbol->type; return handle_single_param(symbol->name); -#if 0 - if (eno_declared) ERROR; - return (void *)declare_eno_param(); -#endif } void *function_param_iterator_c::visit(input_output_declarations_c *symbol) { TRACE("input_output_declarations_c"); diff -r 29ab33687333 -r 3d23a68183d3 absyntax_utils/function_param_iterator.hh --- a/absyntax_utils/function_param_iterator.hh Fri Dec 11 13:01:17 2009 +0100 +++ b/absyntax_utils/function_param_iterator.hh Sat Dec 12 20:41:32 2009 +0100 @@ -81,6 +81,7 @@ symbol_c *current_param_type; symbol_c *current_param_default_value; param_direction_t current_param_direction; + bool en_eno_param_implicit; /* Which operation of the class was called... * Search a parameter, or iterate to the next parameter. */ @@ -131,12 +132,16 @@ /* Returns the currently referenced parameter's type name. */ symbol_c *param_type(void); + /* Returns if currently referenced parameter is an implicit defined EN/ENO parameter. */ + bool is_en_eno_param_implicit(void); + /* Returns the currently referenced parameter's data passing direction. * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT */ param_direction_t param_direction(void); private: + void *visit(implicit_definition_c *symbol); /******************************************/ /* B 1.4.3 - Declaration & Initialisation */ /******************************************/ diff -r 29ab33687333 -r 3d23a68183d3 absyntax_utils/search_type_code.c --- a/absyntax_utils/search_type_code.c Fri Dec 11 13:01:17 2009 +0100 +++ b/absyntax_utils/search_type_code.c Sat Dec 12 20:41:32 2009 +0100 @@ -13984,13 +13984,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14142,13 +14136,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14238,13 +14226,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14443,13 +14425,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14539,13 +14515,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14604,13 +14574,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14652,13 +14616,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -14947,11 +14905,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15010,11 +14964,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15073,11 +15023,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15189,13 +15135,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15260,13 +15200,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15325,13 +15259,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -15489,13 +15417,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -26608,13 +26530,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -26756,13 +26672,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -26842,13 +26752,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27037,13 +26941,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27123,13 +27021,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27178,13 +27070,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27216,13 +27102,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27461,11 +27341,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27514,11 +27390,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27567,11 +27439,7 @@ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27663,13 +27531,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27724,13 +27586,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27779,13 +27635,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } @@ -27923,13 +27773,7 @@ { - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; return return_type_symbol; } diff -r 29ab33687333 -r 3d23a68183d3 stage4/generate_c/generate_c_il.cc --- a/stage4/generate_c/generate_c_il.cc Fri Dec 11 13:01:17 2009 +0100 +++ b/stage4/generate_c/generate_c_il.cc Sat Dec 12 20:41:32 2009 +0100 @@ -834,6 +834,8 @@ symbol_c *param_data_type = default_variable_name.current_type; symbol_c *return_data_type = NULL; + function_call_param_iterator_c function_call_param_iterator(symbol); + if (f_decl == function_symtable.end_value()) { function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); if (current_function_type == function_none) ERROR; @@ -841,8 +843,6 @@ return_data_type = (symbol_c *)search_expression_type->compute_standard_function_il(symbol, param_data_type); if (NULL == return_data_type) ERROR; - function_call_param_iterator_c function_call_param_iterator(symbol); - identifier_c en_param_name("EN"); /* Add the value from EN param */ ADD_PARAM_LIST(&en_param_name, @@ -875,7 +875,6 @@ function_param_iterator_c fp_iterator(f_decl); identifier_c *param_name; - function_call_param_iterator_c function_call_param_iterator(symbol); for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { symbol_c *param_type = fp_iterator.param_type(); if (param_type == NULL) ERROR; @@ -902,8 +901,10 @@ param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + if (param_value == NULL) { param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { /* No value given for parameter, so we must use the default... */ @@ -915,6 +916,8 @@ } /* for(...) */ } + if (function_call_param_iterator.next_nf() != NULL) ERROR; + bool has_output_params = false; if (!this->is_variable_prefix_null()) { @@ -1196,6 +1199,8 @@ symbol_c *return_data_type = NULL; + function_call_param_iterator_c function_call_param_iterator(symbol); + if (f_decl == function_symtable.end_value()) { function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); if (current_function_type == function_none) ERROR; @@ -1203,8 +1208,6 @@ return_data_type = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol); if (NULL == return_data_type) ERROR; - function_call_param_iterator_c function_call_param_iterator(symbol); - int nb_param = 0; if (symbol->il_param_list != NULL) nb_param += ((list_c *)symbol->il_param_list)->n; @@ -1242,7 +1245,6 @@ function_param_iterator_c fp_iterator(f_decl); identifier_c *param_name; - function_call_param_iterator_c function_call_param_iterator(symbol); for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { symbol_c *param_type = fp_iterator.param_type(); if (param_type == NULL) ERROR; @@ -1264,8 +1266,10 @@ * with the function calling code in generate_c_st_c, which does require * the following line... */ - if (param_value == NULL) + if (param_value == NULL) { param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL) { /* No value given for parameter, so we must use the default... */ @@ -1277,6 +1281,8 @@ } } + if (function_call_param_iterator.next_nf() != NULL) ERROR; + bool has_output_params = false; if (!this->is_variable_prefix_null()) { diff -r 29ab33687333 -r 3d23a68183d3 stage4/generate_c/generate_c_inlinefcall.cc --- a/stage4/generate_c/generate_c_inlinefcall.cc Fri Dec 11 13:01:17 2009 +0100 +++ b/stage4/generate_c/generate_c_inlinefcall.cc Sat Dec 12 20:41:32 2009 +0100 @@ -389,8 +389,8 @@ /* if it is the first parameter, semantics specifies that we should * get the value off the IL default variable! */ - if (1 == i) - param_value = &this->default_variable_name; + if (1 == i) + param_value = &this->default_variable_name; /* Get the value from a foo( = ) style call */ /* NOTE: the following line of code is not required in this case, but it doesn't @@ -404,8 +404,10 @@ param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); + if (param_value == NULL) { + param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { /* No value given for parameter, so we must use the default... */ @@ -416,6 +418,8 @@ ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) } /* for(...) */ + if (function_call_param_iterator.next_nf() != NULL) ERROR; + PARAM_LIST_ITERATOR() { if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || PARAM_DIRECTION == function_param_iterator_c::direction_inout) && @@ -472,8 +476,10 @@ * with the function calling code in generate_c_st_c, which does require * the following line... */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); + if (param_value == NULL) { + param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL) { /* No value given for parameter, so we must use the default... */ @@ -484,6 +490,8 @@ ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) } + if (function_call_param_iterator.next_nf() != NULL) ERROR; + PARAM_LIST_ITERATOR() { if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || PARAM_DIRECTION == function_param_iterator_c::direction_inout) && @@ -531,6 +539,8 @@ identifier_c *param_name; function_call_param_iterator_c function_call_param_iterator(symbol); for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); @@ -538,8 +548,10 @@ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + if (param_value == NULL) { param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { /* No value given for parameter, so we must use the default... */ @@ -547,13 +559,12 @@ param_value = fp_iterator.default_value(); } - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) } /* for(...) */ // symbol->parameter_assignment->accept(*this); + if (function_call_param_iterator.next_nf() != NULL) ERROR; + PARAM_LIST_ITERATOR() { if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || PARAM_DIRECTION == function_param_iterator_c::direction_inout) && diff -r 29ab33687333 -r 3d23a68183d3 stage4/generate_c/generate_c_st.cc --- a/stage4/generate_c/generate_c_st.cc Fri Dec 11 13:01:17 2009 +0100 +++ b/stage4/generate_c/generate_c_st.cc Sat Dec 12 20:41:32 2009 +0100 @@ -597,6 +597,8 @@ if (NULL != symbol->nonformal_param_list) parameter_assignment_list = symbol->nonformal_param_list; if (NULL == parameter_assignment_list) ERROR; + function_call_param_iterator_c function_call_param_iterator(symbol); + function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); if (f_decl == function_symtable.end_value()) { /* The function called is not in the symtable, so we test if it is a @@ -607,8 +609,6 @@ symbol_c *function_return_type = search_expression_type->get_type(symbol); - function_call_param_iterator_c function_call_param_iterator(symbol); - int nb_param = ((list_c *)parameter_assignment_list)->n; identifier_c en_param_name("EN"); @@ -638,17 +638,21 @@ */ function_param_iterator_c fp_iterator(f_decl); identifier_c *param_name; - function_call_param_iterator_c function_call_param_iterator(symbol); for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); /* Get the value from a foo( = ) style call */ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + if (param_value == NULL) { param_value = function_call_param_iterator.next_nf(); + if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; + } if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { /* No value given for parameter, so we must use the default... */ @@ -656,14 +660,13 @@ param_value = fp_iterator.default_value(); } - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) } /* for(...) */ // symbol->parameter_assignment->accept(*this); } + if (function_call_param_iterator.next_nf() != NULL) ERROR; + bool has_output_params = false; if (!this->is_variable_prefix_null()) { diff -r 29ab33687333 -r 3d23a68183d3 stage4/generate_c/il_code_gen.c --- a/stage4/generate_c/il_code_gen.c Fri Dec 11 13:01:17 2009 +0100 +++ b/stage4/generate_c/il_code_gen.c Sat Dec 12 20:41:32 2009 +0100 @@ -13368,6 +13368,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::integer; function_type_prefix = (symbol_c*)(new pragma_c("int")); + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13762,6 +13764,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -13798,6 +13802,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13834,6 +13840,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13870,6 +13878,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13906,6 +13916,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13942,6 +13954,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -13978,6 +13992,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -14014,6 +14030,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -14050,6 +14068,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -14086,6 +14106,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -14122,6 +14144,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -14207,13 +14231,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -14426,13 +14444,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -14474,6 +14486,8 @@ IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -14535,13 +14549,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -14798,13 +14806,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -14846,6 +14848,8 @@ IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -14907,13 +14911,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -14976,13 +14974,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = IN1_type_symbol; break; @@ -15024,14 +15016,12 @@ if (IN_type_symbol == NULL) IN_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; + else if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -15369,11 +15359,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -15466,11 +15452,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -15563,11 +15545,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -15611,6 +15589,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = return_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lword_type_name; break; } @@ -15687,13 +15667,7 @@ if (IN1_type_symbol == NULL) IN1_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = IN0_type_symbol; break; @@ -15792,13 +15766,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -15891,13 +15859,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -15983,6 +15945,10 @@ ADD_PARAM_LIST(&MX_param_name, MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; + else if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16101,13 +16067,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; diff -r 29ab33687333 -r 3d23a68183d3 stage4/generate_c/st_code_gen.c --- a/stage4/generate_c/st_code_gen.c Fri Dec 11 13:01:17 2009 +0100 +++ b/stage4/generate_c/st_code_gen.c Sat Dec 12 20:41:32 2009 +0100 @@ -15558,6 +15558,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::integer; function_type_prefix = (symbol_c*)(new pragma_c("int")); + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16018,6 +16020,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -16060,6 +16064,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16102,6 +16108,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16144,6 +16152,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16186,6 +16196,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16228,6 +16240,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16270,6 +16284,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16312,6 +16328,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16354,6 +16372,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16396,6 +16416,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16438,6 +16460,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -16529,13 +16553,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -16754,13 +16772,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -16802,6 +16814,8 @@ IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -16869,13 +16883,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -17138,13 +17146,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -17186,6 +17188,8 @@ IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; break; } @@ -17253,13 +17257,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -17328,13 +17326,7 @@ if (IN2_type_symbol == NULL) IN2_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = IN1_type_symbol; break; @@ -17382,14 +17374,12 @@ if (IN_type_symbol == NULL) IN_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; + else if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -17757,11 +17747,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -17860,11 +17846,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -17963,11 +17945,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lword_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -18017,6 +17995,8 @@ ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = return_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lword_type_name; break; } @@ -18099,13 +18079,7 @@ if (IN1_type_symbol == NULL) IN1_type_symbol = last_type_symbol; ADD_PARAM_LIST(&IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = IN0_type_symbol; break; @@ -18210,13 +18184,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -18315,13 +18283,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break; @@ -18413,6 +18375,10 @@ ADD_PARAM_LIST(&MX_param_name, MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in) symbol_c * return_type_symbol = IN_type_symbol; function_type_suffix = IN_type_symbol; + if (search_expression_type->is_literal_integer_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lint_type_name; + else if (search_expression_type->is_literal_real_type(function_type_suffix)) + function_type_suffix = &search_constant_type_c::lreal_type_name; break; } @@ -18537,13 +18503,7 @@ } }while(param_value != NULL); - symbol_c * return_type_symbol; - if (search_expression_type->is_literal_integer_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(last_type_symbol)) - return_type_symbol = &search_constant_type_c::lreal_type_name; - else - return_type_symbol = last_type_symbol; + symbol_c * return_type_symbol = last_type_symbol; function_type_suffix = return_type_symbol; break;