From a626cd215053744f46009cc76ce39730c01f2c67 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Fri, 25 Sep 2015 11:39:18 +0200 Subject: [PATCH] corr function registry: overspecification prevented correct casting --- pub/lib/fbase.cpp | 7 ++----- pub/lib/fregistry.hpp | 12 ------------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pub/lib/fbase.cpp b/pub/lib/fbase.cpp index 10fba78f..d76ce0f2 100644 --- a/pub/lib/fbase.cpp +++ b/pub/lib/fbase.cpp @@ -276,8 +276,7 @@ double func_im_havneg (double v, double a, double g) { //************************************************************************************************** int func_cond(int v, int a, int b) { return v ? a : b; } -template<class A, class B> -double func_cond(int v, A a, B b) { return v ? a : b; } +double func_cond(double v, double a, double b) { return v ? a : b; } void func_cond(double& r, double& dr, double v, double dv, double a, double da, double b, double db) { if(v) { r=a; dr=da; } else { r=b; dr=db; } } @@ -466,9 +465,7 @@ void fbase_initialize() G->register_fct_i_dd ( "||", func_or ); G->register_fct_meta ( "?:", 2, "a?b:c [if a then b else c]", 13 ); G->register_fct_i_iii( "?:", func_cond ); - G->register_fct_d_iid( "?:", func_cond ); - G->register_fct_d_idi( "?:", func_cond ); - G->register_fct_d_idd( "?:", func_cond ); + G->register_fct_d_ddd( "?:", func_cond ); G->register_fct_e_eee( "?:", func_cond ); diff --git a/pub/lib/fregistry.hpp b/pub/lib/fregistry.hpp index 392ceca5..651b21f9 100644 --- a/pub/lib/fregistry.hpp +++ b/pub/lib/fregistry.hpp @@ -40,9 +40,6 @@ typedef string (*func_s_si) (string, int); typedef string (*func_s_ss) (string, string); typedef int (*func_i_iii) (int, int, int); -typedef double (*func_d_iid) (int, int, double); -typedef double (*func_d_idi) (int, double, int); -typedef double (*func_d_idd) (int, double, double); typedef double (*func_d_ddd) (double, double, double); typedef void (*func_e_eee) (double&,double&, double,double, double,double, double,double); @@ -150,15 +147,6 @@ public: void register_fct_i_iii( const char* _tag, func_i_iii _f ) { register_fct_template( _tag, "i", "iii", (funcPtr)_f ); } - void register_fct_d_iid( const char* _tag, func_d_iid _f ) - { register_fct_template( _tag, "d", "iid", (funcPtr)_f ); } - - void register_fct_d_idi( const char* _tag, func_d_idi _f ) - { register_fct_template( _tag, "d", "idi", (funcPtr)_f ); } - - void register_fct_d_idd( const char* _tag, func_d_idd _f ) - { register_fct_template( _tag, "d", "idd", (funcPtr)_f ); } - void register_fct_d_ddd( const char* _tag, func_d_ddd _f ) { register_fct_template( _tag, "d", "ddd", (funcPtr)_f ); } -- GitLab