From 50cdb6cbfcb3aaf78ccde22239cae5f53c50b21b Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Wed, 6 Jan 2021 17:13:44 +0100 Subject: [PATCH] Astyle: sync windows and linux folders (#3016) --- lib/astutils.cpp | 3 ++- lib/checkbufferoverrun.cpp | 2 +- lib/forwardanalyzer.cpp | 3 +-- runastyle | 2 +- runastyle.bat | 2 ++ tools/triage/mainwindow.cpp | 6 +++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index d24485e7c..1e8817e91 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -648,7 +648,8 @@ bool exprDependsOnThis(const Token* expr, nonneg int depth) return exprDependsOnThis(expr->astOperand1(), depth) || exprDependsOnThis(expr->astOperand2(), depth); } -static bool hasUnknownVars(const Token* startTok) { +static bool hasUnknownVars(const Token* startTok) +{ bool result = false; visitAstNodes(startTok, [&](const Token* tok) { if (tok->varId() > 0 && !tok->variable()) { diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 54598ed1d..3a328c19c 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -890,7 +890,7 @@ void CheckBufferOverrun::objectIndex() continue; std::vector values = getLifetimeObjValues(obj, false, true); - for(const ValueFlow::Value& v:values) { + for (const ValueFlow::Value& v:values) { if (v.lifetimeKind != ValueFlow::Value::LifetimeKind::Address) continue; const Variable *var = v.tokvalue->variable(); diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index a2d62ea55..531bdf592 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -451,8 +451,7 @@ struct ForwardTraversal { if (!thenBranch.isConclusiveEscape()) { if (!analyzer->lowerToInconclusive()) return Progress::Break; - } - else if (thenBranch.check) { + } else if (thenBranch.check) { return Progress::Break; } else { if (analyzer->isConditional() && stopUpdates()) diff --git a/runastyle b/runastyle index 050cacf51..7a270e6ba 100755 --- a/runastyle +++ b/runastyle @@ -58,7 +58,7 @@ formatCplusplus "test/*.cpp" formatCplusplus "test/cfg/*.c" formatCplusplus "test/cfg/*.cpp" formatCplusplus "test/*.h" -formatCplusplus "tools/*.cpp" +formatCplusplusRecursive "tools/*.cpp" formatCplusplusRecursive "tools/*.h" formatCplusplusRecursive "samples/*.c" formatCplusplusRecursive "samples/*.cpp" diff --git a/runastyle.bat b/runastyle.bat index dc1810457..0d64d026e 100644 --- a/runastyle.bat +++ b/runastyle.bat @@ -30,6 +30,8 @@ %ASTYLE% --options=%RCFILE% -r gui/test/*.h %ASTYLE% --options=%RCFILE% lib/*.cpp %ASTYLE% --options=%RCFILE% lib/*.h +%ASTYLE% --options=%RCFILE% oss-fuzz/*.cpp +%ASTYLE% --options=%RCFILE% oss-fuzz/*.h %ASTYLE% --options=%RCFILE% test/*.cpp %ASTYLE% --options=%RCFILE% test/cfg/*.c %ASTYLE% --options=%RCFILE% test/cfg/*.cpp diff --git a/tools/triage/mainwindow.cpp b/tools/triage/mainwindow.cpp index e59acd8d3..17c78b730 100644 --- a/tools/triage/mainwindow.cpp +++ b/tools/triage/mainwindow.cpp @@ -36,7 +36,7 @@ MainWindow::MainWindow(QWidget *parent) : mFSmodel.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); ui->directoryTree->setModel(&mFSmodel); QHeaderView * header = ui->directoryTree->header(); - for(int i = 1; i < header->length(); ++i) // hide all except [0] + for (int i = 1; i < header->length(); ++i) // hide all except [0] header->hideSection(i); ui->directoryTree->setRootIndex(mFSmodel.index(WORK_FOLDER)); @@ -276,9 +276,9 @@ void MainWindow::findInFilesClicked() const QString text = ui->filterEdit->text(); QStringList filter; - if(ui->hFilesFilter->isChecked()) + if (ui->hFilesFilter->isChecked()) filter.append(hFiles); - if(ui->srcFilesFilter->isChecked()) + if (ui->srcFilesFilter->isChecked()) filter.append(srcFiles); QMimeDatabase mimeDatabase;