summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2020-08-29 22:19:55 +0100
committermormj <34754695+mormj@users.noreply.github.com>2020-09-09 12:45:08 -0400
commit80e3cc05aa3943d48f77aff49f39eeeb186b1015 (patch)
tree9bd06394403abb2c877eaf5ae6d021375df2d929
parent3e40f271c4fadbcc2a3d5f67895e64f18117dfd5 (diff)
blocks/correctiq: Clean up member initialization
-rw-r--r--gr-blocks/lib/correctiq_auto_impl.cc14
-rw-r--r--gr-blocks/lib/correctiq_auto_impl.h12
-rw-r--r--gr-blocks/lib/correctiq_man_impl.cc9
-rw-r--r--gr-blocks/python/blocks/bindings/correctiq_auto_python.cc2
-rw-r--r--gr-blocks/python/blocks/bindings/correctiq_man_python.cc2
5 files changed, 22 insertions, 17 deletions
diff --git a/gr-blocks/lib/correctiq_auto_impl.cc b/gr-blocks/lib/correctiq_auto_impl.cc
index 346106a545..efd97a540e 100644
--- a/gr-blocks/lib/correctiq_auto_impl.cc
+++ b/gr-blocks/lib/correctiq_auto_impl.cc
@@ -20,6 +20,10 @@
namespace gr {
namespace blocks {
+namespace {
+constexpr int default_const_buffer = 8192;
+}
+
correctiq_auto::sptr
correctiq_auto::make(double samp_rate, double freq, float gain, float sync_window)
{
@@ -37,18 +41,14 @@ correctiq_auto_impl::correctiq_auto_impl(double samp_rate,
: gr::sync_block("correctiq_auto",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
- d_avg_real(0.0),
- d_avg_img(0.0),
- d_ratio(1e-05f),
- d_k(d_avg_real, d_avg_img),
d_samp_rate(samp_rate),
d_freq(freq),
d_gain(gain),
d_sync_window(sync_window),
- d_synchronized(false),
- d_max_sync_samples((long)(d_samp_rate * (double)d_sync_window))
+ d_max_sync_samples((long)(d_samp_rate * (double)d_sync_window)),
+ d_volk_const_buffer(default_const_buffer)
{
- set_const_buffer(8192);
+ set_const_buffer(default_const_buffer);
message_port_register_in(pmt::mp("rsync"));
set_msg_handler(pmt::mp("rsync"),
diff --git a/gr-blocks/lib/correctiq_auto_impl.h b/gr-blocks/lib/correctiq_auto_impl.h
index a6cc87f154..4a9f7105e1 100644
--- a/gr-blocks/lib/correctiq_auto_impl.h
+++ b/gr-blocks/lib/correctiq_auto_impl.h
@@ -20,18 +20,18 @@ namespace blocks {
class correctiq_auto_impl : public correctiq_auto
{
private:
- float d_avg_real;
- float d_avg_img;
- float d_ratio;
- gr_complex d_k;
+ float d_avg_real{ 0.0 };
+ float d_avg_img{ 0.0 };
+ float d_ratio{ 1e-05f };
+ gr_complex d_k{ 0, 0 };
const double d_samp_rate;
double d_freq;
float d_gain;
const float d_sync_window;
- long d_sync_counter;
- bool d_synchronized;
+ long d_sync_counter{ 0 };
+ bool d_synchronized{ false };
const long d_max_sync_samples;
diff --git a/gr-blocks/lib/correctiq_man_impl.cc b/gr-blocks/lib/correctiq_man_impl.cc
index 47a6c970a0..1ab4fa703d 100644
--- a/gr-blocks/lib/correctiq_man_impl.cc
+++ b/gr-blocks/lib/correctiq_man_impl.cc
@@ -19,6 +19,10 @@
namespace gr {
namespace blocks {
+namespace {
+constexpr int default_const_buffer = 8192;
+}
+
correctiq_man::sptr correctiq_man::make(float real, float imag)
{
return gnuradio::make_block_sptr<correctiq_man_impl>(real, imag);
@@ -31,9 +35,10 @@ correctiq_man_impl::correctiq_man_impl(float real, float imag)
: gr::sync_block("correctiq_man",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
- d_k(real, imag)
+ d_k(real, imag),
+ d_volk_const_buffer(default_const_buffer)
{
- set_const_buffer(8192);
+ set_const_buffer(default_const_buffer);
message_port_register_in(pmt::mp("set_real"));
set_msg_handler(pmt::mp("set_real"),
diff --git a/gr-blocks/python/blocks/bindings/correctiq_auto_python.cc b/gr-blocks/python/blocks/bindings/correctiq_auto_python.cc
index 668c6c597e..ef0b966e3b 100644
--- a/gr-blocks/python/blocks/bindings/correctiq_auto_python.cc
+++ b/gr-blocks/python/blocks/bindings/correctiq_auto_python.cc
@@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(correctiq_auto.h) */
-/* BINDTOOL_HEADER_FILE_HASH(89cb798d694089e6c41ec905400c2555) */
+/* BINDTOOL_HEADER_FILE_HASH(cf781a54a2ac7c62e333d6d6f6014562) */
/***********************************************************************************/
#include <pybind11/complex.h>
diff --git a/gr-blocks/python/blocks/bindings/correctiq_man_python.cc b/gr-blocks/python/blocks/bindings/correctiq_man_python.cc
index c258afa358..a909368ded 100644
--- a/gr-blocks/python/blocks/bindings/correctiq_man_python.cc
+++ b/gr-blocks/python/blocks/bindings/correctiq_man_python.cc
@@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(correctiq_man.h) */
-/* BINDTOOL_HEADER_FILE_HASH(a2671fc2a0e6c23d0265f059383d03c1) */
+/* BINDTOOL_HEADER_FILE_HASH(5ab734e27fb7142a5c9495bcb1bb7ba3) */
/***********************************************************************************/
#include <pybind11/complex.h>