1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-28 05:57:39 +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

@@ -66,6 +66,18 @@
#define LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY 0x0C000000
#define TEST_REGISTER_TRACK_WRITEVAL 0x55AA
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) \
({ \
decltype(exp) _rc; \
do \
{ \
_rc = (exp); \
} \
while (_rc == -1 && errno == EINTR); \
_rc; \
})
#endif
Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
std::string device_name, uint32_t device_base, int32_t *ca_codes, int32_t *data_codes, uint32_t code_length_chips, bool track_pilot,
@@ -95,6 +107,7 @@ Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
}
d_shifts_chips = nullptr;
d_prompt_data_shift = nullptr;
d_Prompt_Data = nullptr;
d_corr_out = nullptr;
d_code_length_chips = 0;
d_rem_code_phase_chips = 0;
@@ -105,7 +118,8 @@ Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
d_phase_step_rad_int = 0;
d_initial_sample_counter = 0;
d_channel = 0;
d_correlator_length_samples = 0,
d_correlator_length_samples = 0;
d_code_phase_step_chips_num = 0;
d_code_length_chips = code_length_chips;
d_ca_codes = ca_codes;
d_data_codes = data_codes;
@@ -119,6 +133,14 @@ Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
Fpga_Multicorrelator_8sc::~Fpga_Multicorrelator_8sc()
{
close_device();
if (d_initial_index != nullptr)
{
volk_gnsssdr_free(d_initial_index);
}
if (d_initial_interp_counter != nullptr)
{
volk_gnsssdr_free(d_initial_interp_counter);
}
}

View File

@@ -98,7 +98,7 @@ private:
float *d_shifts_chips;
float *d_prompt_data_shift;
int32_t d_code_length_chips;
int32_t d_n_correlators;
int32_t d_n_correlators; // number of correlators
// data related to the hardware module and the driver
int32_t d_device_descriptor; // driver descriptor
@@ -106,7 +106,6 @@ private:
// configuration data received from the interface
uint32_t d_channel; // channel number
uint32_t d_ncorrelators; // number of correlators
uint32_t d_correlator_length_samples;
float d_rem_code_phase_chips;
float d_code_phase_step_chips;