Cleaned up includes and forward declarations in checkers:

- Removed definitely unnecessary forward declarations (e.g. "class Token"; token.h is already included by check.h, so a definition is unnecessary)
 - Removed unused includes
This commit is contained in:
PKEuS 2014-05-23 14:09:34 +02:00
parent 00e28de3b7
commit 8f79dc3ff8
23 changed files with 6 additions and 42 deletions

View File

@ -22,9 +22,7 @@
#include "checkautovariables.h"
#include "symboldatabase.h"
#include "checkuninitvar.h"
#include <list>
#include <string>
//---------------------------------------------------------------------------

View File

@ -24,7 +24,6 @@
#include "config.h"
#include "check.h"
#include "token.h"
/// @addtogroup Checks
/** @brief Various small checks for automatic variables */

View File

@ -24,9 +24,7 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
class Function;
class Variable;

View File

@ -23,7 +23,6 @@
#include "checkbufferoverrun.h"
#include "tokenize.h"
#include "errorlogger.h"
#include "mathlib.h"
#include "symboldatabase.h"

View File

@ -24,15 +24,11 @@
#include "config.h"
#include "check.h"
#include "settings.h"
#include "mathlib.h"
#include <list>
#include <vector>
#include <string>
class ErrorLogger;
class Token;
class Tokenizer;
class Variable;
/// @addtogroup Checks

View File

@ -24,7 +24,6 @@
#include "config.h"
#include "check.h"
class Token;
class Scope;
class Function;

View File

@ -19,7 +19,6 @@
//---------------------------------------------------------------------------
#include "checkexceptionsafety.h"
#include "symboldatabase.h"
#include "token.h"
//---------------------------------------------------------------------------

View File

@ -23,9 +23,6 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
/// @addtogroup Checks
/// @{

View File

@ -25,8 +25,6 @@
#include "check.h"
#include "config.h"
class Token;
/// @addtogroup Checks
/// @{

View File

@ -20,8 +20,6 @@
#include "checkio.h"
#include "tokenize.h"
#include "token.h"
#include "errorlogger.h"
#include "symboldatabase.h"
#include <cctype>

View File

@ -23,7 +23,6 @@
#include "check.h"
#include "config.h"
#include "symboldatabase.h"
/// @addtogroup Checks
/// @{

View File

@ -26,11 +26,8 @@
#include "checkother.h" // <- doubleFreeError
#include "tokenize.h"
#include "errorlogger.h"
#include "symboldatabase.h"
#include <fstream>
//---------------------------------------------------------------------------
const int DEALLOC = -1;

View File

@ -25,6 +25,9 @@
#include "config.h"
#include "check.h"
#include <map>
#include <set>
class CPPCHECKLIB VarInfo {
public:

View File

@ -38,7 +38,6 @@
#include <list>
#include <string>
class Token;
class Scope;
class Function;
class Variable;

View File

@ -24,10 +24,7 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
class SymbolDatabase;
/// @addtogroup Checks
/// @{

View File

@ -21,7 +21,6 @@
#include "checkother.h"
#include "mathlib.h"
#include "symboldatabase.h"
#include "templatesimplifier.h"
#include <cmath> // fabs()
#include <stack>

View File

@ -24,9 +24,7 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
class Function;
class Variable;

View File

@ -309,7 +309,7 @@ void CheckSizeof::sizeofVoid()
if (isMember) {
// Get 'struct.member' complete name (without spaces)
varname = tok2->stringifyList(tok->next());
varname.erase(remove_if(varname.begin(), varname.end(),
varname.erase(std::remove_if(varname.begin(), varname.end(),
static_cast<int (*)(int)>(std::isspace)), varname.end());
}
}

View File

@ -24,9 +24,7 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
class Function;
class Variable;

View File

@ -25,7 +25,6 @@
#include "config.h"
#include "check.h"
class Token;
/// @addtogroup Checks
/// @{

View File

@ -24,9 +24,7 @@
#include "config.h"
#include "check.h"
#include "settings.h"
class Token;
class Scope;
class Variable;

View File

@ -24,8 +24,6 @@
#include "config.h"
#include "check.h"
#include "tokenize.h"
#include "errorlogger.h"
/// @addtogroup Checks
/** @brief Check for functions never called */

View File

@ -21,14 +21,12 @@
#define checkunusedvarH
//---------------------------------------------------------------------------
#include <map>
#include "config.h"
#include "check.h"
#include "settings.h"
#include <map>
class Type;
class Token;
class Scope;
class Variables;