Skip to content

Commit 1c98cec

Browse files
committed
format.yml: updated uncrustify to 0.74.0
1 parent 033410d commit 1c98cec

11 files changed

+34
-32
lines changed

.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-22.04
2222

2323
env:
24-
UNCRUSTIFY_VERSION: 0.73.0
24+
UNCRUSTIFY_VERSION: 0.74.0
2525

2626
steps:
2727
- uses: actions/checkout@v4

lib/checkersreport.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ std::string CheckersReport::getReport(const std::string& criticalErrors) const
191191
const bool cppcheckPremium = isCppcheckPremium(mSettings);
192192

193193
auto reportSection = [&fout, cppcheckPremium]
194-
(const std::string& title,
195-
const Settings& settings,
196-
const std::set<std::string>& activeCheckers,
197-
const std::map<std::string, std::string>& premiumCheckers,
198-
const std::string& substring) {
194+
(const std::string& title,
195+
const Settings& settings,
196+
const std::set<std::string>& activeCheckers,
197+
const std::map<std::string, std::string>& premiumCheckers,
198+
const std::string& substring) {
199199
fout << std::endl << std::endl;
200200
fout << title << std::endl;
201201
fout << std::string(title.size(), '-') << std::endl;

lib/checkstl.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -3293,12 +3293,12 @@ static const ValueFlow::Value* getOOBIterValue(const Token* tok, const ValueFlow
32933293
auto it = std::find_if(tok->values().begin(), tok->values().end(), [&](const ValueFlow::Value& v) {
32943294
if (v.isPossible() || v.isKnown()) {
32953295
switch (v.valueType) {
3296-
case ValueFlow::Value::ValueType::ITERATOR_END:
3297-
return v.intvalue >= 0;
3298-
case ValueFlow::Value::ValueType::ITERATOR_START:
3299-
return (v.intvalue < 0) || (sizeVal && v.intvalue >= sizeVal->intvalue);
3300-
default:
3301-
break;
3296+
case ValueFlow::Value::ValueType::ITERATOR_END:
3297+
return v.intvalue >= 0;
3298+
case ValueFlow::Value::ValueType::ITERATOR_START:
3299+
return (v.intvalue < 0) || (sizeVal && v.intvalue >= sizeVal->intvalue);
3300+
default:
3301+
break;
33023302
}
33033303
}
33043304
return false;

lib/clangimport.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1502,12 +1502,12 @@ void clangimport::AstNode::createTokensForCXXRecord(TokenList &tokenList)
15021502
std::vector<AstNodePtr> children2;
15031503
std::copy_if(children.cbegin(), children.cend(), std::back_inserter(children2), [](const AstNodePtr& child) {
15041504
return child->nodeType == CXXConstructorDecl ||
1505-
child->nodeType == CXXDestructorDecl ||
1506-
child->nodeType == CXXMethodDecl ||
1507-
child->nodeType == FieldDecl ||
1508-
child->nodeType == VarDecl ||
1509-
child->nodeType == AccessSpecDecl ||
1510-
child->nodeType == TypedefDecl;
1505+
child->nodeType == CXXDestructorDecl ||
1506+
child->nodeType == CXXMethodDecl ||
1507+
child->nodeType == FieldDecl ||
1508+
child->nodeType == VarDecl ||
1509+
child->nodeType == AccessSpecDecl ||
1510+
child->nodeType == TypedefDecl;
15111511
});
15121512
Scope *scope = createScope(tokenList, isStruct ? ScopeType::eStruct : ScopeType::eClass, children2, classToken);
15131513
const std::string addr = mExtTokens[0];

lib/programmemory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static ValueFlow::Value evaluate(const std::string& op, const ValueFlow::Value&
669669
return result;
670670
}
671671

672-
using BuiltinLibraryFunction = std::function<ValueFlow::Value(const std::vector<ValueFlow::Value>&)>;
672+
using BuiltinLibraryFunction = std::function<ValueFlow::Value (const std::vector<ValueFlow::Value>&)>;
673673
static std::unordered_map<std::string, BuiltinLibraryFunction> createBuiltinLibraryFunctions()
674674
{
675675
std::unordered_map<std::string, BuiltinLibraryFunction> functions;

lib/symboldatabase.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -5732,11 +5732,11 @@ static bool hasMatchingConstructor(const Scope* classScope, const ValueType* arg
57325732
return false;
57335733
const ValueType* vt = f.getArgumentVar(0)->valueType();
57345734
return vt &&
5735-
vt->type == argType->type &&
5736-
(argType->sign == ValueType::Sign::UNKNOWN_SIGN || vt->sign == argType->sign) &&
5737-
vt->pointer == argType->pointer &&
5738-
(vt->constness & 1) >= (argType->constness & 1) &&
5739-
(vt->volatileness & 1) >= (argType->volatileness & 1);
5735+
vt->type == argType->type &&
5736+
(argType->sign == ValueType::Sign::UNKNOWN_SIGN || vt->sign == argType->sign) &&
5737+
vt->pointer == argType->pointer &&
5738+
(vt->constness & 1) >= (argType->constness & 1) &&
5739+
(vt->volatileness & 1) >= (argType->volatileness & 1);
57405740
});
57415741
}
57425742

lib/token.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,7 @@ bool Token::hasKnownSymbolicValue(const Token* tok) const
25342534
return mImpl->mValues &&
25352535
std::any_of(mImpl->mValues->begin(), mImpl->mValues->end(), [&](const ValueFlow::Value& value) {
25362536
return value.isKnown() && value.isSymbolicValue() && value.tokvalue &&
2537-
value.tokvalue->exprId() == tok->exprId();
2537+
value.tokvalue->exprId() == tok->exprId();
25382538
});
25392539
}
25402540

@@ -2607,7 +2607,7 @@ const ValueFlow::Value* Token::getMovedValue() const
26072607
return nullptr;
26082608
const auto it = std::find_if(mImpl->mValues->begin(), mImpl->mValues->end(), [](const ValueFlow::Value& value) {
26092609
return value.isMovedValue() && !value.isImpossible() &&
2610-
value.moveKind != ValueFlow::Value::MoveKind::NonMovedVariable;
2610+
value.moveKind != ValueFlow::Value::MoveKind::NonMovedVariable;
26112611
});
26122612
return it == mImpl->mValues->end() ? nullptr : &*it;
26132613
}

lib/token.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ class CPPCHECKLIB Token {
14261426
fIsInitBracket = (1ULL << 43), // Is this bracket used as a part of variable initialization i.e: int a{5}, b(2);
14271427
};
14281428

1429-
enum : std::uint8_t {
1429+
enum : std::uint8_t {
14301430
efMaxSize = sizeof(nonneg int) * 8,
14311431
efIsUnique = efMaxSize - 2,
14321432
};

lib/tokenize.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -10921,10 +10921,10 @@ bool Tokenizer::hasIfdef(const Token *start, const Token *end) const
1092110921
const auto& directives = mDirectives;
1092210922
return std::any_of(directives.cbegin(), directives.cend(), [&](const Directive& d) {
1092310923
return startsWith(d.str, "#if") &&
10924-
d.linenr >= start->linenr() &&
10925-
d.linenr <= end->linenr() &&
10926-
start->fileIndex() < list.getFiles().size() &&
10927-
d.file == list.getFiles()[start->fileIndex()];
10924+
d.linenr >= start->linenr() &&
10925+
d.linenr <= end->linenr() &&
10926+
start->fileIndex() < list.getFiles().size() &&
10927+
d.file == list.getFiles()[start->fileIndex()];
1092810928
});
1092910929
}
1093010930

lib/vf_settokenvalue.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ namespace ValueFlow
537537
args2.begin(),
538538
[&](const Token* atok, const Token* btok) {
539539
return atok->getKnownIntValue() ==
540-
btok->getKnownIntValue();
540+
btok->getKnownIntValue();
541541
});
542542
} else {
543543
equal = false;

test/fixture.h

+2
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ class TestInstance {
335335
#define TODO_ASSERT( CONDITION ) do { const bool condition=(CONDITION); todoAssertEquals(__FILE__, __LINE__, true, false, condition); } while (false)
336336
#define TODO_ASSERT_EQUALS( WANTED, CURRENT, ACTUAL ) todoAssertEquals(__FILE__, __LINE__, WANTED, CURRENT, ACTUAL)
337337

338+
// *INDENT-OFF*
338339
#define REGISTER_TEST( CLASSNAME ) namespace { class CLASSNAME ## Instance : public TestInstance { public: CLASSNAME ## Instance() : TestInstance(#CLASSNAME) {} TestFixture* create() override { impl.reset(new CLASSNAME); return impl.get(); } }; CLASSNAME ## Instance instance_ ## CLASSNAME; }
340+
// *INDENT-ON*
339341

340342
#define PLATFORM( P, T ) do { std::string errstr; assertEquals(__FILE__, __LINE__, true, P.set(Platform::toString(T), errstr, {exename}), errstr); } while (false)
341343

0 commit comments

Comments
 (0)