Browse Source

Minor spelling fix

merge-requests/365/head
eidheim 9 years ago
parent
commit
f7deb009f4
  1. 2
      src/cmake.cc
  2. 4
      src/compile_commands.cc
  3. 2
      src/compile_commands.h
  4. 2
      src/meson.cc
  5. 2
      tests/compile_commands_test.cc

2
src/cmake.cc

@ -136,7 +136,7 @@ boost::filesystem::path CMake::get_executable(const boost::filesystem::path &bui
boost::system::error_code ec; boost::system::error_code ec;
auto command_file=boost::filesystem::canonical(command.file, ec); auto command_file=boost::filesystem::canonical(command.file, ec);
if(!ec) { if(!ec) {
auto values=command.paramter_values("-o"); auto values=command.parameter_values("-o");
if(!values.empty()) { if(!values.empty()) {
size_t pos; size_t pos;
values[0].erase(0, 11); values[0].erase(0, 11);

4
src/compile_commands.cc

@ -1,7 +1,7 @@
#include "compile_commands.h" #include "compile_commands.h"
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
std::vector<std::string> CompileCommands::Command::paramter_values(const std::string &paramter_name) const { std::vector<std::string> CompileCommands::Command::parameter_values(const std::string &parameter_name) const {
std::vector<std::string> parameter_values; std::vector<std::string> parameter_values;
bool found_argument=false; bool found_argument=false;
@ -10,7 +10,7 @@ std::vector<std::string> CompileCommands::Command::paramter_values(const std::st
parameter_values.emplace_back(parameter); parameter_values.emplace_back(parameter);
found_argument=false; found_argument=false;
} }
else if(parameter==paramter_name) else if(parameter==parameter_name)
found_argument=true; found_argument=true;
} }

2
src/compile_commands.h

@ -13,7 +13,7 @@ public:
std::vector<std::string> parameters; std::vector<std::string> parameters;
boost::filesystem::path file; boost::filesystem::path file;
std::vector<std::string> paramter_values(const std::string &parameter_name) const; std::vector<std::string> parameter_values(const std::string &parameter_name) const;
}; };
CompileCommands(const boost::filesystem::path &build_path); CompileCommands(const boost::filesystem::path &build_path);

2
src/meson.cc

@ -94,7 +94,7 @@ boost::filesystem::path Meson::get_executable(const boost::filesystem::path &bui
boost::system::error_code ec; boost::system::error_code ec;
auto command_file=boost::filesystem::canonical(command.file, ec); auto command_file=boost::filesystem::canonical(command.file, ec);
if(!ec) { if(!ec) {
auto values=command.paramter_values("-o"); auto values=command.parameter_values("-o");
if(!values.empty()) { if(!values.empty()) {
size_t pos; size_t pos;
if((pos=values[0].find("@"))!=std::string::npos) { if((pos=values[0].find("@"))!=std::string::npos) {

2
tests/compile_commands_test.cc

@ -17,7 +17,7 @@ int main() {
g_assert_cmpstr(compile_commands.commands.at(4).parameters.at(3).c_str(), ==, "te\\st"); g_assert_cmpstr(compile_commands.commands.at(4).parameters.at(3).c_str(), ==, "te\\st");
g_assert_cmpstr(compile_commands.commands.at(4).parameters.at(4).c_str(), ==, "te\\\\st"); g_assert_cmpstr(compile_commands.commands.at(4).parameters.at(4).c_str(), ==, "te\\\\st");
auto parameter_values=compile_commands.commands.at(0).paramter_values("-o"); auto parameter_values=compile_commands.commands.at(0).parameter_values("-o");
g_assert_cmpuint(parameter_values.size(), ==, 1); g_assert_cmpuint(parameter_values.size(), ==, 1);
g_assert_cmpstr(parameter_values.at(0).c_str(), ==, "hello_lib@sta/main.cpp.o"); g_assert_cmpstr(parameter_values.at(0).c_str(), ==, "hello_lib@sta/main.cpp.o");

Loading…
Cancel
Save