Apply changes applied from clang-modernize

Needed 1-2 cleanups by hand. 99% was automatic.

* The version that ships with ubuntu 14.04 seems to not work.
  I had to build from scratch

* Use cmake to generate the build commands that clang-modernize wants

```sh
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:bool=true ../ChaiScript/
```

* Use the clang-modernize tool. Note that you have to be pretty explicit
  about the include paths if you want it to also update your include
  files

```sh
../llvm-build/bin/clang-modernize ../ChaiScript/src/*.cpp -for-compilers=gcc-4.8 -include /home/jason/ChaiScript/include,/hjason/ChaiScript/include/chaiscript,/home/jason/ChaiScript/include/chaiscript/dispatchkit,/home/jason/ChaiScript/include/chaiscript/language -p compile_commands.json
```

* In my case, it left some unused `typedef`s behind, which I cleaned up.
This commit is contained in:
Jason Turner
2014-05-10 08:25:38 -06:00
parent 5f2796868b
commit 6eab8ddfe1
19 changed files with 207 additions and 217 deletions

View File

@@ -22,8 +22,8 @@ namespace chaiscript
{
public:
bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to,
const std::string &t_what) CHAISCRIPT_NOEXCEPT
: from(t_from), to(&t_to), m_what(t_what)
std::string t_what) CHAISCRIPT_NOEXCEPT
: from(t_from), to(&t_to), m_what(std::move(t_what))
{
}
@@ -32,15 +32,15 @@ namespace chaiscript
{
}
bad_boxed_cast(const std::string &t_what) CHAISCRIPT_NOEXCEPT
: to(0), m_what(t_what)
bad_boxed_cast(std::string t_what) CHAISCRIPT_NOEXCEPT
: to(nullptr), m_what(std::move(t_what))
{
}
virtual ~bad_boxed_cast() CHAISCRIPT_NOEXCEPT {}
/// \brief Description of what error occured
virtual const char * what() const CHAISCRIPT_NOEXCEPT
virtual const char * what() const CHAISCRIPT_NOEXCEPT override
{
return m_what.c_str();
}