diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index fd93442ce..32cdc8ea1 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -19,9 +19,9 @@ #include "threadexecutor.h" #include "cppcheck.h" #include "cppcheckexecutor.h" +#include #ifdef THREADING_MODEL_FORK #include -#include #include #include #include diff --git a/lib/check.cpp b/lib/check.cpp new file mode 100644 index 000000000..80a59b4d7 --- /dev/null +++ b/lib/check.cpp @@ -0,0 +1,44 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2014 Daniel Marjamäki and Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +//--------------------------------------------------------------------------- +// 64-bit portability +//--------------------------------------------------------------------------- + +#include "check.h" + +#include + +//--------------------------------------------------------------------------- + +Check::Check(const std::string &aname) + : _tokenizer(0), _settings(0), _errorLogger(0), _name(aname) +{ + for (std::list::iterator i = instances().begin(); i != instances().end(); ++i) { + if ((*i)->name() > aname) { + instances().insert(i, this); + return; + } + } + instances().push_back(this); +} + +void Check::reportError(const ErrorLogger::ErrorMessage &errmsg) +{ + std::cout << errmsg.toXML(true, 1) << std::endl; +} diff --git a/lib/check.h b/lib/check.h index 4c3fc7bcd..08faa81e9 100644 --- a/lib/check.h +++ b/lib/check.h @@ -28,7 +28,6 @@ #include "errorlogger.h" #include -#include #include /// @addtogroup Core @@ -41,16 +40,7 @@ class CPPCHECKLIB Check { public: /** This constructor is used when registering the CheckClass */ - explicit Check(const std::string &aname) - : _tokenizer(0), _settings(0), _errorLogger(0), _name(aname) { - for (std::list::iterator i = instances().begin(); i != instances(). end(); ++i) { - if ((*i)->name() > aname) { - instances().insert(i, this); - return; - } - } - instances().push_back(this); - } + explicit Check(const std::string &aname); /** This constructor is used when running checks. */ Check(const std::string &aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) @@ -111,9 +101,7 @@ public: * This is for for printout out the error list with --errorlist * @param errmsg Error message to write */ - static void reportError(const ErrorLogger::ErrorMessage &errmsg) { - std::cout << errmsg.toXML(true, 1) << std::endl; - } + static void reportError(const ErrorLogger::ErrorMessage &errmsg); bool inconclusiveFlag() const { return _settings && _settings->inconclusive; diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index 5b3574f9d..a261d1830 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -28,6 +28,7 @@ #include "tokenize.h" #include "symboldatabase.h" +#include //--------------------------------------------------------------------------- const int DEALLOC = -1; diff --git a/lib/checksizeof.cpp b/lib/checksizeof.cpp index b65b63f24..c12f507b7 100644 --- a/lib/checksizeof.cpp +++ b/lib/checksizeof.cpp @@ -310,7 +310,7 @@ void CheckSizeof::sizeofVoid() // Get 'struct.member' complete name (without spaces) varname = tok2->stringifyList(tok->next()); varname.erase(std::remove_if(varname.begin(), varname.end(), - static_cast(std::isspace)), varname.end()); + static_cast(std::isspace)), varname.end()); } } // Check for cast on operations with '+|-' diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index 2c843adc0..6a0649d4e 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -36,6 +36,7 @@ + diff --git a/lib/cppcheck.vcxproj.filters b/lib/cppcheck.vcxproj.filters index ca4110379..fea6e0f79 100644 --- a/lib/cppcheck.vcxproj.filters +++ b/lib/cppcheck.vcxproj.filters @@ -131,6 +131,9 @@ Source Files + + Source Files + diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 0b393b273..c0b3c5d3c 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -23,11 +23,11 @@ #include "token.h" #include "settings.h" #include "errorlogger.h" -#include "check.h" #include #include #include +#include //---------------------------------------------------------------------------