From: Mike Stepanek (mstepane) Date: Thu, 22 Jul 2021 12:50:55 +0000 (+0000) Subject: Merge pull request #2989 in SNORT/snort3 from ~YVELYKOZ/snort3:fix_byte_options to... X-Git-Tag: 3.1.9.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48109f297794bc6ae0a5490a65a6ff636d336c6d;p=thirdparty%2Fsnort3.git Merge pull request #2989 in SNORT/snort3 from ~YVELYKOZ/snort3:fix_byte_options to master Squashed commit of the following: commit 4241b0ac03324e23a059408a51e3e35c4ae0ca8e Author: Yehor Velykozhon Date: Thu Jul 22 11:56:35 2021 +0300 ips_options/byte_options: address compiler warnings --- diff --git a/src/ips_options/extract.cc b/src/ips_options/extract.cc index 73195a431..7bed91681 100644 --- a/src/ips_options/extract.cc +++ b/src/ips_options/extract.cc @@ -374,7 +374,7 @@ uint8_t numBytesInBitmask(uint32_t bitmask_value) obj.offset = offset_value; \ obj.endianness = endianness_value; \ obj.relative_flag = relative_flag_value; \ - obj.string_convert_flag = string_convert_flag_value; + obj.string_convert_flag = string_convert_flag_value TEST_CASE("ips options bitmask utils") { diff --git a/src/ips_options/ips_byte_extract.cc b/src/ips_options/ips_byte_extract.cc index 353d30e4d..7e3b1330a 100644 --- a/src/ips_options/ips_byte_extract.cc +++ b/src/ips_options/ips_byte_extract.cc @@ -465,7 +465,7 @@ const BaseApi* ips_byte_extract[] = obj.multiplier = multiplier_value; \ obj.align = align_value; \ obj.var_number = var_number_value; \ - obj.name = name_value; + obj.name = name_value class ByteExtractDataMatcher : public Catch::Matchers::Impl::MatcherBase @@ -508,7 +508,7 @@ private: ByteExtractData m_value; }; -ByteExtractDataMatcher ByteExtractDataEquals(const ByteExtractData& value) +static ByteExtractDataMatcher ByteExtractDataEquals(const ByteExtractData& value) { return {value}; } diff --git a/src/ips_options/ips_byte_jump.cc b/src/ips_options/ips_byte_jump.cc index 8c70ce59c..19a69ce2c 100644 --- a/src/ips_options/ips_byte_jump.cc +++ b/src/ips_options/ips_byte_jump.cc @@ -564,7 +564,7 @@ const BaseApi* ips_byte_jump[] = #define NO_MATCH snort::IpsOption::EvalStatus::NO_MATCH #define MATCH snort::IpsOption::EvalStatus::MATCH -void SetByteJumpData(ByteJumpData &byte_jump, int value) +static void SetByteJumpData(ByteJumpData &byte_jump, int value) { byte_jump.bytes_to_extract = value; byte_jump.offset = value; @@ -582,7 +582,7 @@ void SetByteJumpData(ByteJumpData &byte_jump, int value) byte_jump.post_offset_var = value; } -void SetByteJumpMaxValue(ByteJumpData &byte_jump) +static void SetByteJumpMaxValue(ByteJumpData &byte_jump) { byte_jump.bytes_to_extract = UINT_MAX; byte_jump.offset = INT_MAX; diff --git a/src/ips_options/ips_byte_math.cc b/src/ips_options/ips_byte_math.cc index a50cb0003..2a66ee2e5 100644 --- a/src/ips_options/ips_byte_math.cc +++ b/src/ips_options/ips_byte_math.cc @@ -571,7 +571,7 @@ const BaseApi* ips_byte_math[] = obj.offset_var = offset_var_value; \ obj.result_var = result_var_value; \ obj.rvalue_var = rvalue_var_value; \ - obj.result_name = result_name_value; + obj.result_name = result_name_value class ByteMathDataMatcher : public Catch::Matchers::Impl::MatcherBase @@ -617,7 +617,7 @@ private: ByteMathData m_value; }; -ByteMathDataMatcher ByteMathDataEquals(const ByteMathData& value) +static ByteMathDataMatcher ByteMathDataEquals(const ByteMathData& value) { return {value}; } diff --git a/src/ips_options/ips_byte_test.cc b/src/ips_options/ips_byte_test.cc index f5a62255e..083dbc8d6 100644 --- a/src/ips_options/ips_byte_test.cc +++ b/src/ips_options/ips_byte_test.cc @@ -627,7 +627,7 @@ const BaseApi* ips_byte_test[] = #define NO_MATCH snort::IpsOption::EvalStatus::NO_MATCH #define MATCH snort::IpsOption::EvalStatus::MATCH -void SetByteTestData(ByteTestData &byte_test, int value, ByteTestOper code = CHECK_EQ) +static void SetByteTestData(ByteTestData &byte_test, int value, ByteTestOper code = CHECK_EQ) { byte_test.bytes_to_extract = value; byte_test.cmp_value = value; @@ -643,7 +643,7 @@ void SetByteTestData(ByteTestData &byte_test, int value, ByteTestOper code = CHE byte_test.offset_var = value; } -void SetByteTestDataMax(ByteTestData& byte_test) +static void SetByteTestDataMax(ByteTestData& byte_test) { byte_test.bytes_to_extract = UINT_MAX; byte_test.cmp_value = UINT_MAX;