From 495b47d8a21f209b4c297d207bccb4874f89c271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Major?= Date: Thu, 21 Sep 2017 17:48:42 +0200 Subject: [PATCH] Eliminate some reorder and sign warnings --- headers/modsecurity/actions/action.h | 16 +++++++------- headers/modsecurity/rules.h | 10 ++++----- headers/modsecurity/rules_properties.h | 30 +++++++++++++------------- headers/modsecurity/transaction.h | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/headers/modsecurity/actions/action.h b/headers/modsecurity/actions/action.h index 96f5921b..b1e0efc7 100644 --- a/headers/modsecurity/actions/action.h +++ b/headers/modsecurity/actions/action.h @@ -39,21 +39,21 @@ namespace actions { class Action { public: explicit Action(const std::string& _action) - : action_kind(2), - m_isNone(false), + : m_isNone(false), + temporaryAction(false), + action_kind(2), m_name(""), - m_referenceCount(1), m_parser_payload(""), - temporaryAction(false) { + m_referenceCount(1) { set_name_and_payload(_action); } explicit Action(const std::string& _action, int kind) - : action_kind(kind), - m_isNone(false), + : m_isNone(false), + temporaryAction(false), + action_kind(kind), m_name(""), - m_referenceCount(1), m_parser_payload(""), - temporaryAction(false) { + m_referenceCount(1) { set_name_and_payload(_action); } diff --git a/headers/modsecurity/rules.h b/headers/modsecurity/rules.h index 71afebe0..d460a074 100644 --- a/headers/modsecurity/rules.h +++ b/headers/modsecurity/rules.h @@ -45,19 +45,19 @@ class Rules : public RulesProperties { public: Rules() : RulesProperties(new DebugLog()), + unicode_codepage(0), m_referenceCount(0), - m_secmarker_skipped(0), - unicode_codepage(0) { + m_secmarker_skipped(0) { unicode_map_table = reinterpret_cast( malloc(sizeof(int)*65536)); memset(unicode_map_table, -1, (sizeof(int)*65536)); } explicit Rules(DebugLog *customLog) - : m_referenceCount(0), - m_secmarker_skipped(0), + : RulesProperties(customLog), unicode_codepage(0), - RulesProperties(customLog) { + m_referenceCount(0), + m_secmarker_skipped(0) { unicode_map_table = reinterpret_cast( malloc(sizeof(int)*65536)); memset(unicode_map_table, -1, (sizeof(int)*65536)); diff --git a/headers/modsecurity/rules_properties.h b/headers/modsecurity/rules_properties.h index d1a4170a..5871f578 100644 --- a/headers/modsecurity/rules_properties.h +++ b/headers/modsecurity/rules_properties.h @@ -82,31 +82,31 @@ class ConfigSet { class RulesProperties { public: RulesProperties() : - m_debugLog(new DebugLog()), m_auditLog(new AuditLog()), - m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), + m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), m_secRequestBodyAccess(PropertyNotSetConfigBoolean), m_secResponseBodyAccess(PropertyNotSetConfigBoolean), m_secXMLExternalEntity(PropertyNotSetConfigBoolean), - m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), - m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), - m_secRuleEngine(PropertyNotSetRuleEngine), + m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), m_uploadKeepFiles(PropertyNotSetConfigBoolean), - m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean) { } + m_debugLog(new DebugLog()), + m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_secRuleEngine(PropertyNotSetRuleEngine) { } explicit RulesProperties(DebugLog *debugLog) : - m_debugLog(debugLog), m_auditLog(new AuditLog()), - m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), + m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), m_secRequestBodyAccess(PropertyNotSetConfigBoolean), m_secResponseBodyAccess(PropertyNotSetConfigBoolean), m_secXMLExternalEntity(PropertyNotSetConfigBoolean), - m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), - m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), - m_secRuleEngine(PropertyNotSetRuleEngine), + m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), m_uploadKeepFiles(PropertyNotSetConfigBoolean), - m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean) { } + m_debugLog(debugLog), + m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_secRuleEngine(PropertyNotSetRuleEngine) { } ~RulesProperties() { @@ -360,7 +360,7 @@ class RulesProperties { std::vector *actions_from = \ from->m_defaultActions+i; std::vector *actions_to = to->m_defaultActions+i; - for (int j = 0; j < actions_from->size(); j++) { + for (size_t j = 0; j < actions_from->size(); j++) { actions::Action *action = actions_from->at(j); action->refCountIncrease(); actions_to->push_back(action); @@ -411,9 +411,9 @@ class RulesProperties { for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { std::vector *rules_to = to+i; std::vector *rules_from = from+i; - for (int j = 0; j < rules_from->size(); j++) { + for (size_t j = 0; j < rules_from->size(); j++) { Rule *rule = rules_from->at(j); - for (int z = 0; z < rules_to->size(); z++) { + for (size_t z = 0; z < rules_to->size(); z++) { Rule *rule_ckc = rules_to->at(z); if (rule_ckc->m_ruleId == rule->m_ruleId && rule_ckc->m_secMarker == false && diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index adf39689..25a7731a 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -127,8 +127,8 @@ class TransactionAnchoredVariables { m_variableRemotePort(t, "REMOTE_PORT"), m_variableReqbodyError(t, "REQBODY_ERROR"), m_variableReqbodyErrorMsg(t, "REQBODY_ERROR_MSG"), - m_variableReqbodyProcessorErrorMsg(t, "REQBODY_PROCESSOR_ERROR_MSG"), m_variableReqbodyProcessorError(t, "REQBODY_PROCESSOR_ERROR"), + m_variableReqbodyProcessorErrorMsg(t, "REQBODY_PROCESSOR_ERROR_MSG"), m_variableReqbodyProcessor(t, "REQBODY_PROCESSOR"), m_variableRequestBasename(t, "REQUEST_BASENAME"), m_variableRequestBody(t, "REQUEST_BODY"),