]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2533 in SNORT/snort3 from ~OSHUMEIK/snort3:n_fix to master
authorBhagya Tholpady (bbantwal) <bbantwal@cisco.com>
Fri, 9 Oct 2020 14:22:46 +0000 (14:22 +0000)
committerBhagya Tholpady (bbantwal) <bbantwal@cisco.com>
Fri, 9 Oct 2020 14:22:46 +0000 (14:22 +0000)
Squashed commit of the following:

commit e08dc554e97ea7f23ac08df37ebb4515c89e47ae
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date:   Thu Oct 8 14:22:20 2020 +0300

    trace: refactor the test code

    Removing the warning of kind '-Wextra-semi-stmt'.
    Fixing the trace pointers type.

src/trace/trace_parser.cc

index 54049de93024f47c663dd9f3516da8bfc46fc8b7..e71d0a9c4877512b9f238836379f621bb68ac88a 100644 (file)
@@ -181,7 +181,7 @@ void TraceParser::init_configured_trace_options()
         #name, type, range, nullptr, #name " test");                    \
     Value name(false);                                                  \
     name.set(&name##_param);                                            \
-    name.set(value);
+    name.set(value)
 
 #define MODULE_OPTION(name, value) \
     CONFIG_OPTION(name, value, Parameter::PT_INT, "0:255")
@@ -204,13 +204,13 @@ static const TraceOption trace_options[] =
     { nullptr, 0, nullptr }
 };
 
-static Trace *m1_trace, *m2_trace;
+static const Trace *m1_trace, *m2_trace;
 
 class Module1 : public Module
 {
 public:
     Module1() : Module("mod_1", "testing trace parser module 1") { }
-    void set_trace(const Trace* t) const override { m1_trace = (Trace*)t; }
+    void set_trace(const Trace* t) const override { m1_trace = t; }
     const TraceOption* get_trace_options() const override { return trace_options; }
 
 };
@@ -219,7 +219,7 @@ class Module2 : public Module
 {
 public:
     Module2() : Module("mod_2", "testing trace parser module 2") { }
-    void set_trace(const Trace* t) const override { m2_trace = (Trace*)t; }
+    void set_trace(const Trace* t) const override { m2_trace = t; }
     const TraceOption* get_trace_options() const override { return trace_options; }
 
 };