Code cosmetic: Having the code following our coding style

This commit also update some methods parameters to const.
This commit is contained in:
Felipe Zimmerle
2015-07-08 17:33:29 -03:00
parent 73154b51a1
commit 7ea9ff8836
19 changed files with 70 additions and 69 deletions

View File

@@ -44,7 +44,7 @@ void Redirect::fill_intervention(ModSecurityIntervention *i) {
i->status = this->status;
}
// reinterpret_cast<char *>
i->url = (char *) this->url.c_str(); //** TODO: wheee */
i->url = this->url.c_str(); //** TODO: wheee */
i->log = "Redirecting";
}

View File

@@ -40,7 +40,8 @@ std::string& CompressWhitespace::evaluate(std::string value,
/**
* @todo Implement the transformation CompressWhitespace
*/
assay->debug(4, "Transformation CompressWhitespace is not implemented yet.");
assay->debug(4, "Transformation CompressWhitespace is " \
"not implemented yet.");
}
} // namespace transformations

View File

@@ -41,4 +41,4 @@ class HexDecode : public Transformation {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
#endif // SRC_ACTIONS_TRANSFORMATIONS_HEX_DECODE_H_

View File

@@ -18,8 +18,8 @@
#include "actions/action.h"
#include "actions/transformations/transformation.h"
#ifndef SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
#define SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
#ifndef SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_
#define SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_
#ifdef __cplusplus
namespace ModSecurity {
@@ -41,4 +41,4 @@ class HexEncode : public Transformation {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
#endif // SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_

View File

@@ -41,4 +41,4 @@ class ParityOdd7bit : public Transformation {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_PARITY_EVEN_7BIT_H_
#endif // SRC_ACTIONS_TRANSFORMATIONS_PARITY_ODD_7BIT_H_

View File

@@ -40,7 +40,8 @@ std::string& RemoveComments::evaluate(std::string value,
/**
* @todo Implement the transformation RemoveComments
*/
assay->debug(4, "Transformation RemoveComments is not implemented yet.");
assay->debug(4, "Transformation RemoveComments is not " \
"implemented yet.");
return value;
}

View File

@@ -40,7 +40,8 @@ std::string& RemoveCommentsChar::evaluate(std::string value,
/**
* @todo Implement the transformation RemoveCommentsChar
*/
assay->debug(4, "Transformation RemoveCommentsChar is not implemented yet.");
assay->debug(4, "Transformation RemoveCommentsChar " \
"is not implemented yet.");
return value;
}

View File

@@ -49,7 +49,6 @@
#include "actions/transformations/replace_nulls.h"
#include "actions/transformations/sha1.h"
#include "actions/transformations/sql_hex_decode.h"
#include "actions/transformations/transformation.h"
#include "actions/transformations/trim.h"
#include "actions/transformations/trim_left.h"
#include "actions/transformations/trim_right.h"
@@ -79,7 +78,6 @@ std::string &Transformation::evaluate(std::string value,
}
Transformation* Transformation::instantiate(std::string a) {
IF_MATCH(base64_decode_ext) { return new Base64DecodeExt(a); }
IF_MATCH(base64_decode) { return new Base64Decode(a); }
IF_MATCH(cmd_line) { return new CmdLine(a); }
@@ -115,7 +113,7 @@ Transformation* Transformation::instantiate(std::string a) {
IF_MATCH(url_decode_uni) { return new UrlDecodeUni(a); }
IF_MATCH(url_encode) { return new UrlEncode(a); }
IF_MATCH(utf8_to_unicode) { return new Utf8Unicode(a); }
return new Transformation(a);
}

View File

@@ -30,7 +30,7 @@ namespace ModSecurity {
namespace actions {
namespace transformations {
TrimRight::TrimRight(std::string action)
: Trim(action) {
this->action_kind = 1;

View File

@@ -42,4 +42,4 @@ class TrimRight : public Trim {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_TRIM_H_
#endif // SRC_ACTIONS_TRANSFORMATIONS_TRIM_RIGHT_H_

View File

@@ -18,8 +18,8 @@
#include "actions/action.h"
#include "actions/transformations/transformation.h"
#ifndef SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
#define SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
#ifndef SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_
#define SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_
#ifdef __cplusplus
namespace ModSecurity {
@@ -41,4 +41,4 @@ class Utf8Unicode : public Transformation {
#endif
#endif // SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
#endif // SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_