1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

clang-tidy: apply performance-type-promotion-in-math-fn check

This commit is contained in:
Carles Fernandez 2019-02-21 12:46:01 +01:00
parent 5d427df585
commit a734411b86
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 10 additions and 19 deletions

View File

@ -321,8 +321,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
float acq_trk_shif_correction_samples; float acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
current_synchro_data.fs = d_fs_in; current_synchro_data.fs = d_fs_in;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;

View File

@ -574,7 +574,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double acq_trk_shif_correction_samples; double acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples

View File

@ -574,7 +574,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
double acq_trk_shif_correction_samples; double acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples)); acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples d_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); // count for the processed samples

View File

@ -204,7 +204,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in); T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in);
d_next_prn_length_samples = round(T_prn_mod_samples); d_next_prn_length_samples = std::round(T_prn_mod_samples);
float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in); float T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in);
@ -213,7 +213,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
float N_prn_diff; float N_prn_diff;
N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
float corrected_acq_phase_samples, delay_correction_samples; float corrected_acq_phase_samples, delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples); corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0) if (corrected_acq_phase_samples < 0)
{ {
corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples;
@ -357,8 +357,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
float acq_trk_shif_correction_samples; float acq_trk_shif_correction_samples;
int32_t acq_to_trk_delay_samples; int32_t acq_to_trk_delay_samples;
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples)); acq_trk_shif_correction_samples = d_next_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_next_prn_length_samples));
samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast<uint64_t>(samples_offset);
current_synchro_data.fs = d_fs_in; current_synchro_data.fs = d_fs_in;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;

View File

@ -64,7 +64,7 @@ double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double
*/ */
double pll_four_quadrant_atan(gr_complex prompt_s1) double pll_four_quadrant_atan(gr_complex prompt_s1)
{ {
return atan2(prompt_s1.imag(), prompt_s1.real()); return static_cast<double>(std::atan2(prompt_s1.imag(), prompt_s1.real()));
} }
@ -79,7 +79,7 @@ double pll_cloop_two_quadrant_atan(gr_complex prompt_s1)
{ {
if (prompt_s1.real() != 0.0) if (prompt_s1.real() != 0.0)
{ {
return atan(prompt_s1.imag() / prompt_s1.real()); return static_cast<double>(std::atan(prompt_s1.imag() / prompt_s1.real()));
} }
return 0.0; return 0.0;
} }

View File

@ -86,15 +86,6 @@ if(Boost_FOUND)
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
endif() endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(rinex2assist
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_custom_command(TARGET rinex2assist POST_BUILD add_custom_command(TARGET rinex2assist POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist> COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist> ${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>