mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Cosmetics: Reduce the coding style warnings
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#endif
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_RULE_H_
|
||||
@@ -90,7 +91,7 @@ class Rule {
|
||||
|
||||
class RuleMessage {
|
||||
public:
|
||||
RuleMessage(Rule *rule) :
|
||||
explicit RuleMessage(Rule *rule) :
|
||||
m_ruleFile(rule->m_fileName),
|
||||
m_ruleLine(rule->m_lineNumber),
|
||||
m_ruleId(rule->rule_id),
|
||||
|
@@ -47,28 +47,21 @@ namespace transaction {
|
||||
* We have to have a better hash function, maybe based on the std::hash.
|
||||
*
|
||||
*/
|
||||
struct MyEqual
|
||||
{
|
||||
bool operator()(const std::string& Left, const std::string& Right) const
|
||||
{
|
||||
struct MyEqual {
|
||||
bool operator()(const std::string& Left, const std::string& Right) const {
|
||||
return Left.size() == Right.size()
|
||||
&& std::equal ( Left.begin() , Left.end() , Right.begin(),
|
||||
[]( char a , char b )
|
||||
{
|
||||
&& std::equal(Left.begin(), Left.end(), Right.begin(),
|
||||
[](char a, char b) {
|
||||
return tolower(a) == tolower(b);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
struct MyHash
|
||||
{
|
||||
size_t operator()(const std::string& Keyval) const
|
||||
{
|
||||
//You might need a better hash function than this
|
||||
struct MyHash{
|
||||
size_t operator()(const std::string& Keyval) const {
|
||||
// You might need a better hash function than this
|
||||
size_t h = 0;
|
||||
std::for_each( Keyval.begin() , Keyval.end() , [&](char c )
|
||||
{
|
||||
std::for_each(Keyval.begin(), Keyval.end(), [&](char c) {
|
||||
h += tolower(c);
|
||||
});
|
||||
return h;
|
||||
@@ -92,14 +85,12 @@ class Variables :
|
||||
|
||||
std::string* resolveFirst(const std::string& var);
|
||||
|
||||
|
||||
void resolveSingleMatch(const std::string& var,
|
||||
std::vector<const transaction::Variable *> *l);
|
||||
void resolveMultiMatches(const std::string& var,
|
||||
std::vector<const transaction::Variable *> *l);
|
||||
void resolveRegularExpression(const std::string& var,
|
||||
std::vector<const transaction::Variable *> *l);
|
||||
|
||||
};
|
||||
|
||||
} // namespace transaction
|
||||
|
Reference in New Issue
Block a user