mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-09 19:53:04 +00:00
Fix member initializations, potential data race conditions, and minor performance issues detected by Coverity Scan
Never throw from main
This commit is contained in:
@@ -450,7 +450,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (setup_filter(filter_source_, bandwidth_, sample_rate_, freq1_, rf_port_select_, ad9361_phy_B, rx_chan1, chn, 0, filter_filename_, Fpass_, Fstop_) == -1)
|
||||
if (setup_filter(filter_source_, bandwidth_, sample_rate_, freq1_, rf_port_select_, ad9361_phy_B, rx_chan1, chn, 0, std::move(filter_filename_), Fpass_, Fstop_) == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -472,7 +472,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
||||
std::cout << rx_stream_dev_a << " channel 1 not found\n";
|
||||
throw std::runtime_error(rx_stream_dev_a + "RX channel 1 not found");
|
||||
}
|
||||
if (setup_filter(filter_source_, bandwidth_, sample_rate_, freq0_, rf_port_select_, ad9361_phy, rx_chan1, chn, 1, filter_filename_, Fpass_, Fstop_) == -1)
|
||||
if (setup_filter(filter_source_, bandwidth_, sample_rate_, freq0_, rf_port_select_, ad9361_phy, rx_chan1, chn, 1, std::move(filter_filename_), Fpass_, Fstop_) == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(bool enable_rx1_band, bool enable_rx2_band)
|
||||
: d_enable_rx1_band(enable_rx1_band), d_enable_rx2_band(enable_rx2_band)
|
||||
{
|
||||
d_map_base_freq_band_1 = nullptr;
|
||||
d_map_base_freq_band_2 = nullptr;
|
||||
d_dev_descr_freq_band_1 = 0;
|
||||
d_dev_descr_freq_band_2 = 0;
|
||||
d_shift_out_bits_freq_band_1 = 0;
|
||||
d_shift_out_bits_freq_band_2 = 0;
|
||||
if (d_enable_rx1_band)
|
||||
{
|
||||
open_device(&d_map_base_freq_band_1, d_dev_descr_freq_band_1, 0);
|
||||
@@ -41,7 +47,7 @@ Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(bool enable_rx1_band, boo
|
||||
{
|
||||
open_device(&d_map_base_freq_band_2, d_dev_descr_freq_band_2, 1);
|
||||
|
||||
// init bit selection corresponding to frequency band 1
|
||||
// init bit selection corresponding to frequency band 2
|
||||
d_shift_out_bits_freq_band_2 = shift_out_bits_default;
|
||||
d_map_base_freq_band_2[0] = d_shift_out_bits_freq_band_2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user