diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2015-10-29 22:22:47 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2015-12-01 14:22:38 +1000 |
commit | 36fa6703095ec8d562a5ab87269486d82294b4ef (patch) | |
tree | 45e3210ece92890b3b162f889aabe83a23f6a46c /libs/pbd/demangle.cc | |
parent | 5f4f89fb39236aea59a4c92a0f28622a7224fcb4 (diff) |
Rename PBD::symbol_demangle and some variable names to improve readability
Rename PBD::symbol_demangle to demangle_symbol so the transitive verb is
infront of the object.
Rename some local variables and fix documentation.
Diffstat (limited to 'libs/pbd/demangle.cc')
-rw-r--r-- | libs/pbd/demangle.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libs/pbd/demangle.cc b/libs/pbd/demangle.cc index 3f355806ee..cd084ec3c9 100644 --- a/libs/pbd/demangle.cc +++ b/libs/pbd/demangle.cc @@ -24,44 +24,44 @@ #endif std::string -PBD::symbol_demangle (const std::string& l) +PBD::demangle_symbol (const std::string& mangled_symbol) { #if defined(__GLIBCXX__) int status; try { - char* realname = abi::__cxa_demangle (l.c_str(), 0, 0, &status); - std::string d (realname); + char* realname = abi::__cxa_demangle (mangled_symbol.c_str(), 0, 0, &status); + std::string demangled_symbol (realname); free (realname); - return d; + return demangled_symbol; } catch (std::exception) { } #endif - return l; + return mangled_symbol; } std::string -PBD::demangle (std::string const & l) +PBD::demangle (std::string const& str) { - std::string::size_type const b = l.find_first_of ("("); + std::string::size_type const b = str.find_first_of ("("); if (b == std::string::npos) { - return symbol_demangle (l); + return demangle_symbol (str); } - std::string::size_type const p = l.find_last_of ("+"); + std::string::size_type const p = str.find_last_of ("+"); if (p == std::string::npos) { - return symbol_demangle (l); + return demangle_symbol (str); } if ((p - b) <= 1) { - return symbol_demangle (l); + return demangle_symbol (str); } - std::string const fn = l.substr (b + 1, p - b - 1); + std::string const symbol = str.substr (b + 1, p - b - 1); - return symbol_demangle (fn); + return demangle_symbol (symbol); } |