astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2021-02-10 11:42:00 +01:00
parent 39c5274742
commit fbf63b932e
7 changed files with 37 additions and 48 deletions

View File

@ -329,20 +329,17 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
QXmlStreamReader::TokenType type; QXmlStreamReader::TokenType type;
if (xmlReader.attributes().hasAttribute("ext")) { if (xmlReader.attributes().hasAttribute("ext")) {
markup.ext = xmlReader.attributes().value("ext").toString(); markup.ext = xmlReader.attributes().value("ext").toString();
} } else {
else {
mandatoryAttibuteMissing(xmlReader, "ext"); mandatoryAttibuteMissing(xmlReader, "ext");
} }
if (xmlReader.attributes().hasAttribute("aftercode")) { if (xmlReader.attributes().hasAttribute("aftercode")) {
markup.afterCode = (xmlReader.attributes().value("aftercode") == "true") ? true : false; markup.afterCode = (xmlReader.attributes().value("aftercode") == "true") ? true : false;
} } else {
else {
mandatoryAttibuteMissing(xmlReader, "aftercode"); mandatoryAttibuteMissing(xmlReader, "aftercode");
} }
if (xmlReader.attributes().hasAttribute("reporterrors")) { if (xmlReader.attributes().hasAttribute("reporterrors")) {
markup.reportErrors = (xmlReader.attributes().value("reporterrors") == "true") ? true : false; markup.reportErrors = (xmlReader.attributes().value("reporterrors") == "true") ? true : false;
} } else {
else {
mandatoryAttibuteMissing(xmlReader, "reporterrors"); mandatoryAttibuteMissing(xmlReader, "reporterrors");
} }
@ -358,8 +355,7 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
continue; continue;
if (xmlReader.name().toString() == "keyword") { if (xmlReader.name().toString() == "keyword") {
markup.keywords.append(xmlReader.attributes().value("name").toString()); markup.keywords.append(xmlReader.attributes().value("name").toString());
} } else {
else {
unhandledElement(xmlReader); unhandledElement(xmlReader);
} }
} }
@ -372,13 +368,11 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
continue; continue;
if (xmlReader.name().toString() == "block") { if (xmlReader.name().toString() == "block") {
codeBlock.blocks.append(xmlReader.attributes().value("name").toString()); codeBlock.blocks.append(xmlReader.attributes().value("name").toString());
} } else if (xmlReader.name().toString() == "structure") {
else if (xmlReader.name().toString() == "structure") {
codeBlock.offset = xmlReader.attributes().value("offset").toInt(); codeBlock.offset = xmlReader.attributes().value("offset").toInt();
codeBlock.start = xmlReader.attributes().value("start").toString(); codeBlock.start = xmlReader.attributes().value("start").toString();
codeBlock.end = xmlReader.attributes().value("end").toString(); codeBlock.end = xmlReader.attributes().value("end").toString();
} } else {
else {
unhandledElement(xmlReader); unhandledElement(xmlReader);
} }
} }
@ -392,14 +386,11 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
continue; continue;
if (xmlReader.name().toString() == "exporter") { if (xmlReader.name().toString() == "exporter") {
exporter.prefix = xmlReader.attributes().value("prefix").toString(); exporter.prefix = xmlReader.attributes().value("prefix").toString();
} } else if (xmlReader.name().toString() == "prefix") {
else if (xmlReader.name().toString() == "prefix") {
exporter.prefixList.append(xmlReader.readElementText()); exporter.prefixList.append(xmlReader.readElementText());
} } else if (xmlReader.name().toString() == "suffix") {
else if (xmlReader.name().toString() == "suffix") {
exporter.suffixList.append(xmlReader.readElementText()); exporter.suffixList.append(xmlReader.readElementText());
} } else {
else {
unhandledElement(xmlReader); unhandledElement(xmlReader);
} }
} }
@ -411,8 +402,7 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
continue; continue;
if (xmlReader.name().toString() == "importer") { if (xmlReader.name().toString() == "importer") {
markup.importer.append(xmlReader.readElementText()); markup.importer.append(xmlReader.readElementText());
} } else {
else {
unhandledElement(xmlReader); unhandledElement(xmlReader);
} }
} }

View File

@ -755,8 +755,7 @@ static void followVariableExpressionError(const Token *tok1, const Token *tok2,
std::vector<ReferenceToken> followAllReferences(const Token* tok, bool inconclusive, ErrorPath errors, int depth) std::vector<ReferenceToken> followAllReferences(const Token* tok, bool inconclusive, ErrorPath errors, int depth)
{ {
struct ReferenceTokenLess { struct ReferenceTokenLess {
bool operator()(const ReferenceToken& x, const ReferenceToken& y) const bool operator()(const ReferenceToken& x, const ReferenceToken& y) const {
{
return x.token < y.token; return x.token < y.token;
} }
}; };

View File

@ -2845,7 +2845,9 @@ Check::FileInfo *CheckClass::getFileInfo(const Tokenizer *tokenizer, const Setti
// the full definition must be compared // the full definition must be compared
bool fullDefinition = std::all_of(classScope->functionList.begin(), bool fullDefinition = std::all_of(classScope->functionList.begin(),
classScope->functionList.end(), classScope->functionList.end(),
[](const Function& f) { return f.hasBody(); }); [](const Function& f) {
return f.hasBody();
});
if (!fullDefinition) if (!fullDefinition)
continue; continue;

View File

@ -584,7 +584,6 @@ void execute(const Token *expr,
*result = 0; *result = 0;
else else
*error = true; *error = true;
} } else
else
*error = true; *error = true;
} }

View File

@ -2001,8 +2001,7 @@ struct ValueFlowAnalyzer : Analyzer {
return isModified(tok); return isModified(tok);
} }
Action analyzeToken(const Token* ref, const Token* tok, Direction d, bool inconclusiveRef) const Action analyzeToken(const Token* ref, const Token* tok, Direction d, bool inconclusiveRef) const {
{
if (!ref) if (!ref)
return Action::None; return Action::None;
// If its an inconclusiveRef then ref != tok // If its an inconclusiveRef then ref != tok