diff --git a/.clang-tidy b/.clang-tidy index bcc3e3cdb..0cabf7daf 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,45 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare' +Checks: '-*, + boost-use-to-string, + cert-dcl21-cpp, + cert-dcl58-cpp, + cert-env33-c, + cert-err52-cpp, + cert-err60-cpp, + cert-flp30-c, + clang-analyzer-cplusplus*, + cppcoreguidelines-pro-type-static-cast-downcast, + cppcoreguidelines-slicing, + google-build-namespaces, + google-runtime-int, + misc-misplaced-const, + misc-new-delete-overloads, + misc-non-copyable-objects, + misc-static-assert, + misc-throw-by-value-catch-by-reference, + misc-uniqueptr-reset-release, + modernize-loop-convert, + modernize-pass-by-value, + modernize-raw-string-literal, + modernize-use-auto, + modernize-use-bool-literals, + modernize-use-equals-default, + modernize-use-equals-delete, + modernize-use-noexcept, + modernize-use-nullptr, + performance-faster-string-find, + performance-inefficient-algorithm, + performance-move-const-arg, + performance-type-promotion-in-math-fn, + performance-unnecessary-copy-initialization, + performance-unnecessary-value-param, + readability-container-size-empty, + readability-inconsistent-declaration-parameter-name, + readability-named-parameter, + readability-non-const-parameter, + readability-string-compare' WarningsAsErrors: '' -HeaderFilterRegex: '' +HeaderFilterRegex: '*.h' AnalyzeTemporaryDtors: false FormatStyle: 'file' CheckOptions: @@ -18,7 +56,7 @@ CheckOptions: - key: google-runtime-int.SignedTypePrefix value: int - key: google-runtime-int.TypeSuffix - value: '_t' + value: _t - key: google-runtime-int.UnsignedTypePrefix value: uint - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries @@ -57,4 +95,8 @@ CheckOptions: value: llvm - key: performance-unnecessary-value-param.IncludeStyle value: llvm + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: '1' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: '0' ... diff --git a/CMakeLists.txt b/CMakeLists.txt index 7476d5f2d..a57aebad3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ endif() ######################################################################## # Determine optional blocks/libraries to be built (default: not built) -# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ../' +# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..' ######################################################################## # Support of optional RF front-ends option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON) @@ -58,6 +58,9 @@ option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF) +# Code correctness +option(ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF) + # Acceleration option(ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF) option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF) @@ -1529,8 +1532,8 @@ endif() find_package(Doxygen) if(DOXYGEN_FOUND) message(STATUS "Doxygen found.") - message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") - message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") + message(STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") + message(STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) @@ -1552,7 +1555,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen." VERBATIM ) if(LATEX_COMPILER) - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") add_custom_target(pdfmanual COMMAND ${CMAKE_MAKE_PROGRAM} COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf @@ -1562,7 +1565,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating PDF manual with Doxygen." VERBATIM ) endif() - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") add_custom_target(doc-clean COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex @@ -1600,7 +1603,7 @@ if(ENABLE_OPENCL) else() if(OPENCL_FOUND) message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + message(STATUS " You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ..' ") endif() endif() if(ENABLE_GENERIC_ARCH) @@ -1627,10 +1630,10 @@ endif() if(ENABLE_CUDA) find_package(CUDA REQUIRED) message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'") else() message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") + message(STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA.") endif() @@ -1640,7 +1643,7 @@ endif() ############################################################################### if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP IP packet source is enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'") find_package(PCAP) if(NOT PCAP_FOUND) message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)") @@ -1654,10 +1657,10 @@ endif() ############################################################################### if(ENABLE_FPGA) message(STATUS "FPGA Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'") else() message(STATUS "Fpga Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") + message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA.") endif() @@ -1707,7 +1710,7 @@ if(ENABLE_OSMOSDR) find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'") else() if(ENABLE_PACKAGING) message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") @@ -1717,7 +1720,7 @@ if(ENABLE_OSMOSDR) endif() else() message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") + message(STATUS " Enable it with 'cmake -DENABLE_OSMOSDR=ON ..' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif() @@ -1755,10 +1758,10 @@ endif() if(ENABLE_FLEXIBAND) message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ..'") else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") + message(STATUS " Enable it with 'cmake -DENABLE_FLEXIBAND=ON ..' to add support for the Teleorbit Flexiband front-end.") endif() if(ENABLE_FLEXIBAND) find_package(TELEORBIT) @@ -1780,11 +1783,11 @@ if(GN3S_DRIVER) endif() if(ENABLE_GN3S) message(STATUS "The GN3S driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_GN3S=OFF ..'") find_package(GRGN3S QUIET) else() message(STATUS "The (optional and experimental) GN3S driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") + message(STATUS " Enable it with 'cmake -DENABLE_GN3S=ON ..' to add support for the GN3S dongle.") endif() @@ -1802,11 +1805,11 @@ endif() if(ENABLE_ARRAY) message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_ARRAY=OFF ..'") find_package(GRDBFCTTC QUIET) else() message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") + message(STATUS " Enable it with 'cmake -DENABLE_ARRAY=ON ..' to add support for the CTTC experimental array front-end.") endif() @@ -1818,11 +1821,11 @@ if(ENABLE_GPERFTOOLS) find_package(GPERFTOOLS) if(NOT GPERFTOOLS_FOUND) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") - message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") - message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") + message(STATUS " Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") + message(STATUS " You can install GPerftools from https://github.com/gperftools/gperftools") else() message(STATUS "GPerftools libraries found.") - message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") + message(STATUS " Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") endif() endif() if(ENABLE_GPERFTOOLS) @@ -1900,7 +1903,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(STATUS "clang-tidy not found.") else() message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*") + if(ENABLE_CLANG_TIDY) + message(STATUS " clang-tidy will be used in compilation. You can disable it with 'cmake -DENABLE_CLANG_TIDY=OFF ..'") + else() + message(STATUS " You can enable clang-tidy usage in compilation with 'cmake -DENABLE_CLANG_TIDY=ON ..'") + endif() + set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() endif() diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 60dba0590..954d057bc 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -49,6 +49,15 @@ if(Boost_VERSION LESS 105800) target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET pvt_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 78de824ed..61b243633 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -53,7 +53,7 @@ using google::LogMessage; RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(std::move(role)), + unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 9a426daf6..6c36caa24 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -41,6 +41,15 @@ target_link_libraries(pvt_gr_blocks core_system_parameters ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + target_include_directories(pvt_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 72b038683..939855318 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -58,7 +58,7 @@ class rtklib_pvt_cc; using rtklib_pvt_cc_sptr = boost::shared_ptr; -rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, +rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk); diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index a19859234..d04fa0cb5 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -79,6 +79,15 @@ target_include_directories(pvt_libs target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ $ diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 8a9c2b590..248a4b34d 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -60,7 +60,7 @@ public: hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file); ~hybrid_ls_pvt(); - bool get_PVT(std::map gnss_observables_map, double Rx_time, bool flag_averaging); + bool get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging); std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 415cae4a7..10f552559 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -3867,9 +3867,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& glonass_gnav_eph_map) +void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& glonass_gnav_eph_map) { - Rinex_Printer::log_rinex_nav(out, gps_eph_map); + Rinex_Printer::log_rinex_nav(out, gps_cnav_eph_map); Rinex_Printer::log_rinex_nav(out, glonass_gnav_eph_map); } @@ -4715,7 +4715,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps } -void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) { if (glonass_gnav_eph.d_m) { @@ -4962,7 +4962,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- TIME OF FIRST OBS line.clear(); - boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_cnav_eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_gps_time); std::string year(timestring, 0, 4); std::string month(timestring, 4, 2); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 1c4475592..0e189dc80 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -186,17 +186,17 @@ public: /*! * \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C"); + void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1C"); /*! * \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C"); + void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glonass_bands = "1C"); /*! * \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G". */ - void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G"); + void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1G"); /*! * \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1") @@ -351,12 +351,12 @@ public: /*! * \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); + void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Writes Mixed Galileo/GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); + void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double galileo_obs_time, const std::map& observables); /*! * \brief Writes BDS B1I observables into the RINEX file @@ -374,7 +374,7 @@ public: */ //void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message); - void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono); + void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono); void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono); @@ -388,11 +388,11 @@ public: void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& beidou_dnav_utc, const Beidou_Dnav_Iono& beidou_dnav_iono); + void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model, const Beidou_Dnav_Iono& beidou_dnav_iono); void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model); diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index c5ea3a54a..9db248eb9 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -48,7 +48,7 @@ public: /*! * \brief Default constructor. */ - Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); + Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name = true, const std::string& base_path = "."); /*! * \brief Default destructor. @@ -112,7 +112,7 @@ public: * \param utc_model GLONASS GNAV Clock Information broadcast in string 5 * \return true or false upon operation success */ - bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glo_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model); + bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model); bool Print_Rtcm_MSM(uint32_t msm_number, const Gps_Ephemeris& gps_eph, diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index c6285d699..bfe54fa8e 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -110,6 +110,15 @@ target_include_directories(acquisition_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index e0db64422..5a135364b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -94,6 +94,15 @@ if(OPENCL_FOUND) target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 678cb5f2d..4b8eefec8 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -45,6 +45,15 @@ target_link_libraries(acquisition_libs core_system_parameters ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 14bc0f16b..7bf49e73d 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -41,6 +41,15 @@ target_include_directories(channel_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET channel_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 7a6582046..c055123bc 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -43,6 +43,15 @@ target_link_libraries(channel_libs core_receiver ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET channel_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 92f967849..6e0e68a45 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -47,6 +47,15 @@ target_include_directories(conditioner_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(conditioner_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET conditioner_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 39a4c7216..a9042d832 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -63,6 +63,15 @@ target_include_directories(data_type_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(data_type_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET data_type_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 9201bcc79..f1709bf7f 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -64,6 +64,15 @@ if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET input_filter_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 682c1f01b..72cb7962c 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -51,6 +51,15 @@ target_link_libraries(input_filter_gr_blocks Log4cpp::log4cpp ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET input_filter_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 64ac7c64b..78878897b 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -139,6 +139,23 @@ set_property(TARGET algorithms_libs $ ) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(algorithms_libs + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(algorithms_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() ############################################################################### @@ -161,6 +178,15 @@ target_compile_definitions(gnss_sdr_flags PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss_sdr_flags + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET gnss_sdr_flags APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h index 677dc4a1d..6ab773504 100644 --- a/src/algorithms/libs/geofunctions.h +++ b/src/algorithms/libs/geofunctions.h @@ -102,7 +102,7 @@ double radtodeg(double angleInRadians); double mstoknotsh(double MetersPerSeconds); -double mstokph(double Kph); +double mstokph(double MetersPerSeconds); arma::vec CTM_to_Euler(const arma::mat &C); diff --git a/src/algorithms/libs/rtcm.h b/src/algorithms/libs/rtcm.h index d390dc568..81f199a28 100644 --- a/src/algorithms/libs/rtcm.h +++ b/src/algorithms/libs/rtcm.h @@ -368,7 +368,7 @@ public: void run_server(); // get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); + std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); /*! * \brief Get the contents of the satellite specific portion of a type 1012 Message (GLONASS Extended RTK, L1 & L2) * \details Contents generated for each satellite. See table 3.5-14 @@ -452,7 +452,7 @@ private: * \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite * \return Returns the message content as set of bits */ - std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); + std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::string get_MSM_header(uint32_t msg_number, double obs_time, @@ -1413,10 +1413,10 @@ private: int32_t set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID std::bitset<64> DF394; - int32_t set_DF394(const std::map& observables); + int32_t set_DF394(const std::map& gnss_synchro); std::bitset<32> DF395; - int32_t set_DF395(const std::map& observables); + int32_t set_DF395(const std::map& gnss_synchro); std::string set_DF396(const std::map& observables); diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index 78d5c0b98..a75cd92df 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -43,6 +43,15 @@ target_link_libraries(obs_adapters Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET obs_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index d1fb176eb..e50fabfd2 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -46,6 +46,15 @@ target_link_libraries(obs_gr_blocks algorithms_libs ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET obs_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 58d7e2099..18554d352 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -56,6 +56,15 @@ if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET resampler_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 5b4c38b99..e5193d7eb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -48,6 +48,15 @@ target_link_libraries(resampler_gr_blocks Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET resampler_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index 8797cb514..fb651871e 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(signal_generator_adapters target_link_libraries(signal_generator_adapters PUBLIC Gnuradio::blocks - signal_generator_blocks + signal_generator_gr_blocks PRIVATE Gflags::gflags Glog::glog @@ -41,6 +41,15 @@ target_include_directories(signal_generator_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_generator_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 87990a094..99e7debab 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -21,12 +21,12 @@ set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) -add_library(signal_generator_blocks +add_library(signal_generator_gr_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -target_link_libraries(signal_generator_blocks +target_link_libraries(signal_generator_gr_blocks PUBLIC Boost::boost Gnuradio::runtime @@ -36,12 +36,21 @@ target_link_libraries(signal_generator_blocks algorithms_libs ) -target_include_directories(signal_generator_blocks +target_include_directories(signal_generator_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs ) -set_property(TARGET signal_generator_blocks +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_generator_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index e0233ad6f..5374a6fbf 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -253,6 +253,15 @@ target_compile_definitions(signal_source_adapters PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 6f6f549df..fd9fc9751 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -48,7 +48,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(std::move(role)), + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 5ad9ffe2e..4a4a264d2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -75,6 +75,24 @@ if(ENABLE_RAW_UDP AND PCAP_FOUND) ) endif() +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(signal_source_gr_blocks + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) 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 33f3cb73e..876a38d1d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -102,7 +102,7 @@ private: std::vector work_buffer_; public: - unpack_2bit_samples(bool big_endianBytes, + unpack_2bit_samples(bool big_endian_bytes, size_t item_size, bool big_endian_items, bool reverse_interleaving); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index 28ef0b073..dcb0552ca 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -47,7 +47,7 @@ public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); - void decode_4bits_word(uint32_t input_int32, gr_complex *out, int adc_bits); + void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits); unpack_spir_gss6450_samples(unsigned int adc_nbit); ~unpack_spir_gss6450_samples(); diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 7f07471ea..f6015ec59 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -93,6 +93,15 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index cf8ca684d..17eb17e5d 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -67,6 +67,15 @@ target_include_directories(telemetry_decoder_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 6c76801de..8e71b0681 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -61,6 +61,15 @@ target_link_libraries(telemetry_decoder_gr_blocks Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 866c8957b..a802b970c 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -44,6 +44,15 @@ target_link_libraries(telemetry_decoder_libs Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index c2ae1327a..510673200 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -55,7 +55,7 @@ public: */ float decode_block(const double input_c[], int* output_u_int, const int LL); - float decode_continuous(const double sym[], const int traceback_depth, int output_u_int[], + float decode_continuous(const double sym[], const int traceback_depth, int bits[], const int nbits_requested, int& nbits_decoded); private: @@ -113,7 +113,7 @@ private: void init_trellis_state(); int do_acs(const double sym[], int nbits); int do_traceback(std::size_t traceback_length); - int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int bits[], float& indicator_metric); + int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int output_u_int[], float& indicator_metric); // branch metric function float gamma(const float rec_array[], int symbol, int nn); diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 34c62dfb2..e51180bf6 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -116,6 +116,15 @@ if(ENABLE_CUDA) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 340b2bc89..358e952c9 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -48,7 +48,7 @@ using google::LogMessage; GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index 3000ac8ae..15e7f650b 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -47,7 +47,7 @@ using google::LogMessage; GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 3341d142a..48da0fc1b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -102,6 +102,15 @@ if(ENABLE_CUDA) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index e4acf778b..96305fc0b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -61,7 +61,7 @@ gps_l1_ca_kf_make_tracking_cc(uint32_t order, int64_t fs_in, uint32_t vector_length, bool dump, std::string dump_filename, - float pll_bw_hz, + float dll_bw_hz, float early_late_space_chips, bool bce_run, uint32_t bce_ptrans, diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 4607478ee..7a7951645 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -91,6 +91,24 @@ target_include_directories(tracking_libs ${OPT_TRACKING_INCLUDES} ) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(tracking_libs + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index d99d6f494..68b52890c 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -51,6 +51,15 @@ target_link_libraries(core_libs Pugixml::pugixml ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c index 75903fde7..1bf467254 100644 --- a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c +++ b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c @@ -63,8 +63,8 @@ /* * See the definitions. */ -static int _fetch_present_idx(const void *struct_ptr, int off, int size); -static void _set_present_idx(void *sptr, int offset, int size, int pres); +static int _fetch_present_idx(const void *struct_ptr, int pres_offset, int size); +static void _set_present_idx(void *struct_ptr, int offset, int size, int pres); /* * Tags are canonically sorted in the tag to member table. diff --git a/src/core/libs/supl/asn-rrlp/converter-sample.c b/src/core/libs/supl/asn-rrlp/converter-sample.c index 46136ebb3..af980a1d6 100644 --- a/src/core/libs/supl/asn-rrlp/converter-sample.c +++ b/src/core/libs/supl/asn-rrlp/converter-sample.c @@ -34,7 +34,7 @@ extern asn_TYPE_descriptor_t *asn_pdu_collection[]; /* * Open file and parse its contens. */ -static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU, +static void *data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *name, ssize_t suggested_bufsize, int first_pdu); static int write_out(const void *buffer, size_t size, void *key); static FILE *argument_to_file(char *av[], int idx); diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.h b/src/core/libs/supl/asn-supl/GeneralizedTime.h index 657461d0f..3867820e3 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.h +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.h @@ -34,13 +34,13 @@ extern "C" * instead of default local one. * On error returns -1 and errno set to EINVAL */ - time_t asn_GT2time(const GeneralizedTime_t * /*st*/, struct tm *_optional_tm4fill, + time_t asn_GT2time(const GeneralizedTime_t * /*st*/, struct tm *ret_tm, int as_gmt); /* A version of the above function also returning the fractions of seconds */ time_t asn_GT2time_frac(const GeneralizedTime_t * /*st*/, int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ - struct tm *_optional_tm4fill, int as_gmt); + struct tm *ret_tm, int as_gmt); /* * Another version returning fractions with defined precision @@ -49,7 +49,7 @@ extern "C" */ time_t asn_GT2time_prec(const GeneralizedTime_t * /*st*/, int *frac_value, int frac_digits, - struct tm *_optional_tm4fill, int as_gmt); + struct tm *ret_tm, int as_gmt); /* * Convert a struct tm into GeneralizedTime. @@ -58,9 +58,9 @@ extern "C" * into a GMT time zone (encoding ends with a "Z"). * On error, this function returns 0 and sets errno. */ - GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, + GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *opt_gt, const struct tm * /*tm*/, int force_gmt); - GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, + GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm * /*tm*/, int frac_value, int frac_digits, int force_gmt); #ifdef __cplusplus diff --git a/src/core/libs/supl/asn-supl/INTEGER.h b/src/core/libs/supl/asn-supl/INTEGER.h index 2acd13ab9..e389e6b43 100644 --- a/src/core/libs/supl/asn-supl/INTEGER.h +++ b/src/core/libs/supl/asn-supl/INTEGER.h @@ -57,8 +57,8 @@ extern "C" */ int asn_INTEGER2long(const INTEGER_t *i, long *l); int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); - int asn_long2INTEGER(INTEGER_t *i, long l); - int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); + int asn_long2INTEGER(INTEGER_t *st, long value); + int asn_ulong2INTEGER(INTEGER_t *st, unsigned long value); /* * Convert the integer value into the corresponding enumeration map entry. diff --git a/src/core/libs/supl/asn-supl/OCTET_STRING.h b/src/core/libs/supl/asn-supl/OCTET_STRING.h index 124fde559..9387a4d4b 100644 --- a/src/core/libs/supl/asn-supl/OCTET_STRING.h +++ b/src/core/libs/supl/asn-supl/OCTET_STRING.h @@ -48,7 +48,7 @@ extern "C" * current contents of the OCTET STRING. * Returns 0 if it was possible to perform operation, -1 otherwise. */ - int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int len); /* Handy conversion from the C string into the OCTET STRING. */ #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) @@ -59,7 +59,7 @@ extern "C" * empty OCTET STRING. */ OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, - const char *str, int size); + const char *str, int len); /**************************** * Internally useful stuff. * diff --git a/src/core/libs/supl/asn-supl/UTCTime.h b/src/core/libs/supl/asn-supl/UTCTime.h index 477c7931d..c8e73785c 100644 --- a/src/core/libs/supl/asn-supl/UTCTime.h +++ b/src/core/libs/supl/asn-supl/UTCTime.h @@ -27,7 +27,7 @@ extern "C" struct tm; /* */ /* See asn_GT2time() in GeneralizedTime.h */ - time_t asn_UT2time(const UTCTime_t * /*st*/, struct tm *_optional_tm4fill, int as_gmt); + time_t asn_UT2time(const UTCTime_t * /*st*/, struct tm *_tm, int as_gmt); /* See asn_time2GT() in GeneralizedTime.h */ UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm * /*tm*/, int force_gmt); diff --git a/src/core/libs/supl/asn-supl/asn_codecs_prim.h b/src/core/libs/supl/asn-supl/asn_codecs_prim.h index cb8c37937..6ebaefb87 100644 --- a/src/core/libs/supl/asn-supl/asn_codecs_prim.h +++ b/src/core/libs/supl/asn-supl/asn_codecs_prim.h @@ -41,8 +41,8 @@ extern "C" * Also see xer_decode_general() in xer_decoder.h */ asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, size_t struct_size, + asn_TYPE_descriptor_t *td, + void **sptr, size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, xer_primitive_body_decoder_f *prim_body_decoder); diff --git a/src/core/libs/supl/asn-supl/ber_decoder.h b/src/core/libs/supl/asn-supl/ber_decoder.h index 6a87fc23f..629aff043 100644 --- a/src/core/libs/supl/asn-supl/ber_decoder.h +++ b/src/core/libs/supl/asn-supl/ber_decoder.h @@ -23,7 +23,7 @@ extern "C" asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ + const void *ptr, /* Data to be decoded */ size_t size /* Size of that buffer */ ); @@ -49,7 +49,7 @@ extern "C" */ asn_dec_rval_t ber_check_tags( struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, asn_struct_ctx_t *opt_ctx, /* saved decoding context */ const void *ptr, size_t size, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ diff --git a/src/core/libs/supl/asn-supl/ber_tlv_tag.h b/src/core/libs/supl/asn-supl/ber_tlv_tag.h index c8361549a..fa4c7321c 100644 --- a/src/core/libs/supl/asn-supl/ber_tlv_tag.h +++ b/src/core/libs/supl/asn-supl/ber_tlv_tag.h @@ -33,7 +33,7 @@ extern "C" * (i.e. "[PRIVATE 0]"). * Return values correspond to their libc counterparts (if any). */ - ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); + ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size); ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE * /*f*/); char *ber_tlv_tag_string(ber_tlv_tag_t tag); diff --git a/src/core/libs/supl/asn-supl/constr_CHOICE.c b/src/core/libs/supl/asn-supl/constr_CHOICE.c index 75903fde7..1bf467254 100644 --- a/src/core/libs/supl/asn-supl/constr_CHOICE.c +++ b/src/core/libs/supl/asn-supl/constr_CHOICE.c @@ -63,8 +63,8 @@ /* * See the definitions. */ -static int _fetch_present_idx(const void *struct_ptr, int off, int size); -static void _set_present_idx(void *sptr, int offset, int size, int pres); +static int _fetch_present_idx(const void *struct_ptr, int pres_offset, int size); +static void _set_present_idx(void *struct_ptr, int offset, int size, int pres); /* * Tags are canonically sorted in the tag to member table. diff --git a/src/core/libs/supl/asn-supl/der_encoder.h b/src/core/libs/supl/asn-supl/der_encoder.h index 3eafbc281..059e83f70 100644 --- a/src/core/libs/supl/asn-supl/der_encoder.h +++ b/src/core/libs/supl/asn-supl/der_encoder.h @@ -53,7 +53,7 @@ extern "C" * Write out leading TL[v] sequence according to the type definition. */ ssize_t der_write_tags( - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *sd, size_t struct_length, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ int last_tag_form, /* {0,!0}: prim, constructed */ diff --git a/src/core/libs/supl/asn-supl/per_decoder.h b/src/core/libs/supl/asn-supl/per_decoder.h index a28509464..4e410c5b2 100644 --- a/src/core/libs/supl/asn-supl/per_decoder.h +++ b/src/core/libs/supl/asn-supl/per_decoder.h @@ -20,8 +20,8 @@ extern "C" * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. */ asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ + struct asn_TYPE_descriptor_s *td, /* Type to decode */ + void **sptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ ); @@ -31,8 +31,8 @@ extern "C" * WARNING: This call returns the number of BITS read from the stream. Beware. */ asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ + struct asn_TYPE_descriptor_s *td, /* Type to decode */ + void **sptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size, /* Size of data buffer */ int skip_bits, /* Number of unused leading bits, 0..7 */ diff --git a/src/core/libs/supl/asn-supl/per_encoder.h b/src/core/libs/supl/asn-supl/per_encoder.h index 896013095..3f931769d 100644 --- a/src/core/libs/supl/asn-supl/per_encoder.h +++ b/src/core/libs/supl/asn-supl/per_encoder.h @@ -21,8 +21,8 @@ extern "C" * field of the return value. Use the following formula to convert to bytes: * bytes = ((.encoded + 7) / 8) */ - asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ void *app_key /* Arbitrary callback argument */ ); @@ -33,8 +33,8 @@ extern "C" * field of the return value. */ asn_enc_rval_t uper_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ void *buffer, /* Pre-allocated buffer */ size_t buffer_size /* Initial buffer size (max) */ ); @@ -47,9 +47,9 @@ extern "C" * encoding of uper_encode() and uper_encode_to_buffer(). */ ssize_t uper_encode_to_new_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, asn_per_constraints_t *constraints, - void *struct_ptr, /* Structure to be encoded */ + void *sptr, /* Structure to be encoded */ void **buffer_r /* Buffer allocated and returned */ ); diff --git a/src/core/libs/supl/asn-supl/per_support.h b/src/core/libs/supl/asn-supl/per_support.h index c99f12291..7ea76d331 100644 --- a/src/core/libs/supl/asn-supl/per_support.h +++ b/src/core/libs/supl/asn-supl/per_support.h @@ -56,24 +56,24 @@ extern "C" * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ - int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); + int32_t per_get_few_bits(asn_per_data_t *pd, int get_nbits); /* Undo the immediately preceeding "get_few_bits" operation */ - void per_get_undo(asn_per_data_t *per_data, int get_nbits); + void per_get_undo(asn_per_data_t *pd, int get_nbits); /* * Extract a large number of bits from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ - int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, + int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int get_nbits); /* * Get the length "n" from the Unaligned PER stream. */ ssize_t uper_get_length(asn_per_data_t *pd, - int effective_bound_bits, + int ebits, int *repeat); /* @@ -87,7 +87,7 @@ extern "C" ssize_t uper_get_nsnnwn(asn_per_data_t *pd); /* X.691-2008/11, #11.5.6 */ - int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); + int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits); /* Non-thread-safe debugging function, don't use it */ char *per_data_string(asn_per_data_t *pd); @@ -107,7 +107,7 @@ extern "C" } asn_per_outp_t; /* Output a small number of bits (<= 31) */ - int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); + int per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits); /* Output a large number of bits */ int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); diff --git a/src/core/libs/supl/asn-supl/xer_decoder.h b/src/core/libs/supl/asn-supl/xer_decoder.h index 52444af51..02f62a0e1 100644 --- a/src/core/libs/supl/asn-supl/xer_decoder.h +++ b/src/core/libs/supl/asn-supl/xer_decoder.h @@ -18,7 +18,7 @@ extern "C" * The XER decoder of any ASN.1 type. May be invoked by the application. */ asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ diff --git a/src/core/libs/supl/asn-supl/xer_encoder.h b/src/core/libs/supl/asn-supl/xer_encoder.h index 5b640d425..9cbd08102 100644 --- a/src/core/libs/supl/asn-supl/xer_encoder.h +++ b/src/core/libs/supl/asn-supl/xer_encoder.h @@ -25,8 +25,8 @@ extern "C" /* * The XER encoder of any type. May be invoked by the application. */ - asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key /* Arbitrary callback argument */ diff --git a/src/core/libs/supl/asn-supl/xer_support.h b/src/core/libs/supl/asn-supl/xer_support.h index 13d8bbd06..e28316d59 100644 --- a/src/core/libs/supl/asn-supl/xer_support.h +++ b/src/core/libs/supl/asn-supl/xer_support.h @@ -47,7 +47,7 @@ extern "C" * It will always be lesser than or equal to the specified _size. * The next invocation of this function must account the difference. */ - ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + ssize_t pxml_parse(int *_stateContext, const void *xmlbuf, size_t _size, pxml_callback_f *cb, void *_key); #ifdef __cplusplus diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index fc64e1ecd..2f997d6f3 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -243,7 +243,7 @@ void supl_set_wcdma_cell(supl_ctx_t *ctx, int mcc, int mns, int uc); void supl_set_gsm_cell_known(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci, double lat, double lon, int uncert); void supl_set_server(supl_ctx_t *ctx, char *server); void supl_set_fd(supl_ctx_t *ctx, int fd); -void supl_request(supl_ctx_t *ctx, int flags); +void supl_request(supl_ctx_t *ctx, int request); int supl_get_assist(supl_ctx_t *ctx, char *server, supl_assist_t *assist); void supl_set_debug(FILE *log, int flags); diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 73ddc1d9d..4549006c4 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -44,11 +44,27 @@ target_link_libraries(core_monitor Gnuradio::runtime core_system_parameters PRIVATE - Gflags::gflags - Glog::glog Gnuradio::pmt ) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(core_monitor + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_monitor + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_monitor APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 49b609ce6..d52fb10d7 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -33,15 +33,11 @@ #include "gnss_synchro_monitor.h" #include "gnss_synchro.h" -#include #include #include #include -using google::LogMessage; - - gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, int decimation_factor, int udp_port, diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 696e6a4e8..632fa72ed 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -56,7 +56,7 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, class gnss_synchro_monitor : public gr::sync_block { private: - friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int nchannels, + friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses); @@ -71,7 +71,7 @@ private: public: - gnss_synchro_monitor(unsigned int nchannels, + gnss_synchro_monitor(unsigned int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses); diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 065cca98c..538f2d72a 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -159,6 +159,24 @@ target_link_libraries(core_receiver pvt_adapters ) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(core_receiver + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_receiver + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_receiver APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ $ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 5ebb96ad0..75efbae2d 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -1051,7 +1051,7 @@ void ControlThread::sysv_queue_listener() { typedef struct { - long mtype; // required by SysV queue messaging + long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging double stop_message; } stop_msgbuf; diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index bc1e89cc4..262aab718 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -117,6 +117,15 @@ target_link_libraries(core_system_parameters Gflags::gflags ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_system_parameters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_system_parameters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 97408e452..93c1c9a24 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -296,7 +296,7 @@ public: * \brief Computes the Coordinated Universal Time (UTC) and * returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4) */ - double utc_time(const double gpstime_corrected) const; + double utc_time(const double beidoutime_corrected) const; bool satellite_validation(); diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 40f0c3ff9..ad785f0f0 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -68,6 +68,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss-sdr + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f3da0060f..afe871fdd 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -701,7 +701,7 @@ if(NOT ENABLE_PACKAGING) GTest::GTest GTest::Main Volkgnsssdr::volkgnsssdr - signal_generator_blocks + signal_generator_gr_blocks signal_source_gr_blocks signal_source_libs acquisition_adapters @@ -746,7 +746,7 @@ if(NOT ENABLE_PACKAGING) signal_source_libs algorithms_libs tracking_adapters - signal_generator_blocks + signal_generator_gr_blocks core_receiver core_system_parameters )