Fix bugs in exponentiation
authorlaurent
Fri, 02 Sep 2011 18:16:33 +0200
changeset 348 990ecb883731
parent 347 44ff2a6fcadc
child 349 b826f13c260e
Fix bugs in exponentiation
absyntax_utils/search_type_code.c
lib/iec_std_lib.h
stage4/generate_c/il_code_gen.c
stage4/generate_c/st_code_gen.c
--- a/absyntax_utils/search_type_code.c	Fri Sep 02 18:15:55 2011 +0200
+++ b/absyntax_utils/search_type_code.c	Fri Sep 02 18:16:33 2011 +0200
@@ -14570,7 +14570,7 @@
                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
                     {
                 
-                        symbol_c * return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = IN1_type_symbol;
                         return return_type_symbol;
                         
                     }
@@ -27692,7 +27692,7 @@
                     if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
                     {
                 
-                        symbol_c * return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = IN1_type_symbol;
                         return return_type_symbol;
                         
                     }
--- a/lib/iec_std_lib.h	Fri Sep 02 18:15:55 2011 +0200
+++ b/lib/iec_std_lib.h	Fri Sep 02 18:16:33 2011 +0200
@@ -1089,10 +1089,11 @@
   /*    EXPT    */
   /**************/
 #define __expt_(TYPENAME)\
-static inline TYPENAME __expt_##TYPENAME(EN_ENO_PARAMS, TYPENAME IN1, REAL IN2){\
+static inline TYPENAME __expt_##TYPENAME(EN_ENO_PARAMS, TYPENAME IN1, LREAL IN2){\
   TEST_EN(TYPENAME)\
   return pow(IN1, IN2);\
-}ANY_REAL(__expt_)
+}
+ANY_REAL(__expt_)
 
 /**************/
 /* Selection  */
--- a/stage4/generate_c/il_code_gen.c	Fri Sep 02 18:15:55 2011 +0200
+++ b/stage4/generate_c/il_code_gen.c	Fri Sep 02 18:16:33 2011 +0200
@@ -14947,7 +14947,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 = last_type_symbol;
+                        symbol_c * return_type_symbol = IN1_type_symbol;
                         function_type_suffix = IN1_type_symbol;
                         break;
                         
--- a/stage4/generate_c/st_code_gen.c	Fri Sep 02 18:15:55 2011 +0200
+++ b/stage4/generate_c/st_code_gen.c	Fri Sep 02 18:16:33 2011 +0200
@@ -17299,7 +17299,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 = last_type_symbol;
+                        symbol_c * return_type_symbol = IN1_type_symbol;
                         function_type_suffix = IN1_type_symbol;
                         break;