1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-31 07:13:03 +00:00

Fix defects detected by Coverity Scan

This commit is contained in:
Carles Fernandez
2019-03-01 15:29:43 +01:00
parent df0a77ee0d
commit e43b8f5284
15 changed files with 168 additions and 157 deletions

View File

@@ -147,15 +147,10 @@ private:
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_;
bool acquire_pilot_;
uint32_t channel_;
uint32_t doppler_max_;
uint32_t doppler_step_;
uint32_t max_dwells_;
bool dump_;
bool blocking_;
std::string dump_filename_;
Gnss_Synchro* gnss_synchro_;
std::string role_;

View File

@@ -67,7 +67,7 @@ public:
inline size_t item_size() override
{
return item_size_;
return sizeof(int);
}
void connect(gr::top_block_sptr top_block) override;
@@ -150,35 +150,19 @@ private:
pcps_acquisition_fpga_sptr acquisition_fpga_;
gr::blocks::stream_to_vector::sptr stream_to_vector_;
size_t item_size_;
std::string item_type_;
std::string dump_filename_;
std::string role_;
bool bit_transition_flag_;
bool dump_;
bool acq_pilot_;
bool use_CFAR_;
bool blocking_;
bool acq_iq_;
uint32_t vector_length_;
uint32_t code_length_;
uint32_t channel_;
uint32_t doppler_max_;
uint32_t doppler_step_;
uint32_t sampled_ms_;
uint32_t max_dwells_;
unsigned int in_streams_;
unsigned int out_streams_;
int64_t fs_in_;
float threshold_;
gr_complex* code_;
Gnss_Synchro* gnss_synchro_;
lv_16sc_t* d_all_fft_codes_; // memory that contains all the code ffts

View File

@@ -146,7 +146,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
GpsL2MPcpsAcquisitionFpga::~GpsL2MPcpsAcquisitionFpga()
{
//delete[] code_;
delete[] d_all_fft_codes_;
}
@@ -212,9 +211,6 @@ void GpsL2MPcpsAcquisitionFpga::init()
void GpsL2MPcpsAcquisitionFpga::set_local_code()
{
//gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
//acquisition_fpga_->set_local_code(code_);
acquisition_fpga_->set_local_code();
}

View File

@@ -75,7 +75,7 @@ public:
inline size_t item_size() override
{
return item_size_;
return sizeof(int);
}
void connect(gr::top_block_sptr top_block) override;
@@ -149,23 +149,13 @@ private:
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_;
std::string item_type_;
unsigned int vector_length_;
unsigned int code_length_;
bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_;
unsigned int channel_;
float threshold_;
unsigned int doppler_max_;
unsigned int doppler_step_;
unsigned int max_dwells_;
int64_t fs_in_;
//long if_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::complex<float>* code_;
Gnss_Synchro* gnss_synchro_;
std::string role_;
unsigned int in_streams_;

View File

@@ -76,7 +76,7 @@ public:
inline size_t item_size() override
{
return item_size_;
return sizeof(int);
}
void connect(gr::top_block_sptr top_block) override;
@@ -149,22 +149,11 @@ private:
gr::blocks::stream_to_vector::sptr stream_to_vector_;
gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_;
std::string item_type_;
uint32_t vector_length_;
uint32_t code_length_;
bool bit_transition_flag_;
bool use_CFAR_algorithm_flag_;
uint32_t channel_;
float threshold_;
uint32_t doppler_max_;
uint32_t doppler_step_;
uint32_t max_dwells_;
int64_t fs_in_;
bool dump_;
bool blocking_;
std::string dump_filename_;
std::complex<float>* code_;
Gnss_Synchro* gnss_synchro_;
std::string role_;
unsigned int in_streams_;

View File

@@ -62,6 +62,18 @@
#define SELECT_ALL_CODE_BITS 0x000FFFFF // Select a 20 bit word
#define SHL_CODE_BITS 1024 // shift left by 10 bits
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) \
({ \
decltype(exp) _rc; \
do \
{ \
_rc = (exp); \
} \
while (_rc == -1 && errno == EINTR); \
_rc; \
})
#endif
bool Fpga_Acquisition::init()
{