Cosmetics: address cppcheck warnings on src/actions

This commit is contained in:
Felipe Zimmerle
2020-01-22 10:37:24 -03:00
parent a6620604d4
commit 9101a8ab15
96 changed files with 99 additions and 97 deletions

View File

@@ -53,7 +53,7 @@ enum AllowType : int {
class Allow : public Action {
public:
explicit Allow(std::string action)
explicit Allow(const std::string &action)
: Action(action, RunTimeOnlyIfMatchKind),
m_allowType(NoneAllowType) { }

View File

@@ -31,7 +31,7 @@ namespace disruptive {
class Deny : public Action {
public:
explicit Deny(std::string action) : Action(action) { }
explicit Deny(const std::string &action) : Action(action) { }
bool evaluate(Rule *rule, Transaction *transaction,
std::shared_ptr<RuleMessage> rm) override;

View File

@@ -31,7 +31,7 @@ namespace disruptive {
class Drop : public Action {
public:
explicit Drop(std::string action) : Action(action) { }
explicit Drop(const std::string &action) : Action(action) { }
bool evaluate(Rule *rule, Transaction *transaction,
std::shared_ptr<RuleMessage> rm) override;

View File

@@ -29,7 +29,7 @@ namespace disruptive {
class Pass : public Action {
public:
explicit Pass(std::string action) : Action(action) { }
explicit Pass(const std::string &action) : Action(action) { }
bool evaluate(Rule *rule, Transaction *transaction,
std::shared_ptr<RuleMessage> rm) override;

View File

@@ -38,10 +38,12 @@ class Redirect : public Action {
public:
explicit Redirect(const std::string &action)
: Action(action, RunTimeOnlyIfMatchKind),
m_status(0) { }
m_status(0),
m_string(nullptr) { }
explicit Redirect(std::unique_ptr<RunTimeString> z)
: Action("redirert", RunTimeOnlyIfMatchKind),
m_status(0),
m_string(std::move(z)) { }
bool evaluate(Rule *rule, Transaction *transaction,