diff --git a/.clang-format b/.clang-format index 7ab3cb079..f13c68662 100644 --- a/.clang-format +++ b/.clang-format @@ -51,7 +51,7 @@ IncludeBlocks: Merge IncludeCategories: - Regex: '^.*.h"' Priority: 1 - - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' + - Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/' Priority: 2 - Regex: '^.*(armadillo|matio|pugixml)' Priority: 2 diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 00353490a..22dedce6e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -41,8 +41,8 @@ #include "gps_sdr_signal_processing.h" #include #include -#include #include +#include GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 341166f64..b026dae6f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -65,6 +65,7 @@ #include // for gr_complex #include // for scoped_lock #include // for gr_vector_const_void_star +#include // for Guidelines Support Library #include // for lv_16sc_t #include #include @@ -72,12 +73,6 @@ #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif class Gnss_Synchro; class pcps_acquisition; diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 6e45480bc..d8fac7598 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -92,23 +92,11 @@ else() target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system) endif() -include(CheckCXXSourceCompiles) -check_cxx_source_compiles(" - #include - int main() - { std::span sv; }" - has_span +target_include_directories(algorithms_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include ) -if(${has_span}) - target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1) -else() - target_include_directories(algorithms_libs - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include - ) -endif() - target_link_libraries(algorithms_libs PUBLIC Armadillo::armadillo diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.h b/src/algorithms/libs/beidou_b1i_signal_processing.h index 367a6d7b1..c86907e06 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.h +++ b/src/algorithms/libs/beidou_b1i_signal_processing.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift void beidou_b1i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index dc91c30c9..0698550e9 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int BeiDou B3I code for the desired SV ID and code shift void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h index be7f5f4b9..08c4db3c8 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.h +++ b/src/algorithms/libs/galileo_e1_signal_processing.h @@ -32,15 +32,10 @@ #ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif /*! diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index f04e95ab5..d3e8b617f 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -34,16 +34,10 @@ #ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - /*! * \brief Generates Galileo E5a code at 1 sample/chip diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index f239823e6..e7c641b2d 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency void glonass_l1_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); diff --git a/src/algorithms/libs/glonass_l2_signal_processing.h b/src/algorithms/libs/glonass_l2_signal_processing.h index aae68cb1c..fe79c4ed5 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.h +++ b/src/algorithms/libs/glonass_l2_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency void glonass_l2_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h index cb08cf24f..d2c68b3eb 100644 --- a/src/algorithms/libs/gnss_signal_processing.h +++ b/src/algorithms/libs/gnss_signal_processing.h @@ -35,17 +35,10 @@ #ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - /*! * \brief This function generates a complex exponential in _dest. * diff --git a/src/algorithms/libs/gps_l2c_signal.h b/src/algorithms/libs/gps_l2c_signal.h index 3ec6a4c4e..099aa4ca2 100644 --- a/src/algorithms/libs/gps_l2c_signal.h +++ b/src/algorithms/libs/gps_l2c_signal.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_ #define GNSS_SDR_GPS_L2C_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates complex GPS L2C M code for the desired SV ID void gps_l2c_m_code_gen_complex(gsl::span> _dest, uint32_t _prn); void gps_l2c_m_code_gen_float(gsl::span _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_l5_signal.h b/src/algorithms/libs/gps_l5_signal.h index d6e60bf4d..057d0f02a 100644 --- a/src/algorithms/libs/gps_l5_signal.h +++ b/src/algorithms/libs/gps_l5_signal.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_L5_SIGNAL_H_ #define GNSS_SDR_GPS_L5_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GPS L5I code for the desired SV ID void gps_l5i_code_gen_complex(gsl::span> _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h index 66db15886..13cacfabc 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.h +++ b/src/algorithms/libs/gps_sdr_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int GPS L1 C/A code for the desired SV ID and code shift void gps_l1_ca_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 9fb0c408f..dbd6eaba8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -57,15 +57,15 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 028e8fbde..b6040f1d9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -49,14 +49,14 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 9853e6753..a111a44ea 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -45,12 +45,12 @@ #include "tracking_discriminators.h" #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 376d5c1f3..da8d04449 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -31,14 +31,9 @@ #include "gnss_signal_processing.h" #include "gps_sdr_signal_processing.h" +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif TEST(CodeGenerationTest, CodeGenGPSL1Test) diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 9a5f825e3..643d2e3b9 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -32,14 +32,9 @@ #include "GPS_L1_CA.h" #include "gnss_signal_processing.h" #include -#include -#include -#if HAS_SPAN -#include -namespace gsl = std; -#else #include -#endif +#include +#include e DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing");