From 33cee4a759a8e37b9c2ffa6566310476ee2941de Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 10 Jul 2020 13:35:15 +0200 Subject: [PATCH] Remove all warnings raised by bugprone-* clang-tidy checks in acquisition adapters --- .../adapters/beidou_b1i_pcps_acquisition.cc | 2 +- .../adapters/beidou_b3i_pcps_acquisition.cc | 2 +- .../galileo_e1_pcps_8ms_ambiguous_acquisition.cc | 2 +- .../adapters/galileo_e1_pcps_ambiguous_acquisition.cc | 2 +- .../galileo_e1_pcps_ambiguous_acquisition_fpga.cc | 2 +- .../galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 2 +- .../galileo_e1_pcps_quicksync_ambiguous_acquisition.cc | 2 +- .../galileo_e1_pcps_tong_ambiguous_acquisition.cc | 2 +- .../galileo_e5a_noncoherent_iq_acquisition_caf.cc | 6 +++--- .../galileo_e5a_noncoherent_iq_acquisition_caf.h | 2 +- .../adapters/galileo_e5a_pcps_acquisition.cc | 2 +- .../adapters/galileo_e5a_pcps_acquisition_fpga.cc | 2 +- .../adapters/glonass_l1_ca_pcps_acquisition.cc | 2 +- .../adapters/glonass_l2_ca_pcps_acquisition.cc | 2 +- .../acquisition/adapters/gps_l1_ca_pcps_acquisition.cc | 2 +- .../gps_l1_ca_pcps_acquisition_fine_doppler.cc | 6 +++--- .../adapters/gps_l1_ca_pcps_acquisition_fpga.cc | 2 +- .../adapters/gps_l1_ca_pcps_assisted_acquisition.cc | 2 +- .../adapters/gps_l1_ca_pcps_opencl_acquisition.cc | 2 +- .../adapters/gps_l1_ca_pcps_quicksync_acquisition.cc | 2 +- .../adapters/gps_l1_ca_pcps_tong_acquisition.cc | 2 +- .../acquisition/adapters/gps_l2_m_pcps_acquisition.cc | 2 +- .../acquisition/adapters/gps_l5i_pcps_acquisition.cc | 2 +- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 2 +- .../galileo_e5a_noncoherent_iq_acquisition_caf_cc.h | 10 +++++----- src/algorithms/acquisition/libs/fpga_acquisition.cc | 4 ++-- src/core/receiver/gnss_flowgraph.cc | 2 +- 27 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index de23d88b9..bdcd27046 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -57,7 +57,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); fs_in_ = acq_parameters_.fs_in; item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc index 03f8919ea..d58ee393e 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc @@ -55,7 +55,7 @@ BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index f203abeb2..db64808f0 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -239,7 +239,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::reset() float GalileoE1Pcps8msAmbiguousAcquisition::calculate_threshold(float pfa) { unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 5abfc1b76..312523679 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -55,7 +55,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index a234be35c..b178dace1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -74,7 +74,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f(static_cast(code_length) * 2.0)); + float nbits = ceilf(log2f(static_cast(code_length) * 2.0F)); uint32_t nsamples_total = pow(2, nbits); uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 0); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 5ec7bee3e..972ee7e5b 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -219,7 +219,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state) float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa) { - if (pfa) + if (pfa > 0.0) { /* Not implemented*/ }; return 0.0; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index a83903ad0..ccb0cb46e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -283,7 +283,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state) float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) { unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 0132abcb1..5b10ce29f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -249,7 +249,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_state(int state) float GalileoE1PcpsTongAmbiguousAcquisition::calculate_threshold(float pfa) { unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index 679896849..0a548b9aa 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -86,7 +86,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); // -- Find number of samples per spreading code (1ms)------------------------- - code_length_ = static_cast(round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -198,7 +198,7 @@ signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() { if (item_type_ == "gr_complex") { - return acquisition_cc_->mag(); + return static_cast(acquisition_cc_->mag()); } return 0; } @@ -276,7 +276,7 @@ float GalileoE5aNoncoherentIQAcquisitionCaf::calculate_threshold(float pfa) { // Calculate the threshold unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 2b6e6a6f0..4751c236d 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -160,8 +160,8 @@ private: float threshold_; int Zero_padding; int CAF_window_hz_; + int code_length_; unsigned int vector_length_; - unsigned int code_length_; unsigned int channel_; unsigned int doppler_max_; unsigned int doppler_step_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 67c07e068..58baa27fd 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -53,7 +53,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 195f90d75..3d015966f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -76,7 +76,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga( acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f(static_cast(code_length) * 2.0)); + float nbits = ceilf(log2f(static_cast(code_length) * 2.0F)); uint32_t nsamples_total = pow(2, nbits); uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 1); acq_parameters.select_queue_Fpga = select_queue_Fpga; diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 604c76e8b..59c34fcfd 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -55,7 +55,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 9e3bee695..94cdd75b4 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -54,7 +54,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index a866dc44f..9cede0d54 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -58,7 +58,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 210b85522..622e62db4 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -68,7 +68,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( // -- Find number of samples per spreading code ------------------------- vector_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); - acq_parameters.samples_per_ms = vector_length_; + acq_parameters.samples_per_ms = static_cast(vector_length_); code_ = std::vector>(vector_length_); if (item_type_ == "gr_complex") @@ -114,7 +114,7 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_threshold(float threshold) void GpsL1CaPcpsAcquisitionFineDoppler::set_doppler_max(unsigned int doppler_max) { - doppler_max_ = doppler_max; + doppler_max_ = static_cast(doppler_max); acquisition_cc_->set_doppler_max(doppler_max_); } @@ -135,7 +135,7 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_gnss_synchro(Gnss_Synchro* gnss_sync signed int GpsL1CaPcpsAcquisitionFineDoppler::mag() { - return acquisition_cc_->mag(); + return static_cast(acquisition_cc_->mag()); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 5325f3f35..42be4cfd3 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -68,7 +68,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f(static_cast(code_length) * 2.0)); + float nbits = ceilf(log2f(static_cast(code_length) * 2.0F)); uint32_t nsamples_total = pow(2, nbits); uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 0); acq_parameters.select_queue_Fpga = select_queue_Fpga; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index 9151d765d..dc0bb7f48 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -106,7 +106,7 @@ void GpsL1CaPcpsAssistedAcquisition::set_threshold(float threshold) void GpsL1CaPcpsAssistedAcquisition::set_doppler_max(unsigned int doppler_max) { - doppler_max_ = doppler_max; + doppler_max_ = static_cast(doppler_max); acquisition_cc_->set_doppler_max(doppler_max_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 9a66ba5a5..ad6c3f287 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -231,7 +231,7 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) { // Calculate the threshold unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 65713e24c..c123cd29b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -266,7 +266,7 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) { // Calculate the threshold unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 8cb522e9c..88e637d8b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -228,7 +228,7 @@ float GpsL1CaPcpsTongAcquisition::calculate_threshold(float pfa) { // Calculate the threshold unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += doppler_step_) + for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); doppler += static_cast(doppler_step_)) { frequency_bins++; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index bde01e504..0b8f27d06 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -55,7 +55,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( acq_parameters_.doppler_max = FLAGS_doppler_max; } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; fs_in_ = acq_parameters_.fs_in; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 03504b7e9..bbb46df25 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -55,7 +55,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( } doppler_max_ = acq_parameters_.doppler_max; - doppler_step_ = acq_parameters_.doppler_step; + doppler_step_ = static_cast(acq_parameters_.doppler_step); item_type_ = acq_parameters_.item_type; item_size_ = acq_parameters_.it_size; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index a62d8577e..997a21904 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -72,7 +72,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L5I_CODE_RATE_CPS / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f(static_cast(code_length) * 2.0)); + float nbits = ceilf(log2f(static_cast(code_length) * 2.0F)); uint32_t nsamples_total = pow(2, nbits); uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 1); acq_parameters.select_queue_Fpga = select_queue_Fpga; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index 2c6d6ea5f..04dc532ce 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -241,19 +241,19 @@ private: int d_state; int d_samples_per_ms; - unsigned int d_sampled_ms; int d_samples_per_code; int d_CAF_window_hz; - unsigned int d_channel; int d_buffer_count; - unsigned int d_gr_stream_buffer; int d_doppler_resolution; int d_doppler_max; int d_doppler_step; - unsigned int d_max_dwells; - unsigned int d_well_count; int d_fft_size; int d_num_doppler_bins; + unsigned int d_gr_stream_buffer; + unsigned int d_channel; + unsigned int d_max_dwells; + unsigned int d_well_count; + unsigned int d_sampled_ms; unsigned int d_code_phase; bool d_bit_transition_flag; diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index 2c95de39a..a2a98a122 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -179,12 +179,12 @@ void Fpga_Acquisition::set_doppler_sweep(uint32_t num_sweeps, uint32_t doppler_s // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing // The FPGA expects phase_step_rad between -1 (-pi) to +1 (+pi) - phase_step_rad_real = 2.0 * (doppler_min) / static_cast(d_fs_in); + phase_step_rad_real = 2.0F * (doppler_min) / static_cast(d_fs_in); phase_step_rad_int = static_cast(phase_step_rad_real * (POW_2_31)); d_map_base[3] = phase_step_rad_int; // repeat the calculation with the doppler step - phase_step_rad_real = 2.0 * (doppler_step) / static_cast(d_fs_in); + phase_step_rad_real = 2.0F * (doppler_step) / static_cast(d_fs_in); phase_step_rad_int = static_cast(phase_step_rad_real * (POW_2_31)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings d_map_base[4] = phase_step_rad_int; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index c219ec623..64ac0cebb 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1466,7 +1466,7 @@ void GNSSFlowgraph::perform_hw_reset() // a stop acquisition command causes the SW to reset the HW std::shared_ptr channel_ptr; - for (uint32_t i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { channel_ptr = std::dynamic_pointer_cast(channels_.at(i)); channel_ptr->tracking()->stop_tracking();