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

@@ -383,9 +383,9 @@ namespace chaiscript
/// \param[in] t_modulepaths Vector of paths to search when attempting to load a binary module
/// \param[in] t_usepaths Vector of paths to search when attempting to "use" an included ChaiScript file
ChaiScript(const ModulePtr &t_lib,
const std::vector<std::string> &t_modulepaths = std::vector<std::string>(),
const std::vector<std::string> &t_usepaths = std::vector<std::string>())
: m_modulepaths(t_modulepaths), m_usepaths(t_usepaths)
std::vector<std::string> t_modulepaths = std::vector<std::string>(),
std::vector<std::string> t_usepaths = std::vector<std::string>())
: m_modulepaths(std::move(t_modulepaths)), m_usepaths(std::move(t_usepaths))
{
if (m_modulepaths.empty())
{
@@ -407,9 +407,9 @@ namespace chaiscript
///
/// \param[in] t_modulepaths Vector of paths to search when attempting to load a binary module
/// \param[in] t_usepaths Vector of paths to search when attempting to "use" an included ChaiScript file
ChaiScript( const std::vector<std::string> &t_modulepaths = std::vector<std::string>(),
const std::vector<std::string> &t_usepaths = std::vector<std::string>())
: m_modulepaths(t_modulepaths), m_usepaths(t_usepaths)
ChaiScript( std::vector<std::string> t_modulepaths = std::vector<std::string>(),
std::vector<std::string> t_usepaths = std::vector<std::string>())
: m_modulepaths(std::move(t_modulepaths)), m_usepaths(std::move(t_usepaths))
{
if (m_modulepaths.empty())
{
@@ -694,14 +694,14 @@ namespace chaiscript
postfixes.push_back(".so");
postfixes.push_back("");
for (size_t i = 0; i < m_modulepaths.size(); ++i)
for (auto & elem : m_modulepaths)
{
for (size_t j = 0; j < prefixes.size(); ++j)
for (auto & prefixe : prefixes)
{
for (size_t k = 0; k < postfixes.size(); ++k)
for (auto & postfixe : postfixes)
{
try {
std::string name = m_modulepaths[i] + prefixes[j] + t_module_name + postfixes[k];
std::string name = elem + prefixe + t_module_name + postfixe;
// std::cerr << "trying location: " << name << std::endl;
load_module(version_stripped_name, name);
return name;