Cosmetics: Reduce the coding style warnings

This commit is contained in:
Felipe Zimmerle
2016-03-21 15:32:02 -03:00
parent c43391072c
commit 214cc15785
7 changed files with 22 additions and 25 deletions

View File

@@ -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),

View File

@@ -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