diff --git a/blocks/basic/include/gnuradio-4.0/basic/SignalGenerator.hpp b/blocks/basic/include/gnuradio-4.0/basic/SignalGenerator.hpp index 41412aa6..f11f0688 100644 --- a/blocks/basic/include/gnuradio-4.0/basic/SignalGenerator.hpp +++ b/blocks/basic/include/gnuradio-4.0/basic/SignalGenerator.hpp @@ -62,8 +62,8 @@ s(t) = 2 * A * (t * f - floor(t * f + 0.5)) + O This waveform linearly increases from -amplitude to amplitude in the first half of its period and then decreases back to -amplitude in the second half, forming a triangle shape. s(t) = A * (4 * abs(t * f - floor(t * f + 0.75) + 0.25) - 1) + O )"">; - PortIn in; // ClockSource input - PortOut out; + PortIn in{}; // ClockSource input + PortOut out{}; Annotated> sample_rate = 1000.f; Annotated> signal_type = "Sin"; diff --git a/blocks/basic/include/gnuradio-4.0/basic/StreamToDataSet.hpp b/blocks/basic/include/gnuradio-4.0/basic/StreamToDataSet.hpp index aa37015f..b813c47b 100644 --- a/blocks/basic/include/gnuradio-4.0/basic/StreamToDataSet.hpp +++ b/blocks/basic/include/gnuradio-4.0/basic/StreamToDataSet.hpp @@ -22,21 +22,21 @@ struct StreamFilterImpl : Block, Doc>; - PortIn in; - PortOut out; + PortIn in{}; + PortOut out{}; // settings - A/, /]'">> filter; - A> filterState; + A/, /]'">> filter{}; + A> filterState{}; A> n_pre = 0U; A> n_post = 0U; A> n_max = 0U; // meta information (will be usually set by incoming tags/upstream sources A> sample_rate = 1.f; - A> signal_name; + A> signal_name{}; A> signal_quantity; - A> signal_unit; + A> signal_unit{}; A> signal_min = 0.f; A> signal_max = 1.f; @@ -46,7 +46,7 @@ struct StreamFilterImpl : Block, Doc _tempDataSet; + DataSet _tempDataSet{}; bool _dataSetAccumulation = false; void diff --git a/blocks/basic/include/gnuradio-4.0/basic/clock_source.hpp b/blocks/basic/include/gnuradio-4.0/basic/clock_source.hpp index 0b128588..99fd085e 100644 --- a/blocks/basic/include/gnuradio-4.0/basic/clock_source.hpp +++ b/blocks/basic/include/gnuradio-4.0/basic/clock_source.hpp @@ -36,14 +36,14 @@ This block can generate periodic signals based on a system clock and allows for The 'tag_times[ns]:tag_value(string)' vectors control the emission of tags with a single 'context' keys at specified times after the block started.)"">; using TimePoint = std::chrono::time_point; - PortOut out; + PortOut out{}; // Ready-to-use tags set by user std::vector tags{}; // Time-string tags - Annotated, "tag offset time", Doc<"time in nanoseconds since block start">> tag_times; - Annotated, "tag values", Doc<"values to be emittages as {\" context \":value_i}">> tag_values; + Annotated, "tag offset time", Doc<"time in nanoseconds since block start">> tag_times{}; + Annotated, "tag values", Doc<"values to be emittages as {\" context \":value_i}">> tag_values{}; Annotated last tag_time -> restart tags, in nanoseconds">> repeat_period{ 0 }; Annotated> do_zero_order_hold{ false }; @@ -51,7 +51,7 @@ The 'tag_times[ns]:tag_value(string)' vectors control the emission of tags with gr::Size_t n_samples_produced{ 0 }; A sample_rate = 1000.f; A> chunk_size = 100; - std::shared_ptr userProvidedThread; + std::shared_ptr userProvidedThread{}; bool verbose_console = false; std::size_t _nextTag{ 0 }; diff --git a/blocks/fileio/include/gnuradio-4.0/fileio/BasicFileIo.hpp b/blocks/fileio/include/gnuradio-4.0/fileio/BasicFileIo.hpp index b3421d4b..eb6d9a7f 100644 --- a/blocks/fileio/include/gnuradio-4.0/fileio/BasicFileIo.hpp +++ b/blocks/fileio/include/gnuradio-4.0/fileio/BasicFileIo.hpp @@ -76,7 +76,7 @@ Important: this implementation assumes a host-order, CPU architecture specific b template using A = gr::Annotated; // optional shortening - PortIn in; + PortIn in{}; A, Visible> file_name; Mode _mode = Mode::overwrite; @@ -181,7 +181,7 @@ Important: this implementation assumes a host-order, CPU architecture specific b template using A = gr::Annotated; // optional shortening - PortOut out; + PortOut out{}; A, Visible> file_name; Mode _mode = Mode::overwrite; diff --git a/blocks/math/include/gnuradio-4.0/math/Math.hpp b/blocks/math/include/gnuradio-4.0/math/Math.hpp index 7678d206..96ad7699 100644 --- a/blocks/math/include/gnuradio-4.0/math/Math.hpp +++ b/blocks/math/include/gnuradio-4.0/math/Math.hpp @@ -24,8 +24,8 @@ defaultValue() noexcept { template struct MathOpImpl : public gr::Block> { - PortIn in; - PortOut out; + PortIn in{}; + PortOut out{}; T value = detail::defaultValue(); template V> diff --git a/blocks/testing/include/gnuradio-4.0/testing/ImChartMonitor.hpp b/blocks/testing/include/gnuradio-4.0/testing/ImChartMonitor.hpp index 8a71a631..a75ab3e3 100644 --- a/blocks/testing/include/gnuradio-4.0/testing/ImChartMonitor.hpp +++ b/blocks/testing/include/gnuradio-4.0/testing/ImChartMonitor.hpp @@ -18,7 +18,7 @@ template requires(std::is_arithmetic_v || gr::DataSetLike) struct ImChartMonitor : public Block, BlockingIO, Drawable> { using ClockSourceType = std::chrono::system_clock; - PortIn in; + PortIn in{}; float sample_rate = 1000.0f; std::string signal_name = "unknown signal"; diff --git a/blocks/testing/include/gnuradio-4.0/testing/NullSources.hpp b/blocks/testing/include/gnuradio-4.0/testing/NullSources.hpp index c519f35c..76da5425 100644 --- a/blocks/testing/include/gnuradio-4.0/testing/NullSources.hpp +++ b/blocks/testing/include/gnuradio-4.0/testing/NullSources.hpp @@ -14,7 +14,7 @@ struct NullSource : public gr::Block> { Used mainly for testing and benchmarking where a consistent and predictable output is essential. Ideal for scenarios that require a simple, low-overhead source of consistent values.)"">; - gr::PortOut out; + gr::PortOut out{}; [[nodiscard]] constexpr T processOne() const noexcept { return T{}; } }; @@ -27,7 +27,7 @@ struct ConstantSource : public gr::Block> { This block counts the number of samples emitted and optionally halts after reaching a specified maximum. Commonly used for testing and simulations where consistent output and finite execution are required.)"">; - gr::PortOut out; + gr::PortOut out{}; Annotated> default_value{}; Annotatedn_samples_max -> signal DONE (0: infinite)">> n_samples_max = 0U; @@ -78,7 +78,7 @@ struct CountingSource : public gr::Block> { This block counts the number of samples emitted and optionally halts after reaching a specified maximum. Commonly used for testing and simulations where consistent output and finite execution are required.)"">; - gr::PortOut out; + gr::PortOut out{}; Annotated> default_value{}; Annotatedn_samples_max -> signal DONE (0: infinite)">> n_samples_max = 0U; @@ -102,8 +102,8 @@ struct Copy : public gr::Block> { using Description = Doc; - gr::PortIn in; - gr::PortOut out; + gr::PortIn in{}; + gr::PortOut out{}; template V> [[nodiscard]] constexpr auto processOne(V input) const noexcept { @@ -118,8 +118,8 @@ struct HeadBlock : public gr::Block> { // TODO confirm naming: whil using Description = Doc; - gr::PortIn in; - gr::PortOut out; + gr::PortIn in{}; + gr::PortOut out{}; Annotatedn_samples_max -> signal DONE (0: infinite)">> n_samples_max = 0U; Annotated> count = 0U; @@ -143,7 +143,7 @@ struct NullSink : public gr::Block> { Used primarily for absorbing data in a flow graph where output processing is unnecessary. Commonly used for testing, performance benchmarking, and in scenarios where signal flow needs to be terminated without external effects.)"">; - gr::PortIn in; + gr::PortIn in{}; template V> void processOne(V) const noexcept {} @@ -157,7 +157,7 @@ struct CountingSink : public gr::Block> { This block is used to control execution in systems requiring precise input processing without data output, similar to how a 'HeadBlock' manages output samples. Commonly used for testing scenarios and signal termination where output is unnecessary but precise input count control is needed.)"">; - gr::PortIn in; + gr::PortIn in{}; Annotatedn_samples_max -> signal DONE (0: infinite)">> n_samples_max = 0U; Annotated> count = 0U; diff --git a/blocks/testing/include/gnuradio-4.0/testing/TagMonitors.hpp b/blocks/testing/include/gnuradio-4.0/testing/TagMonitors.hpp index 3388da41..836c551f 100644 --- a/blocks/testing/include/gnuradio-4.0/testing/TagMonitors.hpp +++ b/blocks/testing/include/gnuradio-4.0/testing/TagMonitors.hpp @@ -89,7 +89,7 @@ equal_tag_lists(const std::vector &tags1, const std::vector &tags2, co template struct TagSource : public Block> { - PortOut out; + PortOut out{}; std::vector tags{}; std::vector values{}; // if values are set it works like repeated source. Example: values = { 1, 2, 3 }; output: 1,2,3,1,2,3... `mark_tag` is ignored in this case. std::size_t value_index{ 0 }; // current index in values array @@ -181,8 +181,8 @@ struct TagSource : public Block> { template struct TagMonitor : public Block> { using ClockSourceType = std::chrono::system_clock; - PortIn in; - PortOut out; + PortIn in{}; + PortOut out{}; std::vector samples{}; std::vector tags{}; gr::Size_t n_samples_expected{ 0 }; @@ -281,7 +281,7 @@ struct TagMonitor : public Block> { template struct TagSink : public Block> { using ClockSourceType = std::chrono::system_clock; - PortIn in; + PortIn in{}; std::vector samples{}; std::vector tags{}; gr::Size_t n_samples_expected{ 0 }; diff --git a/blocks/testing/include/gnuradio-4.0/testing/bm_test_helper.hpp b/blocks/testing/include/gnuradio-4.0/testing/bm_test_helper.hpp index 73e13047..dae8d699 100644 --- a/blocks/testing/include/gnuradio-4.0/testing/bm_test_helper.hpp +++ b/blocks/testing/include/gnuradio-4.0/testing/bm_test_helper.hpp @@ -17,9 +17,9 @@ inline static std::size_t n_samples_produced = 0UZ; template struct source : public gr::Block> { - gr::PortOut out; + gr::PortOut out{}; - gr::Size_t n_samples_max; + gr::Size_t n_samples_max = 256; friend constexpr std::size_t available_samples(const source &self) noexcept { @@ -47,7 +47,7 @@ inline static std::size_t n_samples_consumed = 0UZ; template struct sink : public gr::Block> { - gr::PortIn> in; + gr::PortIn> in{}; uint64_t should_receive_n_samples = 0; int64_t _last_tag_position = -1; diff --git a/core/benchmarks/bm-nosonar_node_api.cpp b/core/benchmarks/bm-nosonar_node_api.cpp index 21f87938..519f1b03 100644 --- a/core/benchmarks/bm-nosonar_node_api.cpp +++ b/core/benchmarks/bm-nosonar_node_api.cpp @@ -84,8 +84,8 @@ template struct converting_multiply : public gr::Block> { T value = static_cast(1.0f); - gr::PortIn in; - gr::PortOut out; + gr::PortIn in{}; + gr::PortOut out{}; [[nodiscard]] constexpr auto processOne(T a) const noexcept { @@ -114,8 +114,8 @@ static_assert(gr::traits::block::can_processOne_simd class add : public gr::Block> { public: - gr::PortIn in; - gr::PortOut out; + gr::PortIn in{}; + gr::PortOut out{}; template V> [[nodiscard]] constexpr V @@ -223,8 +223,8 @@ using add_SIMD = gen_operation_SIMD; template class copy : public gr::Block> { public: - gr::PortIn> in; - gr::PortOut> out; + gr::PortIn> in{}; + gr::PortOut> out{}; template V> [[nodiscard]] constexpr V diff --git a/core/include/gnuradio-4.0/Block.hpp b/core/include/gnuradio-4.0/Block.hpp index 071290b5..821c7ca9 100644 --- a/core/include/gnuradio-4.0/Block.hpp +++ b/core/include/gnuradio-4.0/Block.hpp @@ -904,8 +904,10 @@ class Block : public lifecycle::StateMachine, protected std::tuple(&self())); } - inline constexpr void publishEoS() noexcept { const property_map& tag_data{{gr::tag::END_OF_STREAM, true}}; - for_each_port([&tag_data](PortLike auto& outPort) { outPort.publishTag(tag_data, outPort.streamWriter().nSamplesPublished()); }, outputPorts(&self())); } + inline constexpr void publishEoS() noexcept { + const property_map& tag_data{{gr::tag::END_OF_STREAM, true}}; + for_each_port([&tag_data](PortLike auto& outPort) { outPort.publishTag(tag_data, static_cast(outPort.streamWriter().nSamplesPublished())); }, outputPorts(&self())); + } constexpr void requestStop() noexcept { emitErrorMessageIfAny("requestStop()", this->changeStateTo(lifecycle::State::REQUESTED_STOP)); } diff --git a/core/include/gnuradio-4.0/Port.hpp b/core/include/gnuradio-4.0/Port.hpp index 1d777f92..dc1d5ad3 100644 --- a/core/include/gnuradio-4.0/Port.hpp +++ b/core/include/gnuradio-4.0/Port.hpp @@ -367,7 +367,7 @@ struct Port { break; } } - bool result = tags.tryConsume(tagsToConsume); + std::ignore = tags.tryConsume(tagsToConsume); } } }; diff --git a/core/test/plugins/good_conversion_plugin.cpp b/core/test/plugins/good_conversion_plugin.cpp index 3c048565..4453c0a9 100644 --- a/core/test/plugins/good_conversion_plugin.cpp +++ b/core/test/plugins/good_conversion_plugin.cpp @@ -10,8 +10,8 @@ namespace good { template class convert : public gr::Block> { public: - gr::PortIn in; - gr::PortOut out; + gr::PortIn in{}; + gr::PortOut out{}; [[nodiscard]] constexpr auto processOne(From value) const noexcept { diff --git a/core/test/qa_Scheduler.cpp b/core/test/qa_Scheduler.cpp index f0af9749..ba2d9a93 100644 --- a/core/test/qa_Scheduler.cpp +++ b/core/test/qa_Scheduler.cpp @@ -58,7 +58,7 @@ static_assert(gr::BlockLike>); template struct ExpectSink : public gr::Block> { - gr::PortIn in; + gr::PortIn in{}; gr::Size_t n_samples_max = 0; std::shared_ptr tracer{}; gr::Size_t count = 0; @@ -250,7 +250,7 @@ checkBlockNames(const std::vector &joblist, std::set set) { template struct LifecycleSource : public gr::Block> { - gr::PortOut out; + gr::PortOut out{}; std::int32_t n_samples_produced = 0; std::int32_t n_samples_max = 10; diff --git a/core/test/qa_grc.cpp b/core/test/qa_grc.cpp index 3ff35ccc..9ec923e1 100644 --- a/core/test/qa_grc.cpp +++ b/core/test/qa_grc.cpp @@ -28,8 +28,8 @@ ENABLE_REFLECTION_FOR_TEMPLATE(ArraySource, outA, outB); template struct ArraySink : public gr::Block> { - std::array, 2> inA; - std::array, 2> inB; + std::array, 2> inA{}; + std::array, 2> inB{}; gr::Annotated bool_setting{ false }; gr::Annotated string_setting; gr::Annotated, "Bool vector setting"> bool_vector;