From 54237770a6d81193b8b80acf1da70a514867e505 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 10 Dec 2018 22:59:10 +0100 Subject: [PATCH] Apply fixes by clang-tidy --- .clang-format | 4 ++-- .clang-tidy | 2 +- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 7 ++++--- .../acquisition/libs/fpga_acquisition.cc | 3 ++- .../adapters/ad9361_fpga_signal_source.cc | 2 +- .../adapters/ad9361_fpga_signal_source.h | 2 +- .../adapters/custom_udp_signal_source.cc | 2 +- .../adapters/custom_udp_signal_source.h | 2 +- .../adapters/fmcomms2_signal_source.cc | 2 +- .../adapters/fmcomms2_signal_source.h | 2 +- .../adapters/osmosdr_signal_source.cc | 2 +- .../adapters/osmosdr_signal_source.h | 2 +- .../adapters/plutosdr_signal_source.cc | 2 +- .../adapters/plutosdr_signal_source.h | 2 +- .../gr_complex_ip_packet_source.cc | 13 +++++++------ .../gr_complex_ip_packet_source.h | 8 ++++---- .../signal_source/libs/ad9361_manager.cc | 18 +++++++++--------- .../signal_source/libs/ad9361_manager.h | 18 +++++++++--------- .../signal_source/libs/fpga_switch.cc | 2 +- .../signal_source/libs/fpga_switch.h | 2 +- .../galileo_e1_dll_pll_veml_tracking_fpga.cc | 2 +- .../galileo_e1_dll_pll_veml_tracking_fpga.h | 2 +- .../galileo_e5a_dll_pll_tracking_fpga.cc | 2 +- .../galileo_e5a_dll_pll_tracking_fpga.h | 2 +- .../gps_l1_ca_dll_pll_tracking_fpga.cc | 2 +- .../adapters/gps_l1_ca_dll_pll_tracking_fpga.h | 2 +- .../adapters/gps_l2_m_dll_pll_tracking_fpga.cc | 2 +- .../adapters/gps_l2_m_dll_pll_tracking_fpga.h | 2 +- .../adapters/gps_l5_dll_pll_tracking_fpga.cc | 2 +- .../adapters/gps_l5_dll_pll_tracking_fpga.h | 2 +- .../tracking/libs/fpga_multicorrelator.cc | 3 ++- src/core/libs/gnss_sdr_supl_client.cc | 2 +- src/core/receiver/control_thread.cc | 5 +++-- src/core/receiver/control_thread.h | 2 +- src/core/receiver/gnss_flowgraph.cc | 5 +++-- src/core/receiver/gnss_flowgraph.h | 2 +- src/tests/system-tests/position_test.cc | 2 +- .../observables/hybrid_observables_test.cc | 8 ++++---- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 13 ++++++------- src/utils/rinex2assist/main.cc | 2 +- 40 files changed, 83 insertions(+), 78 deletions(-) diff --git a/.clang-format b/.clang-format index d917fcd0b..7ab3cb079 100644 --- a/.clang-format +++ b/.clang-format @@ -51,9 +51,9 @@ IncludeBlocks: Merge IncludeCategories: - Regex: '^.*.h"' Priority: 1 - - Regex: '^.*(boost|gflags|glog|gtest|gnsssdr|gnuradio|pmt|uhd|volk)/' + - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' Priority: 2 - - Regex: '^.*(armadillo|matio)' + - Regex: '^.*(armadillo|matio|pugixml)' Priority: 2 - Regex: '.*' Priority: 3 diff --git a/.clang-tidy b/.clang-tidy index 5eb3cab9e..79a8beaa6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,readability-named-parameter,readability-string-compare' +Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' HeaderFilterRegex: '.*' diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index df677dea5..ffb4d2452 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -42,6 +42,7 @@ #include "pcps_acquisition_fpga.h" #include #include +#include #define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition @@ -50,7 +51,7 @@ using google::LogMessage; pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) { - return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); + return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(std::move(conf_))); } @@ -61,7 +62,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( // printf("acq constructor start\n"); this->message_port_register_out(pmt::mp("events")); - acq_parameters = conf_; + acq_parameters = std::move(conf_); d_sample_counter = 0ULL; // SAMPLE COUNTER d_active = false; d_state = 0; @@ -256,7 +257,7 @@ void pcps_acquisition_fpga::set_active(bool active) d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - d_test_statistics = (d_mag / d_input_power); //* correction_factor; + d_test_statistics = (d_mag / d_input_power); // correction_factor; } // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index ed0c2c4a9..5618d072b 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -40,6 +40,7 @@ #include // libraries used by the GIPO #include #include // libraries used by the GIPO +#include #define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map @@ -102,7 +103,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name, //printf("AAA- vector_length = %d\n ", vector_length); // initial values - d_device_name = device_name; + d_device_name = std::move(device_name); //d_freq = freq; d_fs_in = fs_in; d_vector_length = vector_length; diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index b40598eeb..a9cade7c5 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -47,7 +47,7 @@ #endif Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 0f1287664..79ebeff3e 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -45,7 +45,7 @@ class Ad9361FpgaSignalSource : public GNSSBlockInterface { public: Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); ~Ad9361FpgaSignalSource(); diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index dcb91aac4..c94859709 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -43,7 +43,7 @@ using google::LogMessage; CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { // DUMP PARAMETERS diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 325f4ab6d..bec7c3d73 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -54,7 +54,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface { public: CustomUDPSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~CustomUDPSignalSource(); diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 789c638a1..8f3f5fa82 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -44,7 +44,7 @@ using google::LogMessage; Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index 2601d155f..820ce1a14 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -46,7 +46,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface { public: Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~Fmcomms2SignalSource(); diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index f68b0636e..1aab48cff 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -44,7 +44,7 @@ using google::LogMessage; OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { // DUMP PARAMETERS diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index 04a60dd50..7a820f8fd 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -52,7 +52,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface { public: OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~OsmosdrSignalSource(); diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index b22756a55..6465b72bd 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -41,7 +41,7 @@ using google::LogMessage; PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 178604257..4cedb3787 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -48,7 +48,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface { public: PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~PlutosdrSignalSource(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index a40a3a9bf..c741dc19a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -32,6 +32,7 @@ #include "gr_complex_ip_packet_source.h" #include +#include const int FIFO_SIZE = 1472000; @@ -76,15 +77,15 @@ typedef struct gr_udp_header gr_complex_ip_packet_source::sptr gr_complex_ip_packet_source::make(std::string src_device, - std::string origin_address, + const std::string& origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string& wire_sample_type, size_t item_size, bool IQ_swap_) { - return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(src_device, + return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(src_device), origin_address, udp_port, udp_packet_size, @@ -99,11 +100,11 @@ gr_complex_ip_packet_source::make(std::string src_device, * The private constructor */ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, - __attribute__((unused)) std::string origin_address, + __attribute__((unused)) const std::string& origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string& wire_sample_type, size_t item_size, bool IQ_swap_) : gr::sync_block("gr_complex_ip_packet_source", @@ -129,7 +130,7 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, exit(0); } std::cout << "d_wire_sample_type:" << d_wire_sample_type << std::endl; - d_src_device = src_device; + d_src_device = std::move(src_device); d_udp_port = udp_port; d_udp_payload_size = udp_packet_size; d_fifo_full = false; diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 345399730..2417534f7 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -84,19 +84,19 @@ private: public: typedef boost::shared_ptr sptr; static sptr make(std::string src_device, - std::string origin_address, + const std::string& origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string& wire_sample_type, size_t item_size, bool IQ_swap_); gr_complex_ip_packet_source(std::string src_device, - std::string origin_address, + const std::string& origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string& wire_sample_type, size_t item_size, bool IQ_swap_); ~gr_complex_ip_packet_source(); diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc index 6de1b0aa9..e4d4b6db0 100644 --- a/src/algorithms/signal_source/libs/ad9361_manager.cc +++ b/src/algorithms/signal_source/libs/ad9361_manager.cc @@ -179,9 +179,9 @@ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, en bool config_ad9361_rx_local(uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_, - std::string rf_port_select_, - std::string gain_mode_rx1_, - std::string gain_mode_rx2_, + const std::string& rf_port_select_, + const std::string& gain_mode_rx1_, + const std::string& gain_mode_rx2_, double rf_gain_rx1_, double rf_gain_rx2_) @@ -291,13 +291,13 @@ bool config_ad9361_rx_local(uint64_t bandwidth_, } -bool config_ad9361_rx_remote(std::string remote_host, +bool config_ad9361_rx_remote(const std::string& remote_host, uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_, - std::string rf_port_select_, - std::string gain_mode_rx1_, - std::string gain_mode_rx2_, + const std::string& rf_port_select_, + const std::string& gain_mode_rx1_, + const std::string& gain_mode_rx2_, double rf_gain_rx1_, double rf_gain_rx2_) { @@ -543,7 +543,7 @@ bool config_ad9361_lo_local(uint64_t bandwidth_, } -bool config_ad9361_lo_remote(std::string remote_host, +bool config_ad9361_lo_remote(const std::string& remote_host, uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_rf_tx_hz_, @@ -680,7 +680,7 @@ bool config_ad9361_lo_remote(std::string remote_host, } -bool ad9361_disable_lo_remote(std::string remote_host) +bool ad9361_disable_lo_remote(const std::string& remote_host) { std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl; struct iio_context *ctx; diff --git a/src/algorithms/signal_source/libs/ad9361_manager.h b/src/algorithms/signal_source/libs/ad9361_manager.h index 875b724c0..ca34f375d 100644 --- a/src/algorithms/signal_source/libs/ad9361_manager.h +++ b/src/algorithms/signal_source/libs/ad9361_manager.h @@ -92,19 +92,19 @@ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, en bool config_ad9361_rx_local(uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_, - std::string rf_port_select_, - std::string gain_mode_rx1_, - std::string gain_mode_rx2_, + const std::string& rf_port_select_, + const std::string& gain_mode_rx1_, + const std::string& gain_mode_rx2_, double rf_gain_rx1_, double rf_gain_rx2_); -bool config_ad9361_rx_remote(std::string remote_host, +bool config_ad9361_rx_remote(const std::string& remote_host, uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_, - std::string rf_port_select_, - std::string gain_mode_rx1_, - std::string gain_mode_rx2_, + const std::string& rf_port_select_, + const std::string& gain_mode_rx1_, + const std::string& gain_mode_rx2_, double rf_gain_rx1_, double rf_gain_rx2_); @@ -115,7 +115,7 @@ bool config_ad9361_lo_local(uint64_t bandwidth_, int64_t freq_dds_tx_hz_, double scale_dds_dbfs_); -bool config_ad9361_lo_remote(std::string remote_host, +bool config_ad9361_lo_remote(const std::string& remote_host, uint64_t bandwidth_, uint64_t sample_rate_, uint64_t freq_rf_tx_hz_, @@ -124,7 +124,7 @@ bool config_ad9361_lo_remote(std::string remote_host, double scale_dds_dbfs_); -bool ad9361_disable_lo_remote(std::string remote_host); +bool ad9361_disable_lo_remote(const std::string& remote_host); bool ad9361_disable_lo_local(); diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index 6a4e39dc4..d387831b1 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -45,7 +45,7 @@ const size_t PAGE_SIZE = 0x10000; const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; -fpga_switch::fpga_switch(std::string device_name) +fpga_switch::fpga_switch(const std::string& device_name) { if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) { diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index f4a755775..ce3dff3ad 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -44,7 +44,7 @@ class fpga_switch { public: - fpga_switch(std::string device_name); + fpga_switch(const std::string& device_name); ~fpga_switch(); void set_switch_position(int switch_position); diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index 355c0af21..31d2cbfff 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -51,7 +51,7 @@ void GalileoE1DllPllVemlTrackingFpga::stop_tracking() } GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h index d996cae0a..794aa22d4 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h @@ -52,7 +52,7 @@ class GalileoE1DllPllVemlTrackingFpga : public TrackingInterface { public: GalileoE1DllPllVemlTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index 0c9526116..cda20226f 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -51,7 +51,7 @@ void GalileoE5aDllPllTrackingFpga::stop_tracking() } GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( - ConfigurationInterface *configuration, std::string role, + ConfigurationInterface *configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //printf("creating the E5A tracking"); diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h index 5edb90727..49c52de5e 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h @@ -52,7 +52,7 @@ class GalileoE5aDllPllTrackingFpga : public TrackingInterface { public: GalileoE5aDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index 2434e82a4..e81e7a905 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -53,7 +53,7 @@ void GpsL1CaDllPllTrackingFpga::stop_tracking() } GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h index 5fcaa5144..5cc38f230 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h @@ -53,7 +53,7 @@ class GpsL1CaDllPllTrackingFpga : public TrackingInterface { public: GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index 8eeeec3bc..ff46fe945 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -52,7 +52,7 @@ void GpsL2MDllPllTrackingFpga::stop_tracking() } GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h index 2cde19cd7..7d36d1e74 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h @@ -52,7 +52,7 @@ class GpsL2MDllPllTrackingFpga : public TrackingInterface { public: GpsL2MDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index 76631abd8..615fad0fb 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -52,7 +52,7 @@ void GpsL5DllPllTrackingFpga::stop_tracking() } GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( - ConfigurationInterface *configuration, std::string role, + ConfigurationInterface *configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //printf("L5 TRK CLASS CREATED\n"); diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h index 2c3f35ef8..087f3730c 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h @@ -50,7 +50,7 @@ class GpsL5DllPllTrackingFpga : public TrackingInterface { public: GpsL5DllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.cc b/src/algorithms/tracking/libs/fpga_multicorrelator.cc index 069e37bfa..add36b0a8 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.cc @@ -62,6 +62,7 @@ // string manipulation #include +#include // constants #include "GPS_L1_CA.h" @@ -160,7 +161,7 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int32_t n_correlators, { //printf("tracking fpga class created\n"); d_n_correlators = n_correlators; - d_device_name = device_name; + d_device_name = std::move(device_name); d_device_base = device_base; d_track_pilot = track_pilot; d_device_descriptor = 0; diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index f09b02a96..46b0b0031 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,8 +32,8 @@ */ #include "gnss_sdr_supl_client.h" -#include #include +#include #include gnss_sdr_supl_client::gnss_sdr_supl_client() diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index a295ba018..a9ab20e54 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -67,6 +67,7 @@ #include #include #include +#include extern concurrent_map global_gps_acq_assist_map; @@ -294,14 +295,14 @@ int ControlThread::run() } -void ControlThread::set_control_queue(gr::msg_queue::sptr control_queue) +void ControlThread::set_control_queue(const gr::msg_queue::sptr& control_queue) { if (flowgraph_->running()) { LOG(WARNING) << "Unable to set control queue while flowgraph is running"; return; } - control_queue_ = control_queue; + control_queue_ = std::move(control_queue); cmd_interface_.set_msg_queue(control_queue_); } diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index f44ee7963..b500e43fa 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -93,7 +93,7 @@ public: * * \param[in] boost::shared_ptr control_queue */ - void set_control_queue(gr::msg_queue::sptr control_queue); + void set_control_queue(const gr::msg_queue::sptr& control_queue); unsigned int processed_control_messages() diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index c10fdc53b..08d47a376 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -50,6 +50,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -61,12 +62,12 @@ using google::LogMessage; -GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue) +GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue) { connected_ = false; running_ = false; configuration_ = configuration; - queue_ = queue; + queue_ = std::move(queue); init(); } diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 71b52dd6f..929243939 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -73,7 +73,7 @@ public: /*! * \brief Constructor that initializes the receiver flow graph */ - GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); + GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue); /*! * \brief Destructor diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 202f31306..b719dba55 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -837,7 +837,7 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); - std::string gnuplot_path = dir.native(); + const std::string& gnuplot_path = dir.native(); Gnuplot::set_GNUPlotPath(gnuplot_path); Gnuplot g1("points"); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 24759c828..feccb8105 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -70,15 +70,15 @@ #include #include #include -#include -#include -#include -#include #include #include #include #include #include +#include +#include +#include +#include #include #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 9839d7201..ffaeffc76 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -58,6 +58,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -69,7 +70,7 @@ #define FIVE_SECONDS 5000000 // five seconds in microseconds void send_tracking_gps_input_samples(FILE *rx_signal_file, - int num_remaining_samples, gr::top_block_sptr top_block) + int num_remaining_samples, const gr::top_block_sptr& top_block) { int num_samples_transferred = 0; // number of samples that have been transferred to the DMA so far static int flowgraph_stopped = 0; // flag to indicate if the flowgraph is stopped already @@ -142,7 +143,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) usleep(FIVE_SECONDS); // wait for some time to give time to the other thread to program the device //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); - send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); + send_tracking_gps_input_samples(rx_signal_file, file_length, std::move(top_block)); fclose(rx_signal_file); } @@ -180,7 +181,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } catch (boost::bad_any_cast &e) @@ -204,8 +205,7 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : g } -GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() -= default; +GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() = default; // ########################################################### @@ -242,8 +242,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CADllPllTrackingTestFpga() - = default; + ~GpsL1CADllPllTrackingTestFpga() = default; void configure_receiver(); diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 6dca86d30..c26b128dc 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -42,10 +42,10 @@ #include #include #include -#include #include #include #include +#include #include