Cosmetics: Fix coding style

This commit is contained in:
Felipe Zimmerle
2016-07-12 21:39:37 -03:00
parent 3615c84ee5
commit 4cf6c714ac
34 changed files with 109 additions and 69 deletions

View File

@@ -124,8 +124,6 @@ class Action {
*/
RunTimeOnlyIfMatchKind,
};
};

View File

@@ -36,7 +36,8 @@ bool Allow::init(std::string *error) {
} else if (a == "") {
m_allowType = FromNowOneAllowType;
} else {
error->assign("Allow: if specified, the parameter most be: phase, request");
error->assign("Allow: if specified, the parameter " \
"most be: phase, request");
return false;
}

View File

@@ -29,7 +29,7 @@ class Rule;
namespace actions {
enum AllowType : short {
enum AllowType : int {
/**
*
*/
@@ -61,7 +61,7 @@ class Allow : public Action {
AllowType m_allowType;
static std::string allowTypeToName (AllowType a) {
static std::string allowTypeToName(AllowType a) {
if (a == NoneAllowType) {
return "None";
} else if (a == RequestAllowType) {

View File

@@ -36,7 +36,8 @@ bool InitCol::init(std::string *error) {
return false;
}
if (posEquals == std::string::npos) {
error->assign("Something wrong with initcol format: missing equals sign");
error->assign("Something wrong with initcol format: missing " \
"equals sign");
return false;
}
@@ -46,7 +47,8 @@ bool InitCol::init(std::string *error) {
if (m_collection_key != "ip" &&
m_collection_key != "global" &&
m_collection_key != "resource") {
error->assign("Something wrong with initcol: collection must be `ip' or `global'");
error->assign("Something wrong with initcol: collection must be " \
"`ip' or `global'");
return false;
}

View File

@@ -30,7 +30,7 @@ namespace transformations {
class Base64Decode : public Transformation {
public:
explicit Base64Decode(std::string action) : Transformation(action) { };
explicit Base64Decode(std::string action) : Transformation(action) { }
std::string evaluate(std::string exp,
Transaction *transaction) override;

View File

@@ -30,7 +30,7 @@ namespace transformations {
class Base64Encode : public Transformation {
public:
explicit Base64Encode(std::string action) : Transformation(action) { };
explicit Base64Encode(std::string action) : Transformation(action) { }
std::string evaluate(std::string exp,
Transaction *transaction) override;

View File

@@ -43,7 +43,6 @@ std::string CmdLine::evaluate(std::string value,
case '\'':
case '\\':
case '^':
//ret.append("i was here");
break;
/* replace some characters to space (only one) */
@@ -85,3 +84,4 @@ std::string CmdLine::evaluate(std::string value,
} // namespace transformations
} // namespace actions
} // namespace modsecurity

View File

@@ -44,3 +44,4 @@ class CmdLine : public Transformation {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_CMD_LINE_H_

View File

@@ -54,12 +54,13 @@ std::string RemoveCommentsChar::evaluate(std::string value,
&& value.at(i+2) == '-'
&& (i+3 < value.size())
&& value.at(i+3) == '-') {
value.erase(i, 4);
} else if (value.at(i) == '-' && (i+1 < value.size()) && value.at(i+1) == '-' &&
(i+2 < value.size()) && value.at(i+2) == '>') {
} else if (value.at(i) == '-'
&& (i+1 < value.size()) && value.at(i+1) == '-'
&& (i+2 < value.size()) && value.at(i+2) == '>') {
value.erase(i, 3);
} else if (value.at(i) == '-' && (i+1 < value.size()) && value.at(i+1) == '-') {
} else if (value.at(i) == '-'
&& (i+1 < value.size()) && value.at(i+1) == '-') {
value.erase(i, 2);
} else if (value.at(i) == '#') {
value.erase(i, 1);
@@ -73,3 +74,4 @@ std::string RemoveCommentsChar::evaluate(std::string value,
} // namespace transformations
} // namespace actions
} // namespace modsecurity