Running astyle [ci skip]

This commit is contained in:
orbitcowboy 2021-07-18 10:01:22 +02:00
parent 71d1dd2bb8
commit 1be5bb8bbc
5 changed files with 69 additions and 64 deletions

View File

@ -120,8 +120,7 @@ struct Analyzer {
Action action;
Terminate terminate;
void update(Result rhs)
{
void update(Result rhs) {
if (terminate == Terminate::None)
terminate = rhs.terminate;
action |= rhs.action;

View File

@ -1974,7 +1974,9 @@ struct ValueFlowAnalyzer : Analyzer {
virtual bool isGlobal() const {
return false;
}
virtual bool dependsOnThis() const { return false; }
virtual bool dependsOnThis() const {
return false;
}
virtual bool invalid() const {
return false;
@ -2020,8 +2022,7 @@ struct ValueFlowAnalyzer : Analyzer {
return Action::None;
}
virtual Action isThisModified(const Token* tok) const
{
virtual Action isThisModified(const Token* tok) const {
if (isThisChanged(tok, 0, getSettings(), isCPP()))
return Action::Invalid;
return Action::None;
@ -2405,8 +2406,7 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer {
ExpressionAnalyzer() : SingleValueFlowAnalyzer(), expr(nullptr), local(true), unknown(false), dependOnThis(false) {}
ExpressionAnalyzer(const Token* e, const ValueFlow::Value& val, const TokenList* t)
: SingleValueFlowAnalyzer(val, t), expr(e), local(true), unknown(false), dependOnThis(false)
{
: SingleValueFlowAnalyzer(val, t), expr(e), local(true), unknown(false), dependOnThis(false) {
dependOnThis = exprDependsOnThis(expr);
setupExprVarIds(expr);
@ -2421,8 +2421,7 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer {
var->isStatic() || var->isReference() || var->isExtern();
}
void setupExprVarIds(const Token* start, int depth = 0)
{
void setupExprVarIds(const Token* start, int depth = 0) {
const int maxDepth = 4;
if (depth > maxDepth)
return;
@ -2468,9 +2467,13 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer {
return ps;
}
virtual bool match(const Token* tok) const OVERRIDE { return tok->exprId() == expr->exprId(); }
virtual bool match(const Token* tok) const OVERRIDE {
return tok->exprId() == expr->exprId();
}
virtual bool dependsOnThis() const OVERRIDE { return dependOnThis; }
virtual bool dependsOnThis() const OVERRIDE {
return dependOnThis;
}
virtual bool isGlobal() const OVERRIDE {
return !local;

View File

@ -2330,8 +2330,7 @@ private:
ASSERT_EQUALS("", errout.str());
}
void nullpointer75()
{
void nullpointer75() {
check("struct a {\n"
" a *b() const;\n"
" void c();\n"

View File

@ -152,13 +152,21 @@ private:
return !val.isLifetimeValue();
}
static bool isNotPossible(const ValueFlow::Value& val) { return !val.isPossible(); }
static bool isNotPossible(const ValueFlow::Value& val) {
return !val.isPossible();
}
static bool isNotKnown(const ValueFlow::Value& val) { return !val.isKnown(); }
static bool isNotKnown(const ValueFlow::Value& val) {
return !val.isKnown();
}
static bool isNotInconclusive(const ValueFlow::Value& val) { return !val.isInconclusive(); }
static bool isNotInconclusive(const ValueFlow::Value& val) {
return !val.isInconclusive();
}
static bool isNotImpossible(const ValueFlow::Value& val) { return !val.isImpossible(); }
static bool isNotImpossible(const ValueFlow::Value& val) {
return !val.isImpossible();
}
bool testValueOfXKnown(const char code[], unsigned int linenr, int value) {
// Tokenize..
@ -4663,8 +4671,7 @@ private:
static std::string isPossibleContainerSizeValue(std::list<ValueFlow::Value> values,
MathLib::bigint i,
bool unique = true)
{
bool unique = true) {
if (!unique)
values.remove_if(&isNotPossible);
if (values.size() != 1)
@ -4680,8 +4687,7 @@ private:
static std::string isImpossibleContainerSizeValue(std::list<ValueFlow::Value> values,
MathLib::bigint i,
bool unique = true)
{
bool unique = true) {
if (!unique)
values.remove_if(&isNotImpossible);
if (values.size() != 1)
@ -4697,8 +4703,7 @@ private:
static std::string isInconclusiveContainerSizeValue(std::list<ValueFlow::Value> values,
MathLib::bigint i,
bool unique = true)
{
bool unique = true) {
if (!unique)
values.remove_if(&isNotInconclusive);
if (values.size() != 1)
@ -4712,8 +4717,7 @@ private:
return "";
}
static std::string isKnownContainerSizeValue(std::list<ValueFlow::Value> values, MathLib::bigint i, bool unique = true)
{
static std::string isKnownContainerSizeValue(std::list<ValueFlow::Value> values, MathLib::bigint i, bool unique = true) {
if (!unique)
values.remove_if(&isNotKnown);
if (values.size() != 1)