Changed the order of some structures in order to improve, even if for a bit, their padding.
This commit is contained in:
parent
fc7f78244e
commit
eacf74be8d
|
@ -106,13 +106,13 @@ protected:
|
|||
void PrintMessage(const std::string &message) const;
|
||||
|
||||
private:
|
||||
std::vector<std::string> _pathnames;
|
||||
std::vector<std::string> _ignoredPaths;
|
||||
Settings *_settings;
|
||||
bool _showHelp;
|
||||
bool _showVersion;
|
||||
bool _showErrorMessages;
|
||||
bool _exitAfterPrint;
|
||||
std::vector<std::string> _pathnames;
|
||||
std::vector<std::string> _ignoredPaths;
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
|
|
@ -112,6 +112,11 @@ private:
|
|||
*/
|
||||
std::set<std::string> _errorList;
|
||||
|
||||
/**
|
||||
* Filename associated with size of file
|
||||
*/
|
||||
std::map<std::string, size_t> _files;
|
||||
|
||||
/**
|
||||
* Report progress time
|
||||
*/
|
||||
|
@ -121,11 +126,6 @@ private:
|
|||
* Has --errorlist been given?
|
||||
*/
|
||||
bool errorlist;
|
||||
|
||||
/**
|
||||
* Filename associated with size of file
|
||||
*/
|
||||
std::map<std::string, size_t> _files;
|
||||
};
|
||||
|
||||
#endif // CPPCHECKEXECUTOR_H
|
||||
|
|
|
@ -79,8 +79,8 @@ private:
|
|||
* Write end of status pipe, different for each child.
|
||||
* Not used in master process.
|
||||
*/
|
||||
int _wpipe;
|
||||
std::list<std::string> _errorList;
|
||||
int _wpipe;
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -114,15 +114,15 @@ public:
|
|||
/** number of elements of array */
|
||||
std::vector<MathLib::bigint> _num;
|
||||
|
||||
/** full name of variable as pattern */
|
||||
std::string _varname;
|
||||
|
||||
/** size of each element in array */
|
||||
MathLib::bigint _element_size;
|
||||
|
||||
/** variable id */
|
||||
unsigned int _varid;
|
||||
|
||||
/** full name of variable as pattern */
|
||||
std::string _varname;
|
||||
|
||||
public:
|
||||
ArrayInfo();
|
||||
ArrayInfo(const ArrayInfo &);
|
||||
|
|
|
@ -46,8 +46,8 @@ public:
|
|||
bool modified = false,
|
||||
bool allocateMemory = false) :
|
||||
_name(name),
|
||||
_type(type),
|
||||
_scope(scope),
|
||||
_type(type),
|
||||
_read(read),
|
||||
_write(write),
|
||||
_modified(modified),
|
||||
|
@ -65,15 +65,16 @@ public:
|
|||
return (_read == false && _write == false);
|
||||
}
|
||||
|
||||
std::set<unsigned int> _aliases;
|
||||
std::set<const Scope*> _assignments;
|
||||
|
||||
const Token *_name;
|
||||
VariableType _type;
|
||||
const Scope *_scope;
|
||||
VariableType _type;
|
||||
bool _read;
|
||||
bool _write;
|
||||
bool _modified; // read/modify/write
|
||||
bool _allocateMemory;
|
||||
std::set<unsigned int> _aliases;
|
||||
std::set<const Scope*> _assignments;
|
||||
};
|
||||
|
||||
typedef std::map<unsigned int, VariableUsage> VariableMap;
|
||||
|
|
|
@ -40,7 +40,7 @@ static const char ExtraVersion[] = "";
|
|||
static TimerResults S_timerResults;
|
||||
|
||||
CppCheck::CppCheck(ErrorLogger &errorLogger, bool useGlobalSuppressions)
|
||||
: exitcode(0), _useGlobalSuppressions(useGlobalSuppressions), _errorLogger(errorLogger)
|
||||
: _errorLogger(errorLogger), exitcode(0), _useGlobalSuppressions(useGlobalSuppressions)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -167,10 +167,8 @@ private:
|
|||
*/
|
||||
static void replaceAll(std::string& code, const std::string &from, const std::string &to);
|
||||
|
||||
unsigned int exitcode;
|
||||
std::list<std::string> _errorList;
|
||||
Settings _settings;
|
||||
bool _useGlobalSuppressions;
|
||||
std::string _fileContent;
|
||||
std::set<std::string> _dependencies;
|
||||
|
||||
|
@ -181,6 +179,10 @@ private:
|
|||
|
||||
/** @brief Current preprocessor configuration */
|
||||
std::string cfg;
|
||||
|
||||
unsigned int exitcode;
|
||||
|
||||
bool _useGlobalSuppressions;
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
|
|
@ -37,8 +37,8 @@ ErrorLogger::ErrorMessage::ErrorMessage()
|
|||
|
||||
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive) :
|
||||
_callStack(callStack), // locations for this error message
|
||||
_severity(severity), // severity for this error message
|
||||
_id(id), // set the message id
|
||||
_severity(severity), // severity for this error message
|
||||
_inconclusive(inconclusive)
|
||||
{
|
||||
// set the summary and verbose messages
|
||||
|
@ -46,7 +46,7 @@ ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack
|
|||
}
|
||||
|
||||
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<const Token*>& callstack, const TokenList* list, Severity::SeverityType severity, const std::string& id, const std::string& msg, bool inconclusive)
|
||||
: _severity(severity), _id(id), _inconclusive(inconclusive)
|
||||
: _id(id), _severity(severity), _inconclusive(inconclusive)
|
||||
{
|
||||
// Format callstack
|
||||
for (std::list<const Token *>::const_iterator it = callstack.begin(); it != callstack.end(); ++it) {
|
||||
|
|
|
@ -213,13 +213,14 @@ public:
|
|||
bool deserialize(const std::string &data);
|
||||
|
||||
std::list<FileLocation> _callStack;
|
||||
Severity::SeverityType _severity;
|
||||
std::string _id;
|
||||
bool _inconclusive;
|
||||
|
||||
/** source file (not header) */
|
||||
std::string file0;
|
||||
|
||||
Severity::SeverityType _severity;
|
||||
bool _inconclusive;
|
||||
|
||||
/** set short and verbose messages */
|
||||
void setmsg(const std::string &msg);
|
||||
|
||||
|
|
|
@ -2200,12 +2200,12 @@ private:
|
|||
/** macro definition in plain text */
|
||||
const std::string _macro;
|
||||
|
||||
/** does this macro take a variable number of parameters? */
|
||||
bool _variadic;
|
||||
|
||||
/** prefix that is used by cppcheck to separate macro parameters. Always "__cppcheck__" */
|
||||
const std::string _prefix;
|
||||
|
||||
/** does this macro take a variable number of parameters? */
|
||||
bool _variadic;
|
||||
|
||||
/** The macro has parentheses but no parameters.. "AAA()" */
|
||||
bool _nopar;
|
||||
|
||||
|
|
|
@ -1685,13 +1685,13 @@ const Variable* Function::getArgumentVar(unsigned int num) const
|
|||
|
||||
Scope::Scope(SymbolDatabase *check_, const Token *classDef_, Scope *nestedIn_, ScopeType type_, const Token *start_) :
|
||||
check(check_),
|
||||
type(type_),
|
||||
classDef(classDef_),
|
||||
classStart(start_),
|
||||
classEnd(start_->link()),
|
||||
nestedIn(nestedIn_),
|
||||
numConstructors(0),
|
||||
needInitialization(Scope::Unknown),
|
||||
type(type_),
|
||||
functionOf(NULL),
|
||||
function(NULL)
|
||||
{
|
||||
|
|
|
@ -367,6 +367,8 @@ public:
|
|||
token(NULL),
|
||||
arg(NULL),
|
||||
start(NULL),
|
||||
functionScope(NULL),
|
||||
type(eFunction),
|
||||
access(Public),
|
||||
hasBody(false),
|
||||
isInline(false),
|
||||
|
@ -377,9 +379,7 @@ public:
|
|||
isFriend(false),
|
||||
isExplicit(false),
|
||||
isOperator(false),
|
||||
retFuncPtr(false),
|
||||
type(eFunction),
|
||||
functionScope(NULL) {
|
||||
retFuncPtr(false) {
|
||||
}
|
||||
|
||||
std::size_t argCount() const {
|
||||
|
@ -396,6 +396,9 @@ public:
|
|||
const Token *token; // function name token in implementation
|
||||
const Token *arg; // function argument start '('
|
||||
const Token *start; // function start '{'
|
||||
Scope *functionScope; // scope of function body
|
||||
std::list<Variable> argumentList; // argument list
|
||||
Type type; // constructor, destructor, ...
|
||||
AccessControl access; // public/protected/private
|
||||
bool hasBody; // has implementation
|
||||
bool isInline; // implementation in class definition
|
||||
|
@ -407,9 +410,6 @@ public:
|
|||
bool isExplicit; // is explicit
|
||||
bool isOperator; // is operator
|
||||
bool retFuncPtr; // returns function pointer
|
||||
Type type; // constructor, destructor, ...
|
||||
Scope *functionScope; // scope of function body
|
||||
std::list<Variable> argumentList; // argument list
|
||||
|
||||
static bool argsMatch(const Scope *info, const Token *first, const Token *second, const std::string &path, unsigned int depth);
|
||||
|
||||
|
@ -423,10 +423,10 @@ class Scope {
|
|||
|
||||
public:
|
||||
struct BaseInfo {
|
||||
AccessControl access; // public/protected/private
|
||||
bool isVirtual;
|
||||
std::string name;
|
||||
Scope *scope;
|
||||
AccessControl access; // public/protected/private
|
||||
bool isVirtual;
|
||||
};
|
||||
|
||||
struct FriendInfo {
|
||||
|
@ -441,7 +441,6 @@ public:
|
|||
Scope(SymbolDatabase *check_, const Token *classDef_, Scope *nestedIn_, ScopeType type_, const Token *start_);
|
||||
|
||||
SymbolDatabase *check;
|
||||
ScopeType type;
|
||||
std::string className;
|
||||
const Token *classDef; // class/struct/union/namespace token
|
||||
const Token *classStart; // '{' token
|
||||
|
@ -453,8 +452,9 @@ public:
|
|||
Scope *nestedIn;
|
||||
std::list<Scope *> nestedList;
|
||||
unsigned int numConstructors;
|
||||
NeedInitialization needInitialization;
|
||||
std::list<const Token *> usingList;
|
||||
NeedInitialization needInitialization;
|
||||
ScopeType type;
|
||||
|
||||
// function specific fields
|
||||
Scope *functionOf; // scope this function belongs to
|
||||
|
|
|
@ -60,10 +60,10 @@ void TimerResults::AddResults(const std::string& str, std::clock_t clocks)
|
|||
|
||||
Timer::Timer(const std::string& str, unsigned int showtimeMode, TimerResultsIntf* timerResults)
|
||||
: _str(str)
|
||||
, _showtimeMode(showtimeMode)
|
||||
, _start(0)
|
||||
, _stopped(false)
|
||||
, _timerResults(timerResults)
|
||||
, _start(0)
|
||||
, _showtimeMode(showtimeMode)
|
||||
, _stopped(false)
|
||||
{
|
||||
if (showtimeMode != SHOWTIME_NONE)
|
||||
_start = std::clock();
|
||||
|
|
|
@ -69,10 +69,10 @@ private:
|
|||
Timer& operator=(const Timer&); // disallow assignments
|
||||
|
||||
const std::string _str;
|
||||
const unsigned int _showtimeMode;
|
||||
std::clock_t _start;
|
||||
bool _stopped;
|
||||
TimerResultsIntf* _timerResults;
|
||||
std::clock_t _start;
|
||||
const unsigned int _showtimeMode;
|
||||
bool _stopped;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,11 @@ Token::Token(Token **t) :
|
|||
_next(0),
|
||||
_previous(0),
|
||||
_link(0),
|
||||
_str(""),
|
||||
_varId(0),
|
||||
_fileIndex(0),
|
||||
_linenr(0),
|
||||
_progressValue(0),
|
||||
_type(eNone),
|
||||
_isUnsigned(false),
|
||||
_isSigned(false),
|
||||
|
@ -40,12 +45,7 @@ Token::Token(Token **t) :
|
|||
_isLong(false),
|
||||
_isUnused(false),
|
||||
_isStandardType(false),
|
||||
_isExpandedMacro(false),
|
||||
_varId(0),
|
||||
_fileIndex(0),
|
||||
_linenr(0),
|
||||
_progressValue(0),
|
||||
_str("")
|
||||
_isExpandedMacro(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
21
lib/token.h
21
lib/token.h
|
@ -472,6 +472,16 @@ private:
|
|||
Token *_next;
|
||||
Token *_previous;
|
||||
Token *_link;
|
||||
std::string _str;
|
||||
unsigned int _varId;
|
||||
unsigned int _fileIndex;
|
||||
unsigned int _linenr;
|
||||
|
||||
/**
|
||||
* A value from 0-100 that provides a rough idea about where in the token
|
||||
* list this token is located.
|
||||
*/
|
||||
unsigned int _progressValue;
|
||||
|
||||
Type _type;
|
||||
bool _isUnsigned;
|
||||
|
@ -481,9 +491,6 @@ private:
|
|||
bool _isUnused;
|
||||
bool _isStandardType;
|
||||
bool _isExpandedMacro;
|
||||
unsigned int _varId;
|
||||
unsigned int _fileIndex;
|
||||
unsigned int _linenr;
|
||||
|
||||
/** Updates internal property cache like _isName or _isBoolean.
|
||||
Called after any _str() modification. */
|
||||
|
@ -491,14 +498,6 @@ private:
|
|||
|
||||
/** Update internal property cache about isStandardType() */
|
||||
void update_property_isStandardType();
|
||||
|
||||
/**
|
||||
* A value from 0-100 that provides a rough idea about where in the token
|
||||
* list this token is located.
|
||||
*/
|
||||
unsigned int _progressValue;
|
||||
|
||||
std::string _str;
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
options::options(int argc, const char* argv[])
|
||||
:_options(&argv[1], &argv[0] + argc)
|
||||
,_which_test("")
|
||||
,_gcc_style_errors(_options.count("-g") != 0)
|
||||
,_quiet(_options.count("-q") != 0)
|
||||
,_which_test("")
|
||||
{
|
||||
_options.erase("-g");
|
||||
_options.erase("-q");
|
||||
|
|
|
@ -44,9 +44,9 @@ private:
|
|||
|
||||
private:
|
||||
std::set<std::string> _options;
|
||||
std::string _which_test;
|
||||
const bool _gcc_style_errors;
|
||||
const bool _quiet;
|
||||
std::string _which_test;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue