From 4e2f8d5d484112fedfe3c8516e137557e071e4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 23 May 2020 07:30:22 +0200 Subject: [PATCH] astyle formatting [ci skip] --- lib/cppcheck.cpp | 30 +++++++++--------- lib/errortypes.cpp | 76 +++++++++++++++++++++++----------------------- lib/exprengine.cpp | 24 +++++++-------- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 3c9fa4607..922ae88a9 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1153,11 +1153,11 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token if (pcreCompileErrorStr) { const std::string msg = "pcre_compile failed: " + std::string(pcreCompileErrorStr); const ErrorMessage errmsg(std::list(), - emptyString, - Severity::error, - msg, - "pcre_compile", - false); + emptyString, + Severity::error, + msg, + "pcre_compile", + false); reportErr(errmsg); } @@ -1174,11 +1174,11 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token if (pcreStudyErrorStr) { const std::string msg = "pcre_study failed: " + std::string(pcreStudyErrorStr); const ErrorMessage errmsg(std::list(), - emptyString, - Severity::error, - msg, - "pcre_study", - false); + emptyString, + Severity::error, + msg, + "pcre_study", + false); reportErr(errmsg); // pcre_compile() worked, but pcre_study() returned an error. Free the resources allocated by pcre_compile(). @@ -1197,11 +1197,11 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token const std::string errorMessage = pcreErrorCodeToString(pcreExecRet); if (!errorMessage.empty()) { const ErrorMessage errmsg(std::list(), - emptyString, - Severity::error, - std::string("pcre_exec failed: ") + errorMessage, - "pcre_exec", - false); + emptyString, + Severity::error, + std::string("pcre_exec failed: ") + errorMessage, + "pcre_exec", + false); reportErr(errmsg); } diff --git a/lib/errortypes.cpp b/lib/errortypes.cpp index bb5dd4c0f..365fa6ff2 100644 --- a/lib/errortypes.cpp +++ b/lib/errortypes.cpp @@ -20,45 +20,45 @@ std::string Severity::toString(Severity::SeverityType severity) { - switch (severity) { - case none: - return ""; - case error: - return "error"; - case warning: - return "warning"; - case style: - return "style"; - case performance: - return "performance"; - case portability: - return "portability"; - case information: - return "information"; - case debug: - return "debug"; - } - throw InternalError(nullptr, "Unknown severity"); + switch (severity) { + case none: + return ""; + case error: + return "error"; + case warning: + return "warning"; + case style: + return "style"; + case performance: + return "performance"; + case portability: + return "portability"; + case information: + return "information"; + case debug: + return "debug"; + } + throw InternalError(nullptr, "Unknown severity"); } Severity::SeverityType Severity::fromString(const std::string& severity) { - if (severity.empty()) - return none; - if (severity == "none") - return none; - if (severity == "error") - return error; - if (severity == "warning") - return warning; - if (severity == "style") - return style; - if (severity == "performance") - return performance; - if (severity == "portability") - return portability; - if (severity == "information") - return information; - if (severity == "debug") - return debug; - return none; + if (severity.empty()) + return none; + if (severity == "none") + return none; + if (severity == "error") + return error; + if (severity == "warning") + return warning; + if (severity == "style") + return style; + if (severity == "performance") + return performance; + if (severity == "portability") + return portability; + if (severity == "information") + return information; + if (severity == "debug") + return debug; + return none; } \ No newline at end of file diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 534d99061..9a7e37253 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1424,12 +1424,12 @@ static void checkContract(Data &data, const Token *tok, const Function *function const std::string functionName = contractIt->first; const std::string functionExpects = contractIt->second; ErrorMessage errmsg(callstack, - &data.tokenizer->list, - Severity::SeverityType::error, - id, - "Function '" + function->name() + "' is called, can not determine that its contract '" + functionExpects + "' is always met.", - CWE(0), - false); + &data.tokenizer->list, + Severity::SeverityType::error, + id, + "Function '" + function->name() + "' is called, can not determine that its contract '" + functionExpects + "' is always met.", + CWE(0), + false); errmsg.incomplete = bailoutValue; errmsg.function = functionName; data.errorLogger->reportErr(errmsg); @@ -1442,12 +1442,12 @@ static void checkContract(Data &data, const Token *tok, const Function *function const auto contractIt = data.settings->functionContracts.find(function->fullName()); const std::string functionExpects = contractIt->second; ErrorMessage errmsg(callstack, - &data.tokenizer->list, - Severity::SeverityType::error, - id, - "Function '" + function->name() + "' is called, can not determine that its contract is always met.", - CWE(0), - false); + &data.tokenizer->list, + Severity::SeverityType::error, + id, + "Function '" + function->name() + "' is called, can not determine that its contract is always met.", + CWE(0), + false); errmsg.incomplete = true; data.errorLogger->reportErr(errmsg); }