fix new clang warning and add helper function

This commit is contained in:
Christopher Lackner 2020-04-20 10:13:04 +02:00
parent 83a48af36a
commit 27baa178d2
2 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,10 @@ namespace ngcore
NGCORE_API std::string Demangle(const char* typeinfo);
template<typename T>
NGCORE_API std::string GetName(const T& obj)
{ return Demangle(typeid(obj).name()); }
#if defined(__GNUC__)
inline bool likely (bool x) { return bool(__builtin_expect(long(x), 1L)); }
inline bool unlikely (bool x) { return bool(__builtin_expect(long(x), 0L)); }

View File

@ -519,7 +519,8 @@ namespace netgen
stringstream str;
occgeometry->GetTopologyTree (str);
char* cstr = (char*)str.str().c_str();
auto txt = str.str();
char* cstr = (char*) txt.c_str();
(*testout) << cstr << endl;