From: Bhagya Tholpady (bbantwal) Date: Fri, 9 Oct 2020 14:22:46 +0000 (+0000) Subject: Merge pull request #2533 in SNORT/snort3 from ~OSHUMEIK/snort3:n_fix to master X-Git-Tag: 3.0.3-3~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db88355686ab986727f858e458d49bf30e073ba;p=thirdparty%2Fsnort3.git Merge pull request #2533 in SNORT/snort3 from ~OSHUMEIK/snort3:n_fix to master Squashed commit of the following: commit e08dc554e97ea7f23ac08df37ebb4515c89e47ae Author: Oleksii Shumeiko 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. --- diff --git a/src/trace/trace_parser.cc b/src/trace/trace_parser.cc index 54049de93..e71d0a9c4 100644 --- a/src/trace/trace_parser.cc +++ b/src/trace/trace_parser.cc @@ -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; } };