diff --git a/docs/changelog b/docs/changelog index bfbef5b11..63ce184bb 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,7 +3,8 @@ ### Improvements in Maintainability: - New CMake option ENABLE_ARMA_NO_DEBUG defines the macro ARMA_NO_DEBUG, which disables all run-time checks, such as bounds checking, in the Armadillo library. This will result in faster code. This option is disabled by default during development, but automatically set to ON if the option ENABLE_PACKAGING is set to ON. -- Apply more clang-tidy checks related to readability: readability-avoid-const-params-in-decls, readability-isolate-declaration, readability-redundant-control-flow, readability-uppercase-literal-suffix. +- Apply more clang-tidy checks related to readability: readability-avoid-const-params-in-decls, readability-isolate-declaration, readability-redundant-control-flow, readability-uppercase-literal-suffix. Fixed raised warnings. +- Fixed cpplint.py build/include_what_you_use, whitespace/tab, whitespace/blank_line errors. - Add more check options to .clang-tidy file. @@ -15,8 +16,14 @@ ### Improvements in Reliability: - Decoding of navigation messages no longer rely on implementation defined behavior for shifting left a signed integer. -- Removed usage of functions with insecure API (e.g., strcpy) -- Added clang-tidy checks clang-analyzer-security.* +- Removed usage of functions with insecure API (e.g., strcpy). +- Added clang-tidy checks clang-analyzer-security.*, clang-analyzer-optin.portability.UnixAPI clang-tidy checks. Fixed raised warnings. + + +### Improvements in Usability: + +- Improved DLL-PLL binary dump MATLAB/Octave plot script. Old versions removed. +- Simplified RTKLIB error log. diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 566a478cd..a93b63a1e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -1940,10 +1940,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } // debug code - // else - // { - // DLOG(INFO) << "Internal PVT solver error"; - // } + // else + // { + // DLOG(INFO) << "Internal PVT solver error"; + // } // compute on the fly PVT solution if (flag_compute_pvt_output == true) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index a4af53b69..4065679e5 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -39,7 +39,6 @@ #include <exception> // for exception #include <iostream> // for cout, cerr #include <sstream> -#include <string> #include <sys/stat.h> // for S_IXUSR | S_IRWXG | S_IRWXO #include <sys/types.h> // for mode_t diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index d093e20ea..b88491da4 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -35,7 +35,7 @@ #include <fstream> // for ofstream #include <memory> // for shared_ptr - +#include <string> class Rtklib_Solver; diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h index f62c04813..14639c43a 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -35,6 +35,9 @@ #include "monitor_pvt.h" #include "serdes_monitor_pvt.h" #include <boost/asio.hpp> +#include <memory> +#include <string> +#include <vector> #if BOOST_GREATER_1_65 using b_io_context = boost::asio::io_context; diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 13df7ba7f..6dd045389 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -43,6 +43,7 @@ #include <fcntl.h> #include <iostream> // for cout, cerr #include <termios.h> +#include <utility> #if HAS_STD_FILESYSTEM #include <system_error> diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index 465cc1902..b76c47514 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -38,6 +38,7 @@ #include <fstream> // for std::ofstream #include <map> // for std::map #include <memory> // std::shared_ptr +#include <string> class Galileo_Ephemeris; class Glonass_Gnav_Ephemeris; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index a58998a7c..3367d38a9 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -926,7 +926,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ if (result == 0) { LOG(INFO) << "RTKLIB rtkpos error: " << rtk_.errbuf; - rtk_.neb = 0; //clear error buffer to avoid repeating the error message + rtk_.neb = 0; // clear error buffer to avoid repeating the error message this->set_time_offset_s(0.0); // reset rx time estimation this->set_num_valid_observations(0); } diff --git a/src/algorithms/PVT/libs/serdes_monitor_pvt.h b/src/algorithms/PVT/libs/serdes_monitor_pvt.h index 1477442df..07d643b9e 100644 --- a/src/algorithms/PVT/libs/serdes_monitor_pvt.h +++ b/src/algorithms/PVT/libs/serdes_monitor_pvt.h @@ -35,6 +35,8 @@ #include "monitor_pvt.h" #include "monitor_pvt.pb.h" // file created by Protocol Buffers at compile time #include <memory> +#include <string> +#include <utility> /*! * \brief This class implements serialization and deserialization of diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index a5ec7dbc9..c1dfef3f0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -62,6 +62,7 @@ #include <fstream> #include <iostream> #include <sstream> +#include <utility> pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index d00ca72bf..b86eb040b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -61,6 +61,7 @@ #include "opencl/cl.hpp" #include <cstdint> #include <fstream> +#include <memory> // for weak_ptr #include <string> #include <vector> diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index 275f96215..7a414ed62 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -60,6 +60,7 @@ #include <cassert> #include <fstream> #include <functional> +#include <memory> // for weak_ptr #include <string> #include <utility> #include <vector> diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index 82374cd0b..32734729e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -57,6 +57,7 @@ #include <gnuradio/fft/fft.h> #include <gnuradio/gr_complex.h> #include <fstream> +#include <memory> // for weak_ptr #include <string> #include <utility> #include <vector> diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc index fecde02c2..1d79d33d6 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc @@ -32,6 +32,7 @@ #include "interleaved_byte_to_complex_byte.h" #include <gnuradio/io_signature.h> #include <volk/volk.h> +#include <algorithm> // for max interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte() diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc index 0451a136f..b6a1127e7 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc @@ -32,6 +32,7 @@ #include "interleaved_byte_to_complex_short.h" #include <gnuradio/io_signature.h> #include <volk/volk.h> +#include <algorithm> // for max interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short() diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc index 92e3003d8..ee338c42c 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc @@ -32,6 +32,7 @@ #include "interleaved_short_to_complex_short.h" #include <gnuradio/io_signature.h> #include <volk/volk.h> +#include <algorithm> // for max interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short() diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index 5da011608..cf1091a33 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -34,7 +34,7 @@ #include "notch_lite_cc.h" #include <boost/lexical_cast.hpp> #include <glog/logging.h> -#include <cmath> +#include <algorithm> // for max NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, const std::string& role, diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 6a4e3b952..89ad751c9 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -32,7 +32,7 @@ #include <boost/math/distributions/chi_squared.hpp> #include <gnuradio/io_signature.h> #include <volk/volk.h> -#include <cmath> +#include <algorithm> #include <cstring> diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index 678b0dabc..5a92bc5e8 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -32,7 +32,7 @@ #include <boost/math/distributions/chi_squared.hpp> #include <gnuradio/io_signature.h> #include <volk/volk.h> -#include <cmath> +#include <algorithm> #include <cstring> diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index 31a766ca9..d12ea1723 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -32,7 +32,7 @@ #include <boost/math/distributions/chi_squared.hpp> #include <gnuradio/io_signature.h> #include <volk/volk.h> -#include <cmath> +#include <algorithm> pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index e13cce98b..250cfa79c 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -35,6 +35,7 @@ #include "gnss_signal_processing.h" #include <memory> #include <string> +#include <utility> #include <vector> diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 6553a5a3b..f58880eb6 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -36,6 +36,7 @@ #include "gnss_signal_processing.h" #include <gnuradio/gr_complex.h> #include <memory> +#include <utility> void galileo_e5_a_code_gen_complex_primary(gsl::span<std::complex<float>> _dest, int32_t _prn, const std::array<char, 3>& _Signal) diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index 31493c847..d5a62f003 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -516,18 +516,18 @@ void cart2utm(const arma::vec &r_eb_e, int zone, arma::vec &r_enu) // Erster Band, Springer Verlag // // Explanation of variables used: - // f flattening of ellipsoid - // a semi major axis in m - // m0 1 - scale at central meridian; for UTM 0.0004 - // Q_n normalized meridian quadrant - // E0 Easting of central meridian - // L0 Longitude of central meridian - // bg constants for ellipsoidal geogr. to spherical geogr. - // gb constants for spherical geogr. to ellipsoidal geogr. - // gtu constants for ellipsoidal N, E to spherical N, E - // utg constants for spherical N, E to ellipoidal N, E - // tolutm tolerance for utm, 1.2E-10*meridian quadrant - // tolgeo tolerance for geographical, 0.00040 second of arc + // r flattening of ellipsoid + // a semi major axis in m + // m0 1 - scale at central meridian; for UTM 0.0004 + // Q_n normalized meridian quadrant + // E0 Easting of central meridian + // L0 Longitude of central meridian + // bg constants for ellipsoidal geogr. to spherical geogr. + // gb constants for spherical geogr. to ellipsoidal geogr. + // gtu constants for ellipsoidal N, E to spherical N, E + // utg constants for spherical N, E to ellipoidal N, E + // tolutm tolerance for utm, 1.2E-10*meridian quadrant + // tolgeo tolerance for geographical, 0.00040 second of arc // // B, L refer to latitude and longitude. Southern latitude is negative // International ellipsoid of 1924, valid for ED50 diff --git a/src/algorithms/libs/opencl/clFFT.h b/src/algorithms/libs/opencl/clFFT.h index 348505312..0498dab87 100644 --- a/src/algorithms/libs/opencl/clFFT.h +++ b/src/algorithms/libs/opencl/clFFT.h @@ -68,7 +68,6 @@ extern "C" { clFFT_Forward = -1, clFFT_Inverse = 1 - } clFFT_Direction; // XForm dimension @@ -77,7 +76,6 @@ extern "C" clFFT_1D = 0, clFFT_2D = 1, clFFT_3D = 3 - } clFFT_Dimension; // XForm Data type diff --git a/src/algorithms/libs/opencl/fft_base_kernels.h b/src/algorithms/libs/opencl/fft_base_kernels.h index 42c7d5816..c467c24a8 100644 --- a/src/algorithms/libs/opencl/fft_base_kernels.h +++ b/src/algorithms/libs/opencl/fft_base_kernels.h @@ -112,38 +112,38 @@ static string baseKernels = string( "\n" "#define fftKernel8(a,dir) \\\n" "{ \\\n" - " const float2 w1 = (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" - " const float2 w3 = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" - " float2 c; \\\n" - " fftKernel2S((a)[0], (a)[4], dir); \\\n" - " fftKernel2S((a)[1], (a)[5], dir); \\\n" - " fftKernel2S((a)[2], (a)[6], dir); \\\n" - " fftKernel2S((a)[3], (a)[7], dir); \\\n" - " (a)[5] = complexMul(w1, (a)[5]); \\\n" - " (a)[6] = (float2)(dir)*(conjTransp((a)[6])); \\\n" - " (a)[7] = complexMul(w3, (a)[7]); \\\n" - " fftKernel2S((a)[0], (a)[2], dir); \\\n" - " fftKernel2S((a)[1], (a)[3], dir); \\\n" - " fftKernel2S((a)[4], (a)[6], dir); \\\n" - " fftKernel2S((a)[5], (a)[7], dir); \\\n" - " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" - " (a)[7] = (float2)(dir)*(conjTransp((a)[7])); \\\n" - " fftKernel2S((a)[0], (a)[1], dir); \\\n" - " fftKernel2S((a)[2], (a)[3], dir); \\\n" - " fftKernel2S((a)[4], (a)[5], dir); \\\n" - " fftKernel2S((a)[6], (a)[7], dir); \\\n" - " bitreverse8((a)); \\\n" + " const float2 w1 = (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" + " const float2 w3 = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n" + " float2 c; \\\n" + " fftKernel2S((a)[0], (a)[4], dir); \\\n" + " fftKernel2S((a)[1], (a)[5], dir); \\\n" + " fftKernel2S((a)[2], (a)[6], dir); \\\n" + " fftKernel2S((a)[3], (a)[7], dir); \\\n" + " (a)[5] = complexMul(w1, (a)[5]); \\\n" + " (a)[6] = (float2)(dir)*(conjTransp((a)[6])); \\\n" + " (a)[7] = complexMul(w3, (a)[7]); \\\n" + " fftKernel2S((a)[0], (a)[2], dir); \\\n" + " fftKernel2S((a)[1], (a)[3], dir); \\\n" + " fftKernel2S((a)[4], (a)[6], dir); \\\n" + " fftKernel2S((a)[5], (a)[7], dir); \\\n" + " (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" + " (a)[7] = (float2)(dir)*(conjTransp((a)[7])); \\\n" + " fftKernel2S((a)[0], (a)[1], dir); \\\n" + " fftKernel2S((a)[2], (a)[3], dir); \\\n" + " fftKernel2S((a)[4], (a)[5], dir); \\\n" + " fftKernel2S((a)[6], (a)[7], dir); \\\n" + " bitreverse8((a)); \\\n" "}\n" "\n" "#define bitreverse4x4(a) \\\n" "{ \\\n" - " float2 c; \\\n" - " c = (a)[1]; (a)[1] = (a)[4]; (a)[4] = c; \\\n" - " c = (a)[2]; (a)[2] = (a)[8]; (a)[8] = c; \\\n" - " c = (a)[3]; (a)[3] = (a)[12]; (a)[12] = c; \\\n" - " c = (a)[6]; (a)[6] = (a)[9]; (a)[9] = c; \\\n" - " c = (a)[7]; (a)[7] = (a)[13]; (a)[13] = c; \\\n" - " c = (a)[11]; (a)[11] = (a)[14]; (a)[14] = c; \\\n" + " float2 c; \\\n" + " c = (a)[1]; (a)[1] = (a)[4]; (a)[4] = c; \\\n" + " c = (a)[2]; (a)[2] = (a)[8]; (a)[8] = c; \\\n" + " c = (a)[3]; (a)[3] = (a)[12]; (a)[12] = c; \\\n" + " c = (a)[6]; (a)[6] = (a)[9]; (a)[9] = c; \\\n" + " c = (a)[7]; (a)[7] = (a)[13]; (a)[13] = c; \\\n" + " c = (a)[11]; (a)[11] = (a)[14]; (a)[14] = c; \\\n" "}\n" "\n" "#define fftKernel16(a,dir) \\\n" @@ -227,21 +227,21 @@ static string twistKernelInterleaved = string( " float2 a, w; \\\n" " float ang; \\\n" " unsigned int j; \\\n" - " unsigned int i = get_global_id(0); \\\n" - " unsigned int startIndex = i; \\\n" - " \\\n" - " if(i < numCols) \\\n" - " { \\\n" - " for(j = 0; j < numRowsToProcess; j++) \\\n" - " { \\\n" - " a = in[startIndex]; \\\n" - " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" - " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" - " a = complexMul(a, w); \\\n" - " in[startIndex] = a; \\\n" - " startIndex += numCols; \\\n" - " } \\\n" - " } \\\n" + " unsigned int i = get_global_id(0); \\\n" + " unsigned int startIndex = i; \\\n" + " \\\n" + " if(i < numCols) \\\n" + " { \\\n" + " for(j = 0; j < numRowsToProcess; j++) \\\n" + " { \\\n" + " a = in[startIndex]; \\\n" + " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" + " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" + " a = complexMul(a, w); \\\n" + " in[startIndex] = a; \\\n" + " startIndex += numCols; \\\n" + " } \\\n" + " } \\\n" "} \\\n"); static string twistKernelPlannar = string( @@ -251,22 +251,22 @@ static string twistKernelPlannar = string( " float2 a, w; \\\n" " float ang; \\\n" " unsigned int j; \\\n" - " unsigned int i = get_global_id(0); \\\n" - " unsigned int startIndex = i; \\\n" - " \\\n" - " if(i < numCols) \\\n" - " { \\\n" - " for(j = 0; j < numRowsToProcess; j++) \\\n" - " { \\\n" - " a = (float2)(in_real[startIndex], in_imag[startIndex]); \\\n" - " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" - " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" - " a = complexMul(a, w); \\\n" - " in_real[startIndex] = a.x; \\\n" - " in_imag[startIndex] = a.y; \\\n" - " startIndex += numCols; \\\n" - " } \\\n" - " } \\\n" + " unsigned int i = get_global_id(0); \\\n" + " unsigned int startIndex = i; \\\n" + " \\\n" + " if(i < numCols) \\\n" + " { \\\n" + " for(j = 0; j < numRowsToProcess; j++) \\\n" + " { \\\n" + " a = (float2)(in_real[startIndex], in_imag[startIndex]); \\\n" + " ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n" + " w = (float2)(native_cos(ang), native_sin(ang)); \\\n" + " a = complexMul(a, w); \\\n" + " in_real[startIndex] = a.x; \\\n" + " in_imag[startIndex] = a.y; \\\n" + " startIndex += numCols; \\\n" + " } \\\n" + " } \\\n" "} \\\n"); diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 1f89f5831..f26bbd8dd 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -77,7 +77,7 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro } auto CN0_dB_Hz = static_cast<unsigned char>(std::round(CN0_dB_Hz_est / 0.25)); rtklib_obs.SNR[band] = CN0_dB_Hz; - //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris + // Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris switch (gnss_synchro.System) { case 'G': @@ -107,22 +107,21 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro rtklib_obs.sat = gnss_synchro.PRN; } - // Mote that BeiDou week numbers do not need adjustment for foreseeable future. Consider change + // Note that BeiDou week numbers do not need adjustment for foreseeable future. Consider change // to more elegant solution // if(gnss_synchro.System == 'C') - // { - // rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time)); - // } + // { + // rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time)); + // } // else - // { - // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); - // } + // { + // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); + // } // rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); - //account for the TOW crossover transitory in the first 18 seconds where the week is not yet updated! + // account for the TOW crossover transitory in the first 18 seconds where the week is not yet updated! if (gnss_synchro.RX_time < 18.0) { - //p_time += boost::posix_time::seconds(604800); rtklib_obs.time = timeadd(rtklib_obs.time, 604800); } @@ -130,6 +129,7 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro return rtklib_obs; } + geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model) { double week; @@ -174,7 +174,7 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) { eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0}; - //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris + // Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris rtklib_sat.sat = gal_eph.i_satellite_PRN + NSATGPS + NSATGLO; rtklib_sat.A = gal_eph.A_1 * gal_eph.A_1; rtklib_sat.M0 = gal_eph.M0_1; @@ -185,8 +185,8 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) rtklib_sat.i0 = gal_eph.i_0_2; rtklib_sat.idot = gal_eph.iDot_2; rtklib_sat.e = gal_eph.e_1; - rtklib_sat.Adot = 0; //only in CNAV; - rtklib_sat.ndot = 0; //only in CNAV; + rtklib_sat.Adot = 0; // only in CNAV; + rtklib_sat.ndot = 0; // only in CNAV; rtklib_sat.week = adjgpsweek(gal_eph.WN_5); /* week of tow */ rtklib_sat.cic = gal_eph.C_ic_4; @@ -243,8 +243,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) rtklib_sat.i0 = gps_eph.d_i_0; rtklib_sat.idot = gps_eph.d_IDOT; rtklib_sat.e = gps_eph.d_e_eccentricity; - rtklib_sat.Adot = 0; //only in CNAV; - rtklib_sat.ndot = 0; //only in CNAV; + rtklib_sat.Adot = 0; // only in CNAV; + rtklib_sat.ndot = 0; // only in CNAV; rtklib_sat.week = adjgpsweek(gps_eph.i_GPS_week); /* week of tow */ rtklib_sat.cic = gps_eph.d_Cic; @@ -301,14 +301,14 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph) rtklib_sat.i0 = bei_eph.d_i_0; rtklib_sat.idot = bei_eph.d_IDOT; rtklib_sat.e = bei_eph.d_eccentricity; - rtklib_sat.Adot = 0; //only in CNAV; - rtklib_sat.ndot = 0; //only in CNAV; + rtklib_sat.Adot = 0; // only in CNAV; + rtklib_sat.ndot = 0; // only in CNAV; rtklib_sat.svh = bei_eph.i_SV_health; rtklib_sat.sva = bei_eph.i_SV_accuracy; - rtklib_sat.code = bei_eph.i_sig_type; /*B1I data*/ - rtklib_sat.flag = bei_eph.i_nav_type; /*MEO/IGSO satellite*/ + rtklib_sat.code = bei_eph.i_sig_type; /* B1I data */ + rtklib_sat.flag = bei_eph.i_nav_type; /* MEO/IGSO satellite */ rtklib_sat.iode = static_cast<int32_t>(bei_eph.d_AODE); /* AODE */ rtklib_sat.iodc = static_cast<int32_t>(bei_eph.d_AODC); /* AODC */ @@ -374,8 +374,8 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) rtklib_sat.i0 = gps_cnav_eph.d_i_0; rtklib_sat.idot = gps_cnav_eph.d_IDOT; rtklib_sat.e = gps_cnav_eph.d_e_eccentricity; - rtklib_sat.Adot = gps_cnav_eph.d_A_DOT; //only in CNAV; - rtklib_sat.ndot = gps_cnav_eph.d_DELTA_DOT_N; //only in CNAV; + rtklib_sat.Adot = gps_cnav_eph.d_A_DOT; // only in CNAV; + rtklib_sat.ndot = gps_cnav_eph.d_DELTA_DOT_N; // only in CNAV; rtklib_sat.week = adjgpsweek(gps_cnav_eph.i_GPS_week); /* week of tow */ rtklib_sat.cic = gps_cnav_eph.d_Cic; diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 170763eb4..d2e0cda0d 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -236,8 +236,8 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, //CHECK IF IT IS STILL NEEDED if (opt->ionoopt == IONOOPT_IFLC) - { /* dual-frequency */ - + { + /* dual-frequency */ if (P1 == 0.0 || P2 == 0.0) { return 0.0; diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 0c0dcb708..043a9da5f 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -1689,7 +1689,6 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do for (j = 0; j < 2; j++) { /* for phase and code */ - if (meas[j] == 0.0) { continue; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h index adf506d5a..35d2356d3 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h @@ -79,6 +79,7 @@ #define GNSS_SDR_RTKLIB_RTKCMN_H_ #include "rtklib.h" +#include <string> /* coordinate rotation matrix ------------------------------------------------*/ diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 38c9ce9a6..95a3dd72c 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -1657,7 +1657,6 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, } for (m = 0; m < 4; m++) { /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ - for (f = opt->mode > PMODE_DGPS ? 0 : nf; f < nf * 2; f++) { /* search reference satellite with highest elevation */ @@ -2863,7 +2862,6 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) } if (opt->mode == PMODE_MOVEB) { /* moving baseline */ - /* estimate position/velocity of base station */ if (!pntpos(obs + nu, nr, nav, &rtk->opt, &solb, nullptr, nullptr, msg)) { diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 5524742f2..d39d91f6e 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -494,7 +494,6 @@ void decodefile(rtksvr_t *svr, int index) if (svr->format[index] == STRFMT_SP3) { /* precise ephemeris */ - /* read sp3 precise ephemeris */ readsp3(file, &nav, 0); if (nav.ne <= 0) @@ -517,8 +516,8 @@ void decodefile(rtksvr_t *svr, int index) rtksvrunlock(svr); } else if (svr->format[index] == STRFMT_RNXCLK) - { /* precise clock */ - + { + /* precise clock */ /* read rinex clock */ // Disabled!! if (true /*readrnxc(file, &nav)<=0 */) { diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 5b0ef85cd..a3a190477 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -955,7 +955,6 @@ int gentcp(tcp_t *tcp, int type, char *msg) if (type == 0) { /* server socket */ - #ifdef SVR_REUSEADDR /* multiple-use of server socket */ setsockopt(tcp->sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, diff --git a/src/algorithms/libs/rtklib/rtklib_tides.cc b/src/algorithms/libs/rtklib/rtklib_tides.cc index f675e38a6..957e9842a 100644 --- a/src/algorithms/libs/rtklib/rtklib_tides.cc +++ b/src/algorithms/libs/rtklib/rtklib_tides.cc @@ -355,7 +355,6 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, if (opt & 1) { /* solid earth tides */ - /* sun and moon position in ecef */ sunmoonpos(tutc, erpv, rs, rm, &gmst); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h index ed051f121..c98d113aa 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_sine_table.h @@ -28,7 +28,6 @@ /* From gnuradio/gnuradio-runtime/lib/math/sine_table.h * max_error = 2.353084136763606e-06 */ static const float sine_table_10bits[1 << 10][2] = { - {2.925817799165007e-09, 7.219194364267018e-09}, {2.925707643778599e-09, 2.526699001579799e-07}, {2.925487337153070e-09, 1.191140162167675e-06}, diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h index 1fe23fb0e..99d0e32b2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h @@ -30,6 +30,7 @@ #include "qa_utils.h" #include <volk_gnsssdr/volk_gnsssdr.h> +#include <string> #include <vector> diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 17240a342..bd3b10c88 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -45,7 +45,6 @@ #include <iostream> // for cerr, cout #include <limits> // for numeric_limits #include <utility> // for move -#include <vector> // for vector #if HAS_STD_FILESYSTEM #include <system_error> diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h index 6ab2b1955..b8505e21f 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h @@ -41,6 +41,8 @@ #include <cstdint> // for int32_t #include <fstream> // for string, ofstream #include <memory> // for shared_ptr +#include <string> +#include <vector> class Gnss_Synchro; class hybrid_observables_gs; diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index f7095e55b..02a2029f2 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -35,7 +35,7 @@ #include <gnuradio/blocks/file_sink.h> #include <cmath> #include <limits> - +#include <vector> MmseResamplerConditioner::MmseResamplerConditioner( ConfigurationInterface* configuration, const std::string& role, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index cc25e963d..ac60b4b98 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -34,6 +34,7 @@ #include "direct_resampler_conditioner_cb.h" #include <gnuradio/io_signature.h> +#include <algorithm> // for min direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index 3ae95c816..dedb70b74 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -34,7 +34,7 @@ #include "direct_resampler_conditioner_cc.h" #include <gnuradio/io_signature.h> - +#include <algorithm> // for min direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( double sample_freq_in, double sample_freq_out) diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index 255a75d0e..2b0251ceb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -34,6 +34,7 @@ #include "direct_resampler_conditioner_cs.h" #include <gnuradio/io_signature.h> +#include <algorithm> // for min direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h index e96ba12d0..d38df9e22 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.h +++ b/src/algorithms/signal_generator/adapters/signal_generator.h @@ -40,6 +40,7 @@ #include <gnuradio/blocks/vector_to_stream.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 99a396c8f..a025cda37 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -38,6 +38,7 @@ #include <boost/shared_ptr.hpp> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 48f796d68..ef3dad169 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -39,6 +39,7 @@ #include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/null_sink.h> #include <pmt/pmt.h> +#include <memory> #include <stdexcept> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index 1772191b3..eafeca41c 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -42,6 +42,7 @@ #include <gnuradio/blocks/null_sink.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index 0f5743c9d..f937ecbc7 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -43,6 +43,7 @@ #endif #include "concurrent_queue.h" #include <pmt/pmt.h> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.h b/src/algorithms/signal_source/adapters/gen_signal_source.h index 4b6b48ff9..a83c64301 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.h +++ b/src/algorithms/signal_source/adapters/gen_signal_source.h @@ -37,6 +37,7 @@ #include "concurrent_queue.h" #include "gnss_block_interface.h" #include <pmt/pmt.h> +#include <memory> #include <string> /*! diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h index e9df1e1fc..8b1656694 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h @@ -37,6 +37,7 @@ #include <gnuradio/blocks/file_sink.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index 2768531ee..6b36e4deb 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -37,6 +37,7 @@ #include <gnuradio/blocks/file_sink.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h index 6e6c5e648..5c2f44864 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h @@ -43,6 +43,7 @@ #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index a81c36722..d54f262d3 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -43,6 +43,7 @@ #include <gnuradio/blocks/throttle.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index 46f999997..5225aada0 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -39,6 +39,7 @@ #include <gnuradio/blocks/file_sink.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <osmosdr/source.h> #include <stdexcept> #include <string> diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 1eda54c6b..52ed97acf 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -42,6 +42,7 @@ #endif #include "concurrent_queue.h" #include <pmt/pmt.h> +#include <memory> #include <string> diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index f361801c2..e76944e54 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -37,6 +37,7 @@ #include <gnuradio/blocks/file_sink.h> #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index cb2434bfa..6c0a101fc 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -40,6 +40,7 @@ #include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/float_to_complex.h> #include <pmt/pmt.h> +#include <memory> #include <stdexcept> #include <string> diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index e6f0f2514..47a383e1e 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -41,6 +41,7 @@ #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index 561bed756..cbbaff624 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -45,6 +45,7 @@ #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index 80b1ac4a9..f548079ff 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -44,6 +44,7 @@ #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 4a2e1244d..d017afeef 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -45,6 +45,7 @@ #include <gnuradio/hier_block2.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index 36066c972..a6dc3c081 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -39,6 +39,7 @@ #include <gnuradio/uhd/usrp_source.h> #include <pmt/pmt.h> #include <cstdint> +#include <memory> #include <string> #include <vector> diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index 3fc5cb2d8..2be976ec1 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -36,6 +36,7 @@ #include <pmt/pmt.h> #include <cstdint> #include <fstream> +#include <memory> #include <string> diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index 8421c2ee6..78cab6c39 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -47,6 +47,7 @@ #include <gnuradio/sync_block.h> #include <cstdint> #include <string> +#include <vector> class rtl_tcp_signal_source_c; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index b4514b55b..236cb6842 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -70,6 +70,7 @@ #include <gnuradio/sync_interpolator.h> #include <cstdint> +#include <vector> class unpack_2bit_samples; diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.h b/src/algorithms/signal_source/libs/gnss_sdr_valve.h index ad2b10ebb..32f4219ff 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.h +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.h @@ -41,6 +41,7 @@ #include <pmt/pmt.h> #include <cstddef> // for size_t #include <cstdint> +#include <memory> class Gnss_Sdr_Valve; diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index 9ae57a1e1..9da278800 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -34,6 +34,7 @@ #include "rtl_tcp_dongle_info.h" #include <boost/foreach.hpp> #include <string> +#include <vector> using boost::asio::ip::tcp; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc index b1be0dd90..02c673daa 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc @@ -34,6 +34,7 @@ #include <glog/logging.h> #include <gnuradio/io_signature.h> #include <pmt/pmt_sugar.h> // for mp +#include <algorithm> // for copy #include <array> #include <cmath> // for abs #include <exception> // for exception diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 4e5b6169c..25c20e4e3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -45,7 +45,8 @@ #include <pmt/pmt.h> // for pmt_t #include <cstdint> // for int32_t #include <fstream> // for string, ofstream -#include <utility> // for pair +#include <string> +#include <utility> // for pair #include <vector> class Gnss_Synchro; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index c33a48ed7..fb1408194 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -44,7 +44,9 @@ #include <pmt/pmt.h> // for pmt_t #include <cstdint> // for int32_t #include <fstream> // for string, ofstream -#include <utility> // for pair +#include <memory> +#include <string> +#include <utility> // for pair #include <vector> class Fpga_Multicorrelator_8sc; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 049f3ab40..b51e035e7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -46,6 +46,7 @@ #include "tracking_FLL_PLL_filter.h" #include <gnuradio/block.h> #include <volk_gnsssdr/volk_gnsssdr.h> +#include <deque> #include <fstream> #include <map> #include <string> diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index b57db18a1..ac8149e0f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -44,6 +44,7 @@ #include "tracking_FLL_PLL_filter.h" #include <gnuradio/block.h> #include <volk_gnsssdr/volk_gnsssdr.h> +#include <deque> #include <fstream> #include <map> #include <string> diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.h b/src/algorithms/tracking/libs/fpga_multicorrelator.h index c8999d168..618286c06 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.h +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.h @@ -39,6 +39,7 @@ #include <gnuradio/block.h> #include <cstdint> +#include <string> /*! diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index fb4343159..0c3023eaf 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -40,6 +40,7 @@ #include "gnss_block_interface.h" #include "gnss_synchro.h" +#include <memory> template <typename Data> class Concurrent_Queue; diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index 15f758cc8..e40972589 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -42,6 +42,7 @@ #include "gnss_block_interface.h" #include "gps_almanac.h" #include "gps_ephemeris.h" +#include <map> /*! * \brief This class represents an interface to a PVT block. diff --git a/src/core/libs/channel_status_msg_receiver.h b/src/core/libs/channel_status_msg_receiver.h index 112dd6eaa..24649f61e 100644 --- a/src/core/libs/channel_status_msg_receiver.h +++ b/src/core/libs/channel_status_msg_receiver.h @@ -35,6 +35,7 @@ #include "monitor_pvt.h" #include <gnuradio/block.h> #include <pmt/pmt.h> +#include <map> #include <memory> class channel_status_msg_receiver; diff --git a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h index 3391b4885..f1ba08493 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h +++ b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.h @@ -25,7 +25,6 @@ extern "C" GANSSAlmanacElement_PR_NOTHING, /* No components present */ GANSSAlmanacElement_PR_keplerianAlmanacSet, /* Extensions may appear below */ - } GANSSAlmanacElement_PR; /* GANSSAlmanacElement */ diff --git a/src/core/libs/supl/asn-rrlp/GANSSClockModel.h b/src/core/libs/supl/asn-rrlp/GANSSClockModel.h index 05d019a1e..63f8dafe8 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSClockModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSClockModel.h @@ -25,7 +25,6 @@ extern "C" GANSSClockModel_PR_NOTHING, /* No components present */ GANSSClockModel_PR_standardClockModelList, /* Extensions may appear below */ - } GANSSClockModel_PR; /* GANSSClockModel */ diff --git a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h index 23a907d01..01ce5dea5 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h +++ b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.h @@ -25,7 +25,6 @@ extern "C" GANSSOrbitModel_PR_NOTHING, /* No components present */ GANSSOrbitModel_PR_keplerianSet, /* Extensions may appear below */ - } GANSSOrbitModel_PR; /* GANSSOrbitModel */ diff --git a/src/core/libs/supl/asn-rrlp/RRLP-Component.h b/src/core/libs/supl/asn-rrlp/RRLP-Component.h index 02208b69d..bdeaa99aa 100644 --- a/src/core/libs/supl/asn-rrlp/RRLP-Component.h +++ b/src/core/libs/supl/asn-rrlp/RRLP-Component.h @@ -33,7 +33,6 @@ extern "C" RRLP_Component_PR_assistanceDataAck, RRLP_Component_PR_protocolError, /* Extensions may appear below */ - } RRLP_Component_PR; /* RRLP-Component */ diff --git a/src/core/libs/supl/asn-rrlp/SatStatus.h b/src/core/libs/supl/asn-rrlp/SatStatus.h index 0673b5cd6..ffde0c7b4 100644 --- a/src/core/libs/supl/asn-rrlp/SatStatus.h +++ b/src/core/libs/supl/asn-rrlp/SatStatus.h @@ -28,7 +28,6 @@ extern "C" SatStatus_PR_oldSatelliteAndModel, SatStatus_PR_newNaviModelUC, /* Extensions may appear below */ - } SatStatus_PR; /* SatStatus */ diff --git a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h index d994f4805..c3d751b3f 100644 --- a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h +++ b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.h @@ -58,8 +58,8 @@ extern "C" } UncompressedEphemeris_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ - /* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemE_17; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_UncompressedEphemeris; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-rrlp/asn_system.h b/src/core/libs/supl/asn-rrlp/asn_system.h index 1d2958174..4c175d3d3 100644 --- a/src/core/libs/supl/asn-rrlp/asn_system.h +++ b/src/core/libs/supl/asn-rrlp/asn_system.h @@ -116,8 +116,8 @@ typedef unsigned int uint32_t; #ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) #else /* !__GNUC__ */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ diff --git a/src/core/libs/supl/asn-supl/AltitudeInfo.h b/src/core/libs/supl/asn-supl/AltitudeInfo.h index 117da26e2..694d7c6db 100644 --- a/src/core/libs/supl/asn-supl/AltitudeInfo.h +++ b/src/core/libs/supl/asn-supl/AltitudeInfo.h @@ -43,7 +43,7 @@ extern "C" } AltitudeInfo_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_AltitudeInfo; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-supl/CellInfo.h b/src/core/libs/supl/asn-supl/CellInfo.h index 945d867c6..e1e40dc21 100644 --- a/src/core/libs/supl/asn-supl/CellInfo.h +++ b/src/core/libs/supl/asn-supl/CellInfo.h @@ -29,7 +29,6 @@ extern "C" CellInfo_PR_wcdmaCell, CellInfo_PR_cdmaCell, /* Extensions may appear below */ - } CellInfo_PR; /* CellInfo */ diff --git a/src/core/libs/supl/asn-supl/FrequencyInfo.h b/src/core/libs/supl/asn-supl/FrequencyInfo.h index 48ed6c07e..94fc40402 100644 --- a/src/core/libs/supl/asn-supl/FrequencyInfo.h +++ b/src/core/libs/supl/asn-supl/FrequencyInfo.h @@ -28,7 +28,6 @@ extern "C" fmodeSpecificInfo_PR_fdd, fmodeSpecificInfo_PR_tdd, /* Extensions may appear below */ - } fmodeSpecificInfo_PR; /* FrequencyInfo */ diff --git a/src/core/libs/supl/asn-supl/INTEGER.c b/src/core/libs/supl/asn-supl/INTEGER.c index 5eb93522a..956b2bc4b 100644 --- a/src/core/libs/supl/asn-supl/INTEGER.c +++ b/src/core/libs/supl/asn-supl/INTEGER.c @@ -50,7 +50,7 @@ INTEGER_encode_der(asn_TYPE_descriptor_t *td, void *sptr, /* * Canonicalize integer in the buffer. - * (Remove too long sign extension, remove some first 0x00 bytes) + * (Remove too int64_t sign extension, remove some first 0x00 bytes) */ if(st->buf) { uint8_t *buf = st->buf; @@ -106,7 +106,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by char scratch[32]; /* Enough for 64-bit integer */ uint8_t *buf = st->buf; uint8_t *buf_end = st->buf + st->size; - signed long accum; + int64_t accum; ssize_t wrote = 0; char *p; int ret; @@ -133,9 +133,9 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by char *scr; if(buf == buf_end) { - accum = 0; + accum = 0LL; } else { - accum = (*buf & 0x80) ? -1 : 0; + accum = (*buf & 0x80) ? -1LL : 0LL; for(; buf < buf_end; buf++) accum = (accum * 256) | *buf; } @@ -146,7 +146,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by scr = (char *)alloca(scrsize); if(plainOrXER == 0) ret = snprintf(scr, scrsize, - "%ld (%s)", accum, el->enum_name); + "%lld (%s)", accum, el->enum_name); else ret = snprintf(scr, scrsize, "<%s/>", el->enum_name); @@ -160,7 +160,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by scr = scratch; ret = snprintf(scr, scrsize, (specs && specs->field_unsigned) - ?"%lu":"%ld", accum); + ?"%llu":"%lld", accum); } assert(ret > 0 && (size_t)ret < scrsize); return (cb(scr, ret, app_key) < 0) ? -1 : ret; @@ -175,7 +175,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by return -1; } - /* Output in the long xx:yy:zz... format */ + /* Output in the int64_t xx:yy:zz... format */ /* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */ for(p = scratch; buf < buf_end; buf++) { static const char *h2c = "0123456789ABCDEF"; @@ -284,9 +284,9 @@ INTEGER_map_enum2value(asn_INTEGER_specifics_t *specs, const char *lstart, const static int INTEGER__compar_value2enum(const void *kp, const void *am) { - long a = *(const long *)kp; + int64_t a = *(const int64_t *)kp; const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am; - long b = el->nat_value; + int64_t b = el->nat_value; if(a < b) return -1; else if(a == b) return 0; else return 1; @@ -321,8 +321,8 @@ INTEGER_st_prealloc(INTEGER_t *st, int min_size) { static enum xer_pbd_rval INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) { INTEGER_t *st = (INTEGER_t *)sptr; - long sign = 1; - long value; + int64_t sign = 1LL; + int64_t value; const char *lp; const char *lstart = (const char *)chunk_buf; const char *lstop = lstart + chunk_size; @@ -339,7 +339,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun if(chunk_size) ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x", - (long)chunk_size, *lstart, lstop[-1]); + (int64_t)chunk_size, *lstart, lstop[-1]); /* * We may have received a tag here. It will be processed inline. @@ -398,7 +398,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun } { - long new_value = value * 10; + int64_t new_value = value * 10; if(new_value / 10 != value) /* Overflow */ @@ -409,8 +409,8 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun if(value < 0) { /* Check whether it is a LONG_MIN */ if(sign == -1 - && (unsigned long)value - == ~((unsigned long)-1 >> 1)) { + && (uint64_t)value + == ~((uint64_t)-1 >> 1)) { sign = 1; } else { /* Overflow */ @@ -601,9 +601,9 @@ INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* #10.5.6 */ ASN_DEBUG("Integer with range %d bits", ct->range_bits); if(ct->range_bits >= 0) { - long value; + int64_t value; if(ct->range_bits == 32) { - long lhalf; + int64_t lhalf; value = per_get_few_bits(pd, 16); if(value < 0) _ASN_DECODE_STARVED; lhalf = per_get_few_bits(pd, 16); @@ -687,11 +687,11 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, _ASN_ENCODE_FAILED; /* Check proper range */ if(ct->flags & APC_SEMI_CONSTRAINED) { - if(uval < (unsigned long)ct->lower_bound) + if(uval < (uint64_t)ct->lower_bound) inext = 1; } else if(ct->range_bits >= 0) { - if(uval < (unsigned long)ct->lower_bound - || uval > (unsigned long)ct->upper_bound) + if(uval < (uint64_t)ct->lower_bound + || uval > (uint64_t)ct->upper_bound) inext = 1; } ASN_DEBUG("Value %lu (%02x/%d) lb %lu ub %lu %s", @@ -733,7 +733,7 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, ct->range_bits); if(ct->range_bits == 32) { /* TODO: extend to >32 bits */ - long v = value - ct->lower_bound; + int64_t v = value - ct->lower_bound; if(per_put_few_bits(po, v >> 1, 31) || per_put_few_bits(po, v, 1)) _ASN_ENCODE_FAILED; @@ -768,7 +768,7 @@ asn_INTEGER2long(const INTEGER_t *iptr, int64_t *lptr) { uint8_t *b; uint8_t *end; size_t size; - long l; + int64_t l; /* Sanity checking */ if(!iptr || !iptr->buf || !lptr) { @@ -781,11 +781,11 @@ asn_INTEGER2long(const INTEGER_t *iptr, int64_t *lptr) { size = iptr->size; end = b + size; /* Where to stop */ - if(size > sizeof(long)) { + if(size > sizeof(int64_t)) { uint8_t *end1 = end - 1; /* * Slightly more advanced processing, - * able to >sizeof(long) bytes, + * able to >sizeof(int64_t) bytes, * when the actual value is small * (0x0000000000abcdef would yield a fine 0x00abcdef) */ @@ -799,8 +799,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, int64_t *lptr) { } size = end - b; - if(size > sizeof(long)) { - /* Still cannot fit the long */ + if(size > sizeof(int64_t)) { + /* Still cannot fit the int64_t */ errno = ERANGE; return -1; } @@ -828,7 +828,7 @@ int asn_INTEGER2ulong(const INTEGER_t *iptr, uint64_t *lptr) { uint8_t *b; uint8_t *end; - unsigned long l; + uint64_t l; size_t size; if(!iptr || !iptr->buf || !lptr) { @@ -841,9 +841,9 @@ asn_INTEGER2ulong(const INTEGER_t *iptr, uint64_t *lptr) { end = b + size; /* If all extra leading bytes are zeroes, ignore them */ - for(; size > sizeof(unsigned long); b++, size--) { + for(; size > sizeof(uint64_t); b++, size--) { if(*b) { - /* Value won't fit unsigned long */ + /* Value won't fit uint64_t */ errno = ERANGE; return -1; } @@ -872,7 +872,7 @@ asn_ulong2INTEGER(INTEGER_t *st, uint64_t value) { end = buf + (sizeof(value) + 1); buf[0] = 0; - for(b = buf + 1, shr = (sizeof(long)-1)*8; b < end; shr -= 8, b++) + for(b = buf + 1, shr = (sizeof(int64_t)-1)*8; b < end; shr -= 8, b++) *b = (uint8_t)(value >> shr); if(st->buf) FREEMEM(st->buf); diff --git a/src/core/libs/supl/asn-supl/PosPayLoad.h b/src/core/libs/supl/asn-supl/PosPayLoad.h index 66c03457d..7ec42edf7 100644 --- a/src/core/libs/supl/asn-supl/PosPayLoad.h +++ b/src/core/libs/supl/asn-supl/PosPayLoad.h @@ -27,7 +27,6 @@ extern "C" PosPayLoad_PR_rrcPayload, PosPayLoad_PR_rrlpPayload, /* Extensions may appear below */ - } PosPayLoad_PR; /* PosPayLoad */ diff --git a/src/core/libs/supl/asn-supl/PositionEstimate.h b/src/core/libs/supl/asn-supl/PositionEstimate.h index d4d48ae55..8f8a1d589 100644 --- a/src/core/libs/supl/asn-supl/PositionEstimate.h +++ b/src/core/libs/supl/asn-supl/PositionEstimate.h @@ -57,7 +57,7 @@ extern "C" } PositionEstimate_t; /* Implementation */ - /* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_latitudeSign_2; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_PositionEstimate; #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-supl/SETAuthKey.h b/src/core/libs/supl/asn-supl/SETAuthKey.h index 7a9fbe6fe..8fa64c9b2 100644 --- a/src/core/libs/supl/asn-supl/SETAuthKey.h +++ b/src/core/libs/supl/asn-supl/SETAuthKey.h @@ -26,7 +26,6 @@ extern "C" SETAuthKey_PR_shortKey, SETAuthKey_PR_longKey, /* Extensions may appear below */ - } SETAuthKey_PR; /* SETAuthKey */ diff --git a/src/core/libs/supl/asn-supl/SETId.h b/src/core/libs/supl/asn-supl/SETId.h index ece63df60..c511537ba 100644 --- a/src/core/libs/supl/asn-supl/SETId.h +++ b/src/core/libs/supl/asn-supl/SETId.h @@ -33,7 +33,6 @@ extern "C" SETId_PR_nai, SETId_PR_iPAddress, /* Extensions may appear below */ - } SETId_PR; /* SETId */ diff --git a/src/core/libs/supl/asn-supl/SLPAddress.h b/src/core/libs/supl/asn-supl/SLPAddress.h index 4b13147ef..651cdc6f4 100644 --- a/src/core/libs/supl/asn-supl/SLPAddress.h +++ b/src/core/libs/supl/asn-supl/SLPAddress.h @@ -27,7 +27,6 @@ extern "C" SLPAddress_PR_iPAddress, SLPAddress_PR_fQDN, /* Extensions may appear below */ - } SLPAddress_PR; /* SLPAddress */ diff --git a/src/core/libs/supl/asn-supl/UlpMessage.h b/src/core/libs/supl/asn-supl/UlpMessage.h index 15f42aa9c..42890f9c2 100644 --- a/src/core/libs/supl/asn-supl/UlpMessage.h +++ b/src/core/libs/supl/asn-supl/UlpMessage.h @@ -38,7 +38,6 @@ extern "C" UlpMessage_PR_msDUMMY2, UlpMessage_PR_msDUMMY3, /* Extensions may appear below */ - } UlpMessage_PR; /* UlpMessage */ diff --git a/src/core/libs/supl/asn-supl/Velocity.h b/src/core/libs/supl/asn-supl/Velocity.h index 1db003a82..41c28c456 100644 --- a/src/core/libs/supl/asn-supl/Velocity.h +++ b/src/core/libs/supl/asn-supl/Velocity.h @@ -31,7 +31,6 @@ extern "C" Velocity_PR_horveluncert, Velocity_PR_horandveruncert, /* Extensions may appear below */ - } Velocity_PR; /* Velocity */ diff --git a/src/core/libs/supl/asn-supl/asn_system.h b/src/core/libs/supl/asn-supl/asn_system.h index 1d2958174..4c175d3d3 100644 --- a/src/core/libs/supl/asn-supl/asn_system.h +++ b/src/core/libs/supl/asn-supl/asn_system.h @@ -116,8 +116,8 @@ typedef unsigned int uint32_t; #ifndef MIN /* Suitable for comparing primitive types (integers) */ #if defined(__GNUC__) -#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) +#define MIN(a, b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) #else /* !__GNUC__ */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index 2f997d6f3..a4601fb72 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -191,7 +191,6 @@ typedef struct supl_rrlp_ctx_s int cnt_acq; int acq_time; struct supl_acquis_s acq[MAX_EPHEMERIS]; - } supl_assist_t; typedef struct supl_param_s @@ -232,7 +231,6 @@ typedef struct supl_ctx_s void *buf; size_t size; } slp_session_id; - } supl_ctx_t; int supl_ctx_new(supl_ctx_t *ctx); diff --git a/src/core/monitor/serdes_gnss_synchro.h b/src/core/monitor/serdes_gnss_synchro.h index 6cf746636..a123b6c57 100644 --- a/src/core/monitor/serdes_gnss_synchro.h +++ b/src/core/monitor/serdes_gnss_synchro.h @@ -35,9 +35,10 @@ #include "gnss_synchro.h" #include "gnss_synchro.pb.h" // file created by Protocol Buffers at compile time #include <array> +#include <string> +#include <utility> #include <vector> - /*! * \brief This class implements serialization and deserialization of * Gnss_Synchro objects using Protocol Buffers. diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index c3e8d39c2..70ee6f630 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -39,6 +39,7 @@ #include "string_converter.h" #include <glog/logging.h> #include <string> +#include <utility> FileConfiguration::FileConfiguration(std::string filename) diff --git a/src/core/system_parameters/Beidou_DNAV.h b/src/core/system_parameters/Beidou_DNAV.h index 8cd45077c..d955599d3 100644 --- a/src/core/system_parameters/Beidou_DNAV.h +++ b/src/core/system_parameters/Beidou_DNAV.h @@ -33,6 +33,7 @@ #include "MATH_CONSTANTS.h" #include <cstdint> +#include <string> #include <utility> #include <vector> diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index fb0321b0f..ff2f72865 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -35,6 +35,7 @@ #include "MATH_CONSTANTS.h" #include "gnss_frequencies.h" #include <cstdint> +#include <string> #include <utility> // std::pair #include <vector> diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 25607d2c2..e89a70187 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -35,6 +35,7 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/time_formatters.hpp> #include <cmath> +#include <string> Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris() diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 2da5debe7..ec7e9fbd1 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -654,94 +654,94 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ switch (PRN_) { case 1: - block_ = std::string("Compass-G1"); //!<GEO 140.0°E; launched 2010/01/16 + block_ = std::string("Compass-G1"); // GEO 140.0°E; launched 2010/01/16 break; case 2: - block_ = std::string("Compass-G6"); //!<GEO 80°E; launched 2012/10/25 + block_ = std::string("Compass-G6"); // GEO 80°E; launched 2012/10/25 break; case 3: - block_ = std::string("Compass-G7"); //!<GEO 110.5°E; launched 2016/06/12 + block_ = std::string("Compass-G7"); // GEO 110.5°E; launched 2016/06/12 break; case 4: - block_ = std::string("Compass-G4"); //!<GEO 160.0°E; launched 2010/10/31 + block_ = std::string("Compass-G4"); // GEO 160.0°E; launched 2010/10/31 break; case 5: - block_ = std::string("Compass-G5"); //!<GEO 58.75°E; launched 2012/02/24 + block_ = std::string("Compass-G5"); // GEO 58.75°E; launched 2012/02/24 break; case 6: - block_ = std::string("Compass-IGS01"); //!<55° inclination IGSO 118°E; launched 2010/07/31 + block_ = std::string("Compass-IGS01"); // 55° inclination IGSO 118°E; launched 2010/07/31 break; case 7: - block_ = std::string("Compass-IGS02"); //!<55° inclination IGSO 118°E; launched 2010/12/17 + block_ = std::string("Compass-IGS02"); // 55° inclination IGSO 118°E; launched 2010/12/17 break; case 8: - block_ = std::string("Compass-IGS03"); //!<55° inclination IGSO 118°E; launched 2011/04/09 + block_ = std::string("Compass-IGS03"); // 55° inclination IGSO 118°E; launched 2011/04/09 break; case 9: - block_ = std::string("Compass-IGS04"); //!<55° inclination IGSO 95°E; launched 2011/07/27 + block_ = std::string("Compass-IGS04"); // 55° inclination IGSO 95°E; launched 2011/07/27 break; case 10: - block_ = std::string("Compass-IGS05"); //!<55° inclination IGSO 118°E; launched 2011/12/01 + block_ = std::string("Compass-IGS05"); // 55° inclination IGSO 118°E; launched 2011/12/01 break; case 11: - block_ = std::string("Compass-M3"); //!<Slot A07; launched 2012/04/29 + block_ = std::string("Compass-M3"); // Slot A07; launched 2012/04/29 break; case 12: - block_ = std::string("Compass-M4"); //!<Slot A08; launched 2012/04/29 + block_ = std::string("Compass-M4"); // Slot A08; launched 2012/04/29 break; case 19: - block_ = std::string("BEIDOU-3 M1"); //!<Slot B-7; launched 2017/11/05 + block_ = std::string("BEIDOU-3 M1"); // Slot B-7; launched 2017/11/05 break; case 20: - block_ = std::string("BEIDOU-3 M2"); //!<Slot B-5; launched 2017/11/05 + block_ = std::string("BEIDOU-3 M2"); // Slot B-5; launched 2017/11/05 break; case 21: - block_ = std::string("BEIDOU 3M5"); //!<Slot B-?; launched 2018/02/12 + block_ = std::string("BEIDOU 3M5"); // Slot B-?; launched 2018/02/12 break; case 22: - block_ = std::string("BEIDOU 3M6"); //!<Slot B-6; launched 2018/02/12 + block_ = std::string("BEIDOU 3M6"); // Slot B-6; launched 2018/02/12 break; case 23: - block_ = std::string("BEIDOU 3M9"); //!<Slot C-7; launched 2018/07/29 + block_ = std::string("BEIDOU 3M9"); // Slot C-7; launched 2018/07/29 break; case 24: - block_ = std::string("BEIDOU 3M10"); //!<Slot C-1; launched 2018/07/29 + block_ = std::string("BEIDOU 3M10"); // Slot C-1; launched 2018/07/29 break; case 25: - block_ = std::string("BEIDOU 3M12"); //!<Slot C-8; launched 2018/08/24 + block_ = std::string("BEIDOU 3M12"); // Slot C-8; launched 2018/08/24 break; case 26: - block_ = std::string("BEIDOU 3M11"); //!<Slot C-2; launched 2018/08/24 + block_ = std::string("BEIDOU 3M11"); // Slot C-2; launched 2018/08/24 break; case 27: - block_ = std::string("BEIDOU 3M3"); //!<Slot A-?; launched 2018/01/11 + block_ = std::string("BEIDOU 3M3"); // Slot A-?; launched 2018/01/11 break; case 28: - block_ = std::string("BEIDOU 3M4"); //!<Slot A-?; launched 2018/01/11 + block_ = std::string("BEIDOU 3M4"); // Slot A-?; launched 2018/01/11 break; case 29: - block_ = std::string("BEIDOU 3M7"); //!<Slot A-?; launched 2018/03/29 + block_ = std::string("BEIDOU 3M7"); // Slot A-?; launched 2018/03/29 break; case 30: - block_ = std::string("BEIDOU 3M8"); //!<Slot A-?; launched 2018/03/29 + block_ = std::string("BEIDOU 3M8"); // Slot A-?; launched 2018/03/29 break; case 32: - block_ = std::string("BEIDOU 3M13"); //!<Slot B-1?; launched 2018/09/19 + block_ = std::string("BEIDOU 3M13"); // Slot B-1?; launched 2018/09/19 break; case 33: - block_ = std::string("BEIDOU 3M14"); //!<Slot B-3; launched 2018/09/19 + block_ = std::string("BEIDOU 3M14"); // Slot B-3; launched 2018/09/19 break; case 34: - block_ = std::string("BEIDOU 3M15"); //!<Slot B-3; launched 2018/10/15 + block_ = std::string("BEIDOU 3M15"); // Slot B-3; launched 2018/10/15 break; case 35: - block_ = std::string("BEIDOU 3M16"); //!<Slot B-3; launched 2018/10/15 + block_ = std::string("BEIDOU 3M16"); // Slot B-3; launched 2018/10/15 break; case 36: - block_ = std::string("BEIDOU 3M17"); //!<Slot B-3; launched 2018/11/18 + block_ = std::string("BEIDOU 3M17"); // Slot B-3; launched 2018/11/18 break; case 37: - block_ = std::string("BEIDOU 3M18"); //!<Slot B-3; launched 2018/11/18 + block_ = std::string("BEIDOU 3M18"); // Slot B-3; launched 2018/11/18 break; default: block_ = std::string("Unknown(Simulated)"); diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index a240fe53e..213889ee0 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -148,7 +148,7 @@ private: ///\brief checks if file is available /// /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] + /// \param mode --> the mode [optional,default value = 0] /// /// \return file exists (yes == true, no == false) // --------------------------------------------------------------------------------- @@ -158,7 +158,7 @@ private: ///\brief checks if file exists /// /// \param filename --> the filename - /// \param mode --> the mode [optional,default value = 0] + /// \param mode --> the mode [optional,default value = 0] /// /// \return file exists (yes == true, no == false) // --------------------------------------------------------------------------------- diff --git a/src/tests/common-files/signal_generator_flags.h b/src/tests/common-files/signal_generator_flags.h index 88d929595..876b927f6 100644 --- a/src/tests/common-files/signal_generator_flags.h +++ b/src/tests/common-files/signal_generator_flags.h @@ -33,6 +33,7 @@ #include <gflags/gflags.h> #include <limits> +#include <string> DEFINE_bool(disable_generator, false, "Disable the signal generator (a external signal file must be available for the test)"); DEFINE_string(generator_binary, std::string(SW_GENERATOR_BIN), "Path of software-defined signal generator binary"); diff --git a/src/tests/common-files/test_flags.h b/src/tests/common-files/test_flags.h index 5a22a1e2e..74ed3a49c 100644 --- a/src/tests/common-files/test_flags.h +++ b/src/tests/common-files/test_flags.h @@ -32,6 +32,7 @@ #define GNSS_SDR_TEST_FLAGS_H_ #include <gflags/gflags.h> +#include <string> #if defined GNUPLOT_EXECUTABLE DEFINE_string(gnuplot_executable, std::string(GNUPLOT_EXECUTABLE), "Gnuplot binary path"); diff --git a/src/tests/common-files/tracking_tests_flags.h b/src/tests/common-files/tracking_tests_flags.h index 50732e3b1..41e845083 100644 --- a/src/tests/common-files/tracking_tests_flags.h +++ b/src/tests/common-files/tracking_tests_flags.h @@ -33,6 +33,7 @@ #include <gflags/gflags.h> #include <limits> +#include <string> DEFINE_string(trk_test_implementation, std::string("GPS_L1_CA_DLL_PLL_Tracking"), "Tracking block implementation under test, defaults to GPS_L1_CA_DLL_PLL_Tracking"); diff --git a/src/tests/system-tests/libs/position_test_flags.h b/src/tests/system-tests/libs/position_test_flags.h index bfb4c4334..d123a257d 100644 --- a/src/tests/system-tests/libs/position_test_flags.h +++ b/src/tests/system-tests/libs/position_test_flags.h @@ -33,6 +33,7 @@ #include <gflags/gflags.h> #include <limits> +#include <string> DEFINE_string(config_file_ptest, std::string(""), "File containing the configuration parameters for the position test."); DEFINE_bool(plot_position_test, false, "Plots results of with gnuplot"); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index be6583874..c81e3b10b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -390,9 +390,10 @@ void* handler_DMA_obs_test(void* arguments) exit(1); } else - - // open input file - rx_signal_file_id = fopen(file.c_str(), "rb"); + { + // open input file + rx_signal_file_id = fopen(file.c_str(), "rb"); + } if (rx_signal_file_id == nullptr) { std::cout << "DMA can't open input file" << std::endl; @@ -463,7 +464,6 @@ void* handler_DMA_obs_test(void* arguments) } } - close(tx_fd); fclose(rx_signal_file_id); return nullptr; @@ -516,7 +516,6 @@ bool HybridObservablesTestFpga::acquire_signal() acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0); } - else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { tmp_gnss_synchro.System = 'E'; @@ -568,7 +567,6 @@ bool HybridObservablesTestFpga::acquire_signal() top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); - // 5. Run the flowgraph // Get visible GPS satellites (positive acquisitions with Doppler measurements) // record startup time @@ -615,7 +613,6 @@ bool HybridObservablesTestFpga::acquire_signal() int acq_doppler_max = config->property("Acquisition.doppler_max", FLAGS_external_signal_acquisition_doppler_max_hz); int acq_doppler_step = config->property("Acquisition.doppler_step", FLAGS_external_signal_acquisition_doppler_step_hz); - for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++) { tmp_gnss_synchro.PRN = PRN; @@ -629,7 +626,6 @@ bool HybridObservablesTestFpga::acquire_signal() args.file = file; - send_samples_start_obs_test = 0; if ((implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") or (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga")) @@ -659,7 +655,6 @@ bool HybridObservablesTestFpga::acquire_signal() args.skip_used_samples = 0; } - // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, (void*)&args) < 0) { @@ -709,7 +704,6 @@ bool HybridObservablesTestFpga::acquire_signal() tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation tmp_gnss_synchro.Acq_samplestamp_samples = tmp_gnss_synchro.Acq_samplestamp_samples; // delay due to the downsampling filter in the acquisition - gnss_synchro_vec.push_back(tmp_gnss_synchro); } else @@ -717,10 +711,7 @@ bool HybridObservablesTestFpga::acquire_signal() std::cout << " . "; } - top_block->stop(); - - std::cout.flush(); } std::cout << "]" << std::endl; @@ -749,9 +740,6 @@ bool HybridObservablesTestFpga::acquire_signal() { return false; } - - - return true; } @@ -857,6 +845,7 @@ void HybridObservablesTestFpga::configure_receiver( std::cout << "*****************************************\n"; } + void HybridObservablesTestFpga::check_results_carrier_phase( arma::mat& true_ch0, arma::vec& true_tow_s, @@ -864,7 +853,6 @@ void HybridObservablesTestFpga::check_results_carrier_phase( const std::string& data_title) { //1. True value interpolation to match the measurement times - double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; double t1 = measured_ch0(size1 - 1, 0); @@ -945,7 +933,6 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( const std::string& data_title) { //1. True value interpolation to match the measurement times - double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; @@ -956,7 +943,6 @@ void HybridObservablesTestFpga::check_results_carrier_phase_double_diff( arma::vec t_from_start = arma::linspace<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector<double> time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - arma::vec true_ch0_carrier_phase_interp; arma::vec true_ch1_carrier_phase_interp; arma::interp1(true_tow_ch0_s, true_ch0.col(3), t, true_ch0_carrier_phase_interp); @@ -1036,7 +1022,6 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( const std::string& data_title) { //1. True value interpolation to match the measurement times - double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; @@ -1047,7 +1032,6 @@ void HybridObservablesTestFpga::check_results_carrier_doppler_double_diff( arma::vec t_from_start = arma::linspace<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector<double> time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - arma::vec true_ch0_carrier_doppler_interp; arma::vec true_ch1_carrier_doppler_interp; arma::interp1(true_tow_ch0_s, true_ch0.col(2), t, true_ch0_carrier_doppler_interp); @@ -1124,7 +1108,6 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( const std::string& data_title) { //1. True value interpolation to match the measurement times - double t0 = measured_ch0(0, 0); int size1 = measured_ch0.col(0).n_rows; double t1 = measured_ch0(size1 - 1, 0); @@ -1195,6 +1178,7 @@ void HybridObservablesTestFpga::check_results_carrier_doppler( ASSERT_LT(rmse_ch0, 30); } + bool HybridObservablesTestFpga::save_mat_xy(std::vector<double>& x, std::vector<double>& y, std::string filename) { try @@ -1230,6 +1214,7 @@ bool HybridObservablesTestFpga::save_mat_xy(std::vector<double>& x, std::vector< } } + void HybridObservablesTestFpga::check_results_code_pseudorange( arma::mat& true_ch0, arma::mat& true_ch1, @@ -1240,7 +1225,6 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( const std::string& data_title) { //1. True value interpolation to match the measurement times - double t0 = std::max(measured_ch0(0, 0), measured_ch1(0, 0)); int size1 = measured_ch0.col(0).n_rows; int size2 = measured_ch1.col(0).n_rows; @@ -1251,7 +1235,6 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( arma::vec t_from_start = arma::linspace<arma::vec>(0, t1 - t0, floor((t1 - t0) * 1e3)); std::vector<double> time_vector(t_from_start.colptr(0), t_from_start.colptr(0) + t_from_start.n_rows); - arma::vec true_ch0_dist_interp; arma::vec true_ch1_dist_interp; arma::interp1(true_tow_ch0_s, true_ch0.col(1), t, true_ch0_dist_interp); @@ -1319,6 +1302,7 @@ void HybridObservablesTestFpga::check_results_code_pseudorange( ASSERT_GT(min_error, -10.0); } + bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_Synchro gnss) { // Open and read reference RINEX observables file @@ -1459,6 +1443,8 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gn } return true; } + + TEST_F(HybridObservablesTestFpga, ValidationOfResults) { // pointer to the DMA thread that sends the samples to the acquisition engine @@ -1475,7 +1461,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) generate_signal(); } - std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::duration<double> elapsed_seconds(0); @@ -1556,7 +1541,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - // The HW has been reset after the acquisition phase when the acquisition class was destroyed. // No more samples remained in the DMA. Therefore any intermediate state in the LPF of the // GPS L1 / Galileo E1 filter has been cleared. @@ -1567,7 +1551,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) // instantiate the acquisition modules in order to use them to reset the HW. // (note that the constructor of the acquisition modules resets the HW too) - std::shared_ptr<AcquisitionInterface> acquisition; // reset the HW to clear the sample counters: the acquisition constructor generates a reset @@ -1597,18 +1580,16 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) throw(std::exception()); } - std::vector<std::shared_ptr<TrackingInterface>> tracking_ch_vec; std::vector<std::shared_ptr<TelemetryDecoderInterface>> tlm_ch_vec; std::vector<gr::blocks::null_sink::sptr> null_sink_vec; for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) { - //set channels ids + // set channels ids gnss_synchro_vec.at(n).Channel_ID = n; - //create the tracking channels and create the telemetry decoders - + // create the tracking channels and create the telemetry decoders std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); tracking_ch_vec.push_back(std::dynamic_pointer_cast<TrackingInterface>(trk_)); std::shared_ptr<GNSSBlockInterface> tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); @@ -1673,7 +1654,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter; ch_out_fpga_sample_counter = gnss_sdr_make_fpga_sample_counter(fs, observable_interval_ms); - for (unsigned int n = 0; n < tracking_ch_vec.size(); n++) { //top_block->connect(gr_interleaved_char_to_complex, 0, tracking_ch_vec.at(n)->get_left_block(), 0); @@ -1687,10 +1667,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) top_block->connect(ch_out_fpga_sample_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); //extra port for the sample counter pulse }) << "Failure connecting the blocks."; - args.file = file; args.nsamples_tx = baseband_sampling_freq * FLAGS_duration; - ; args.skip_used_samples = 0; @@ -1699,7 +1677,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) std::cout << "ERROR cannot create DMA Process" << std::endl; } - for (auto& n : tracking_ch_vec) { n->start_tracking(); @@ -1709,10 +1686,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) send_samples_start_obs_test = 1; pthread_mutex_unlock(&mutex_obs_test); - top_block->start(); - EXPECT_NO_THROW({ start = std::chrono::system_clock::now(); //top_block->run(); // Start threads and wait @@ -1720,30 +1695,25 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) elapsed_seconds = end - start; }) << "Failure running the top_block."; - // wait for the child DMA process to finish pthread_join(thread_DMA, nullptr); - top_block->stop(); - // reset the HW AGAIN acquisition->stop_acquisition(); + // pthread_mutex_lock(&mutex_obs_test); + // send_samples_start_obs_test = 0; + // pthread_mutex_unlock(&mutex_obs_test); - // pthread_mutex_lock(&mutex_obs_test); - // send_samples_start_obs_test = 0; - // pthread_mutex_unlock(&mutex_obs_test); - - - //check results + // check results // Matrices for storing columnwise true GPS time, Range, Doppler and Carrier phase std::vector<arma::mat> true_obs_vec; if (!FLAGS_enable_external_signal_file) { - //load the true values + // load the true values True_Observables_Reader true_observables; ASSERT_NO_THROW({ if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) @@ -1789,8 +1759,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) << "Failure reading RINEX file"; } - - //read measured values + // read measured values Observables_Dump_Reader estimated_observables(tracking_ch_vec.size()); ASSERT_NO_THROW({ if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false) @@ -1828,8 +1797,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - - //Cut measurement tail zeros + // Cut measurement tail zeros arma::uvec index; for (auto& n : measured_obs_vec) { @@ -1840,8 +1808,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - //Cut measurement initial transitory of the measurements - + // Cut measurement initial transitory of the measurements double initial_transitory_s = FLAGS_skip_obs_transitory_s; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) @@ -1859,12 +1826,11 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } + // Correct the clock error using true values (it is not possible for a receiver to correct + // the receiver clock offset error at the observables level because it is required the + // decoding of the ephemeris data and solve the PVT equations) - //Correct the clock error using true values (it is not possible for a receiver to correct - //the receiver clock offset error at the observables level because it is required the - //decoding of the ephemeris data and solve the PVT equations) - - //Find the reference satellite (the nearest) and compute the receiver time offset at observable level + // Find the reference satellite (the nearest) and compute the receiver time offset at observable level double min_pr = std::numeric_limits<double>::max(); unsigned int min_pr_ch_id = 0; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) @@ -1969,6 +1935,5 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } } - std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl; } diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 1ed03dbc8..f604682a4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -1069,14 +1069,12 @@ TEST_F(TrackingPullInTest, ValidationOfResults) } } } //end plot - - } //end acquisition Delay errors loop - } //end acquisition Doppler errors loop + } //end acquisition Delay errors loop + } //end acquisition Doppler errors loop pull_in_results_v_v.push_back(pull_in_results_v); - - } //end CN0 LOOP - //build the mesh grid + + //build the mesh grid std::vector<double> doppler_error_mesh; std::vector<double> code_delay_error_mesh; for (unsigned int current_acq_doppler_error_idx = 0; current_acq_doppler_error_idx < acq_doppler_error_hz_values.size(); current_acq_doppler_error_idx++) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index d82fcd3cd..bde3572cb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -1244,19 +1244,14 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) std::cout << ge.what() << std::endl; } } - } //end plot - - } //end acquisition Delay errors loop - + } //end plot + } //end acquisition Delay errors loop usleep(100000); // give time to the HW to consume all the remaining samples - - } //end acquisition Doppler errors loop - + } //end acquisition Doppler errors loop pull_in_results_v_v.push_back(pull_in_results_v); - } //end CN0 LOOP - //build the mesh grid + //build the mesh grid std::vector<double> doppler_error_mesh; std::vector<double> code_delay_error_mesh; for (unsigned int current_acq_doppler_error_idx = 0; current_acq_doppler_error_idx < acq_doppler_error_hz_values.size(); current_acq_doppler_error_idx++)