Running astlye [ci skip]

This commit is contained in:
orbitcowboy 2021-01-22 21:47:24 +01:00
parent ef6c0e6a43
commit bb451ca289
8 changed files with 44 additions and 41 deletions

View File

@ -21,8 +21,7 @@ struct ForwardTraversal {
bool analyzeOnly;
Terminate terminate = Terminate::None;
Progress Break(Terminate t = Terminate::None)
{
Progress Break(Terminate t = Terminate::None) {
if (!analyzeOnly && t != Terminate::None)
terminate = t;
return Progress::Break;
@ -225,8 +224,7 @@ struct ForwardTraversal {
ft.updateRange(start, end);
}
std::vector<ForwardTraversal> forkScope(Token* endBlock, bool isModified = false)
{
std::vector<ForwardTraversal> forkScope(Token* endBlock, bool isModified = false) {
if (analyzer->updateScope(endBlock, isModified)) {
ForwardTraversal ft = *this;
ft.analyzer->forkScope(endBlock);
@ -270,8 +268,7 @@ struct ForwardTraversal {
return a;
}
void continueUpdateRangeAfterLoop(std::vector<ForwardTraversal>& ftv, Token* start, const Token* endToken)
{
void continueUpdateRangeAfterLoop(std::vector<ForwardTraversal>& ftv, Token* start, const Token* endToken) {
for (ForwardTraversal& ft : ftv) {
// If analysis has terminated normally, then continue analysis
if (ft.terminate == Terminate::None)
@ -283,8 +280,7 @@ struct ForwardTraversal {
Token* endBlock,
Token* condTok,
Token* initTok = nullptr,
Token* stepTok = nullptr)
{
Token* stepTok = nullptr) {
const bool isDoWhile = precedes(endBlock, condTok);
Analyzer::Action bodyAnalysis = analyzeScope(endBlock);
Analyzer::Action allAnalysis = bodyAnalysis;

View File

@ -10,7 +10,10 @@
#include <limits>
#include <memory>
void ProgramMemory::setValue(MathLib::bigint exprid, const ValueFlow::Value& value) { values[exprid] = value; }
void ProgramMemory::setValue(MathLib::bigint exprid, const ValueFlow::Value& value)
{
values[exprid] = value;
}
const ValueFlow::Value* ProgramMemory::getValue(MathLib::bigint exprid) const
{
const ProgramMemory::Map::const_iterator it = values.find(exprid);
@ -61,7 +64,10 @@ void ProgramMemory::setUnknown(MathLib::bigint exprid)
values[exprid].valueType = ValueFlow::Value::ValueType::UNINIT;
}
bool ProgramMemory::hasValue(MathLib::bigint exprid) { return values.find(exprid) != values.end(); }
bool ProgramMemory::hasValue(MathLib::bigint exprid)
{
return values.find(exprid) != values.end();
}
void ProgramMemory::swap(ProgramMemory &pm)
{

View File

@ -1310,7 +1310,9 @@ public:
return const_cast<Scope *>(this->findScope(tok, const_cast<const Scope *>(startScope)));
}
bool isVarId(nonneg int varid) const { return varid < mVariableList.size(); }
bool isVarId(nonneg int varid) const {
return varid < mVariableList.size();
}
const Variable *getVariableFromVarId(nonneg int varId) const {
return mVariableList.at(varId);

View File

@ -2312,8 +2312,7 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer {
return unknown;
}
virtual ProgramState getProgramState() const OVERRIDE
{
virtual ProgramState getProgramState() const OVERRIDE {
ProgramState ps;
ps[expr->exprId()] = value;
return ps;