Skip to content

Commit 4e2f8d5

Browse files
committed
astyle formatting
[ci skip]
1 parent 5c3474e commit 4e2f8d5

3 files changed

Lines changed: 65 additions & 65 deletions

File tree

lib/cppcheck.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,11 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token
11531153
if (pcreCompileErrorStr) {
11541154
const std::string msg = "pcre_compile failed: " + std::string(pcreCompileErrorStr);
11551155
const ErrorMessage errmsg(std::list<ErrorMessage::FileLocation>(),
1156-
emptyString,
1157-
Severity::error,
1158-
msg,
1159-
"pcre_compile",
1160-
false);
1156+
emptyString,
1157+
Severity::error,
1158+
msg,
1159+
"pcre_compile",
1160+
false);
11611161

11621162
reportErr(errmsg);
11631163
}
@@ -1174,11 +1174,11 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token
11741174
if (pcreStudyErrorStr) {
11751175
const std::string msg = "pcre_study failed: " + std::string(pcreStudyErrorStr);
11761176
const ErrorMessage errmsg(std::list<ErrorMessage::FileLocation>(),
1177-
emptyString,
1178-
Severity::error,
1179-
msg,
1180-
"pcre_study",
1181-
false);
1177+
emptyString,
1178+
Severity::error,
1179+
msg,
1180+
"pcre_study",
1181+
false);
11821182

11831183
reportErr(errmsg);
11841184
// 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
11971197
const std::string errorMessage = pcreErrorCodeToString(pcreExecRet);
11981198
if (!errorMessage.empty()) {
11991199
const ErrorMessage errmsg(std::list<ErrorMessage::FileLocation>(),
1200-
emptyString,
1201-
Severity::error,
1202-
std::string("pcre_exec failed: ") + errorMessage,
1203-
"pcre_exec",
1204-
false);
1200+
emptyString,
1201+
Severity::error,
1202+
std::string("pcre_exec failed: ") + errorMessage,
1203+
"pcre_exec",
1204+
false);
12051205

12061206
reportErr(errmsg);
12071207
}

lib/errortypes.cpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,45 @@
2020

2121
std::string Severity::toString(Severity::SeverityType severity)
2222
{
23-
switch (severity) {
24-
case none:
25-
return "";
26-
case error:
27-
return "error";
28-
case warning:
29-
return "warning";
30-
case style:
31-
return "style";
32-
case performance:
33-
return "performance";
34-
case portability:
35-
return "portability";
36-
case information:
37-
return "information";
38-
case debug:
39-
return "debug";
40-
}
41-
throw InternalError(nullptr, "Unknown severity");
23+
switch (severity) {
24+
case none:
25+
return "";
26+
case error:
27+
return "error";
28+
case warning:
29+
return "warning";
30+
case style:
31+
return "style";
32+
case performance:
33+
return "performance";
34+
case portability:
35+
return "portability";
36+
case information:
37+
return "information";
38+
case debug:
39+
return "debug";
40+
}
41+
throw InternalError(nullptr, "Unknown severity");
4242
}
4343
Severity::SeverityType Severity::fromString(const std::string& severity)
4444
{
45-
if (severity.empty())
46-
return none;
47-
if (severity == "none")
48-
return none;
49-
if (severity == "error")
50-
return error;
51-
if (severity == "warning")
52-
return warning;
53-
if (severity == "style")
54-
return style;
55-
if (severity == "performance")
56-
return performance;
57-
if (severity == "portability")
58-
return portability;
59-
if (severity == "information")
60-
return information;
61-
if (severity == "debug")
62-
return debug;
63-
return none;
45+
if (severity.empty())
46+
return none;
47+
if (severity == "none")
48+
return none;
49+
if (severity == "error")
50+
return error;
51+
if (severity == "warning")
52+
return warning;
53+
if (severity == "style")
54+
return style;
55+
if (severity == "performance")
56+
return performance;
57+
if (severity == "portability")
58+
return portability;
59+
if (severity == "information")
60+
return information;
61+
if (severity == "debug")
62+
return debug;
63+
return none;
6464
}

lib/exprengine.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,12 +1424,12 @@ static void checkContract(Data &data, const Token *tok, const Function *function
14241424
const std::string functionName = contractIt->first;
14251425
const std::string functionExpects = contractIt->second;
14261426
ErrorMessage errmsg(callstack,
1427-
&data.tokenizer->list,
1428-
Severity::SeverityType::error,
1429-
id,
1430-
"Function '" + function->name() + "' is called, can not determine that its contract '" + functionExpects + "' is always met.",
1431-
CWE(0),
1432-
false);
1427+
&data.tokenizer->list,
1428+
Severity::SeverityType::error,
1429+
id,
1430+
"Function '" + function->name() + "' is called, can not determine that its contract '" + functionExpects + "' is always met.",
1431+
CWE(0),
1432+
false);
14331433
errmsg.incomplete = bailoutValue;
14341434
errmsg.function = functionName;
14351435
data.errorLogger->reportErr(errmsg);
@@ -1442,12 +1442,12 @@ static void checkContract(Data &data, const Token *tok, const Function *function
14421442
const auto contractIt = data.settings->functionContracts.find(function->fullName());
14431443
const std::string functionExpects = contractIt->second;
14441444
ErrorMessage errmsg(callstack,
1445-
&data.tokenizer->list,
1446-
Severity::SeverityType::error,
1447-
id,
1448-
"Function '" + function->name() + "' is called, can not determine that its contract is always met.",
1449-
CWE(0),
1450-
false);
1445+
&data.tokenizer->list,
1446+
Severity::SeverityType::error,
1447+
id,
1448+
"Function '" + function->name() + "' is called, can not determine that its contract is always met.",
1449+
CWE(0),
1450+
false);
14511451
errmsg.incomplete = true;
14521452
data.errorLogger->reportErr(errmsg);
14531453
}

0 commit comments

Comments
 (0)