diff --git a/freehdl/freehdl/kernel-db.hh b/freehdl/freehdl/kernel-db.hh index a6b2a7c..ee5998a 100644 --- a/freehdl/freehdl/kernel-db.hh +++ b/freehdl/freehdl/kernel-db.hh @@ -254,10 +254,10 @@ public: // A hash function template used tp generate a hash number from // d -class db_basic_key_hash : public hash { +class db_basic_key_hash : public std::hash { public: size_t operator()(const db_basic_key& x) const { - return (*(hash *)this)(((unsigned long)x.value)>>2); + return (*(std::hash *)this)(((unsigned long)x.value)>>2); } }; diff --git a/freehdl/freehdl/kernel-util.hh b/freehdl/freehdl/kernel-util.hh index 2d0ad21..9a7916c 100644 --- a/freehdl/freehdl/kernel-util.hh +++ b/freehdl/freehdl/kernel-util.hh @@ -24,24 +24,13 @@ using namespace __gnu_cxx; // A hash function template used tp generate a hash number from // pointer values. template -class pointer_hash : public hash { +class pointer_hash : public std::hash { public: size_t operator()(const T& x) const { - return (*(hash *)this)(((unsigned long)x)>>2); + return (*(std::hash *)this)(((unsigned long)x)>>2); } }; - -/* Convert an integer value into a string */ -template -inline string -to_string(T i) -{ - stringstream lstr; - lstr << i; - return lstr.str(); -} - /****************************************************** * End of internal kernel definitions ******************************************************/ diff --git a/freehdl/v2cc/v2cc-util.h b/freehdl/v2cc/v2cc-util.h index cad6ece..46906fb 100644 --- a/freehdl/v2cc/v2cc-util.h +++ b/freehdl/v2cc/v2cc-util.h @@ -250,8 +250,9 @@ to_string(T i) return lstr.str(); } +template <> inline string -to_string(double i) +to_string(double i) { stringstream lstr; #if !defined __GNUC__ || __GNUC__ != 2 @@ -273,8 +274,9 @@ to_string(pIIR_ScalarType type, const StaticDataType &value); /* Convert a string value into a string (dummy function) */ +template <> inline string -to_string(string &str) { return str; } +to_string(const string &str) { return str; } /* Template class used to build binary function objects that take two