1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 22:43:14 +00:00

fixing coverity issues

This commit is contained in:
Carles Fernandez 2015-05-14 11:20:02 +02:00
parent 79192a0bbd
commit 76843781f7
6 changed files with 15 additions and 12 deletions

View File

@ -101,14 +101,14 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
unsigned int _samplesPerCode;
unsigned int delay;
const unsigned int _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS;
unsigned int _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS;
const int _codeFreqBasis = Galileo_E5a_CODE_CHIP_RATE_HZ; //Hz
std::complex<float>* _code = new std::complex<float>[_codeLength];
galileo_e5_a_code_gen_complex_primary(_code , _prn , _Signal);
_samplesPerCode = round(_fs / (_codeFreqBasis / _codeLength));
_samplesPerCode = static_cast<unsigned int>(static_cast<double>(_fs) / ( static_cast<double>(_codeFreqBasis) / static_cast<double>(_codeLength)));
delay = ((_codeLength - _chip_shift) % _codeLength) * _samplesPerCode / _codeLength;
@ -117,8 +117,8 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig
std::complex<float>* _resampled_signal;
if (posix_memalign((void**)&_resampled_signal, 16, _samplesPerCode * sizeof(gr_complex)) == 0){};
resampler(_code, _resampled_signal, _codeFreqBasis, _fs, _codeLength, _samplesPerCode); //resamples code to fs
//delete[] _code;
memcpy (_code, _resampled_signal, _codeLength);
delete[] _code;
_code = _resampled_signal;
}
for (unsigned int i = 0; i < _samplesPerCode; i++)

View File

@ -34,7 +34,7 @@ void volk_gnsssdr_get_config_path(char *path)
path[0] = 0;
return;
}
strcpy(path, home);
strncpy(path, home, 512);
strcat(path, suffix);
}

View File

@ -93,14 +93,14 @@ galileo_e1_observables_cc::~galileo_e1_observables_cc()
bool Galileo_pairCompare_gnss_synchro_Prn_delay_ms( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool Galileo_pairCompare_gnss_synchro_Prn_delay_ms(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.Prn_timestamp_ms) < (b.second.Prn_timestamp_ms);
}
bool Galileo_pairCompare_gnss_synchro_d_TOW_at_current_symbol( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool Galileo_pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.d_TOW_at_current_symbol) < (b.second.d_TOW_at_current_symbol);
}

View File

@ -90,13 +90,13 @@ gps_l1_ca_observables_cc::~gps_l1_ca_observables_cc()
}
bool pairCompare_gnss_synchro_Prn_delay_ms( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool pairCompare_gnss_synchro_Prn_delay_ms(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.Prn_timestamp_ms) < (b.second.Prn_timestamp_ms);
}
bool pairCompare_gnss_synchro_d_TOW_at_current_symbol( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.d_TOW_at_current_symbol) < (b.second.d_TOW_at_current_symbol);
}

View File

@ -93,18 +93,18 @@ hybrid_observables_cc::~hybrid_observables_cc()
bool Hybrid_pairCompare_gnss_synchro_Prn_delay_ms( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool Hybrid_pairCompare_gnss_synchro_Prn_delay_ms(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.Prn_timestamp_ms) < (b.second.Prn_timestamp_ms);
}
bool Hybrid_pairCompare_gnss_synchro_d_TOW_hybrid_at_current_symbol( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool Hybrid_pairCompare_gnss_synchro_d_TOW_hybrid_at_current_symbol(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.d_TOW_hybrid_at_current_symbol) < (b.second.d_TOW_hybrid_at_current_symbol);
}
bool Hybrid_pairCompare_gnss_synchro_d_TOW_at_current_symbol( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
bool Hybrid_pairCompare_gnss_synchro_d_TOW_at_current_symbol(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.d_TOW_at_current_symbol) < (b.second.d_TOW_at_current_symbol);
}

View File

@ -100,6 +100,9 @@ public:
Sbas_Time()
{
e_state = UNDEFINED;
i_gps_week = 0;
d_gps_sec = 0;
d_time_stamp_sec = 0;
}
Sbas_Time(double time_stamp_sec)