From 49eb161d9034c42e9218d17f424719024457de2b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 24 Nov 2023 14:00:53 +0100 Subject: [PATCH 01/34] Add -fsanitize=undefined to ASAN build --- cmake/Modules/GnsssdrBuildTypes.cmake | 4 ++-- .../volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake index ddb12df6b..0e3507a1b 100644 --- a/cmake/Modules/GnsssdrBuildTypes.cmake +++ b/cmake/Modules/GnsssdrBuildTypes.cmake @@ -191,9 +191,9 @@ endif() # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" CACHE STRING "Flags used by the C++ compiler during Address Sanitized builds." FORCE) - set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" CACHE STRING "Flags used by the C compiler during Address Sanitized builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_ASAN "-W" CACHE STRING diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake index b828082f8..16cb6117e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake @@ -253,9 +253,9 @@ endif() # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" CACHE STRING "Flags used by the C++ compiler during Address Sanitized builds." FORCE) - set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" CACHE STRING "Flags used by the C compiler during Address Sanitized builds." FORCE) mark_as_advanced( CMAKE_CXX_FLAGS_ASAN From caef6acdd4fba6973ab7795e64dbc25b152498a7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 24 Nov 2023 22:04:24 +0100 Subject: [PATCH 02/34] Adjust number of decimal places displayed in terminal --- docs/CHANGELOG.md | 5 +++++ .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 17 ++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 162df725f..dadd11630 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -71,6 +71,11 @@ All notable changes to GNSS-SDR will be documented in this file. - The estimated CN0 value is now printed in the terminal when navigation data is succesfully decoded. - Fixed GPS navigation message satellite validation. +- Latitude and longitude are now reported in the terminal with six decimal + places (the sixth decimal place worths up to 0.11 m), instead of the + overkilling nine (the ninth decimal place worths up to 110 microns). + Similarly, height in meters is now reported with two decimal places instead of + three, and velocity in m/s also with two decimal places instead of three. ## [GNSS-SDR v0.0.18](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.18) - 2023-04-06 diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index ca63c6f31..7c14b6350 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -2403,22 +2403,17 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << TEXT_BOLD_GREEN << "Position at " << time_solution << UTC_solution_str - << " using " << d_user_pvt_solver->get_num_valid_observations() - << std::fixed << std::setprecision(9) - << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() - << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]" << TEXT_RESET << '\n'; - - std::cout << std::setprecision(ss); + << " using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " + << std::fixed << std::setprecision(6) << d_user_pvt_solver->get_latitude() + << " [deg], Long = " << d_user_pvt_solver->get_longitude() << " [deg], Height = " + << std::fixed << std::setprecision(2) << d_user_pvt_solver->get_height() << std::setprecision(ss) << " [m]" << TEXT_RESET << std::endl; DLOG(INFO) << "RX clock offset: " << d_user_pvt_solver->get_time_offset_s() << "[s]"; std::cout << TEXT_BOLD_GREEN - << "Velocity: " << std::fixed << std::setprecision(3) + << "Velocity: " << std::fixed << std::setprecision(2) << "East: " << d_user_pvt_solver->get_rx_vel()[0] << " [m/s], North: " << d_user_pvt_solver->get_rx_vel()[1] - << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << " [m/s]" << TEXT_RESET << '\n'; - - std::cout << std::setprecision(ss); + << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << std::setprecision(ss) << " [m/s]" << TEXT_RESET << std::endl; DLOG(INFO) << "RX clock drift: " << d_user_pvt_solver->get_clock_drift_ppm() << " [ppm]"; // boost::posix_time::ptime p_time; From 5ef12c8244dbaeb3dde837bef5a827b68caf3e09 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 25 Nov 2023 14:21:28 +0100 Subject: [PATCH 03/34] CI: improve python version handling --- .github/workflows/main.yml | 43 ++++++++++++-------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc1fb280f..11b50e04a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,19 +40,13 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + check-latest: true - name: install dependencies run: | brew update - rm /usr/local/bin/2to3 || true - rm /usr/local/bin/idle3 || true - rm /usr/local/bin/pydoc3 || true - rm /usr/local/bin/python3 || true - rm /usr/local/bin/python3-config || true - rm /usr/local/bin/2to3-3.11 || true - rm /usr/local/bin/idle3.11 || true - rm /usr/local/bin/pydoc3.11 || true - rm /usr/local/bin/python3.11 || true - rm /usr/local/bin/python3.11-config || true brew install ninja hdf5 automake armadillo lapack \ gflags glog gnuradio log4cpp openssl pugixml protobuf pip3 install mako @@ -69,19 +63,13 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + check-latest: true - name: install dependencies run: | brew update - rm /usr/local/bin/2to3 || true - rm /usr/local/bin/idle3 || true - rm /usr/local/bin/pydoc3 || true - rm /usr/local/bin/python3 || true - rm /usr/local/bin/python3-config || true - rm /usr/local/bin/2to3-3.11 || true - rm /usr/local/bin/idle3.11 || true - rm /usr/local/bin/pydoc3.11 || true - rm /usr/local/bin/python3.11 || true - rm /usr/local/bin/python3.11-config || true brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog \ gnuradio log4cpp openssl pugixml protobuf pip3 install mako @@ -117,19 +105,13 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + check-latest: true - name: install dependencies run: | brew update - rm /usr/local/bin/2to3 || true - rm /usr/local/bin/idle3 || true - rm /usr/local/bin/pydoc3 || true - rm /usr/local/bin/python3 || true - rm /usr/local/bin/python3-config || true - rm /usr/local/bin/2to3-3.11 || true - rm /usr/local/bin/idle3.11 || true - rm /usr/local/bin/pydoc3.11 || true - rm /usr/local/bin/python3.11 || true - rm /usr/local/bin/python3.11-config || true brew install llvm pkg-config hdf5 armadillo lapack gflags glog gnuradio libmatio \ log4cpp openssl pugixml protobuf pip3 install mako @@ -195,6 +177,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.12' + check-latest: true - name: Install dependencies run: | python -m pip install --upgrade pip From 132f85079aca8f865663ee3cc4af951d4afbc4ef Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 26 Nov 2023 08:57:35 +0100 Subject: [PATCH 04/34] Pass msg by reference isntead of by value --- src/algorithms/PVT/libs/rtcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/rtcm.h b/src/algorithms/PVT/libs/rtcm.h index 338c36a8d..23d10db71 100644 --- a/src/algorithms/PVT/libs/rtcm.h +++ b/src/algorithms/PVT/libs/rtcm.h @@ -810,7 +810,7 @@ private: inline void write(const Rtcm_Message& msg) { io_context_.post( - [this, msg]() { + [this, &msg]() { bool write_in_progress = !write_msgs_.empty(); write_msgs_.push_back(msg); if (!write_in_progress) From 7c9118a33fcaf7c1d73e0d42a403a4e906a86b8f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 26 Nov 2023 10:18:58 +0100 Subject: [PATCH 05/34] Fix building with latest GNU Radio --- cmake/Modules/FindGNURADIO.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index 9d6926e36..5ce37cba6 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -406,7 +406,7 @@ if(GNURADIO_RUNTIME_INCLUDE_DIRS) if("#include " STREQUAL "${_file_line}") set(_uses_log4cpp TRUE) endif() - if("#include " STREQUAL "${_file_line}") + if("#include " STREQUAL "${_file_line}") set(_uses_spdlog TRUE) endif() endforeach() From 0f42dbdea49c5bc75a10b185a45557a97f2e8b2a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 26 Nov 2023 10:55:48 +0100 Subject: [PATCH 06/34] Revert "CI: improve python version handling" This reverts commit 5ef12c8244dbaeb3dde837bef5a827b68caf3e09. --- .github/workflows/main.yml | 43 ++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11b50e04a..bc1fb280f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,13 +40,19 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - check-latest: true - name: install dependencies run: | brew update + rm /usr/local/bin/2to3 || true + rm /usr/local/bin/idle3 || true + rm /usr/local/bin/pydoc3 || true + rm /usr/local/bin/python3 || true + rm /usr/local/bin/python3-config || true + rm /usr/local/bin/2to3-3.11 || true + rm /usr/local/bin/idle3.11 || true + rm /usr/local/bin/pydoc3.11 || true + rm /usr/local/bin/python3.11 || true + rm /usr/local/bin/python3.11-config || true brew install ninja hdf5 automake armadillo lapack \ gflags glog gnuradio log4cpp openssl pugixml protobuf pip3 install mako @@ -63,13 +69,19 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - check-latest: true - name: install dependencies run: | brew update + rm /usr/local/bin/2to3 || true + rm /usr/local/bin/idle3 || true + rm /usr/local/bin/pydoc3 || true + rm /usr/local/bin/python3 || true + rm /usr/local/bin/python3-config || true + rm /usr/local/bin/2to3-3.11 || true + rm /usr/local/bin/idle3.11 || true + rm /usr/local/bin/pydoc3.11 || true + rm /usr/local/bin/python3.11 || true + rm /usr/local/bin/python3.11-config || true brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog \ gnuradio log4cpp openssl pugixml protobuf pip3 install mako @@ -105,13 +117,19 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - check-latest: true - name: install dependencies run: | brew update + rm /usr/local/bin/2to3 || true + rm /usr/local/bin/idle3 || true + rm /usr/local/bin/pydoc3 || true + rm /usr/local/bin/python3 || true + rm /usr/local/bin/python3-config || true + rm /usr/local/bin/2to3-3.11 || true + rm /usr/local/bin/idle3.11 || true + rm /usr/local/bin/pydoc3.11 || true + rm /usr/local/bin/python3.11 || true + rm /usr/local/bin/python3.11-config || true brew install llvm pkg-config hdf5 armadillo lapack gflags glog gnuradio libmatio \ log4cpp openssl pugixml protobuf pip3 install mako @@ -177,7 +195,6 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.12' - check-latest: true - name: Install dependencies run: | python -m pip install --upgrade pip From cfb6f283d42c39735044e3bbca93f5a0534c00d9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 27 Nov 2023 13:41:55 +0100 Subject: [PATCH 07/34] Fix some performance inefficiencies detected by Coverity Scan --- .../acquisition/adapters/beidou_b1i_pcps_acquisition.h | 2 +- .../acquisition/adapters/beidou_b3i_pcps_acquisition.h | 2 +- .../adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h | 2 +- .../adapters/galileo_e1_pcps_ambiguous_acquisition.h | 2 +- .../galileo_e1_pcps_ambiguous_acquisition_fpga.h | 2 +- .../galileo_e1_pcps_cccwsr_ambiguous_acquisition.h | 2 +- .../galileo_e1_pcps_quicksync_ambiguous_acquisition.h | 2 +- .../galileo_e1_pcps_tong_ambiguous_acquisition.h | 2 +- .../galileo_e5a_noncoherent_iq_acquisition_caf.h | 2 +- .../acquisition/adapters/galileo_e5a_pcps_acquisition.h | 2 +- .../adapters/galileo_e5a_pcps_acquisition_fpga.h | 2 +- .../acquisition/adapters/galileo_e5b_pcps_acquisition.h | 2 +- .../adapters/galileo_e5b_pcps_acquisition_fpga.h | 2 +- .../acquisition/adapters/galileo_e6_pcps_acquisition.h | 2 +- .../adapters/glonass_l1_ca_pcps_acquisition.h | 2 +- .../adapters/glonass_l2_ca_pcps_acquisition.h | 2 +- .../acquisition/adapters/gps_l1_ca_pcps_acquisition.h | 2 +- .../adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h | 2 +- .../adapters/gps_l1_ca_pcps_acquisition_fpga.h | 2 +- .../adapters/gps_l1_ca_pcps_assisted_acquisition.h | 2 +- .../adapters/gps_l1_ca_pcps_opencl_acquisition.h | 2 +- .../adapters/gps_l1_ca_pcps_quicksync_acquisition.h | 2 +- .../adapters/gps_l1_ca_pcps_tong_acquisition.h | 2 +- .../acquisition/adapters/gps_l2_m_pcps_acquisition.h | 2 +- .../adapters/gps_l2_m_pcps_acquisition_fpga.h | 2 +- .../acquisition/adapters/gps_l5i_pcps_acquisition.h | 2 +- .../acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h | 2 +- .../galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc | 2 +- .../gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc | 2 +- .../gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc | 2 +- .../gnuradio_blocks/pcps_assisted_acquisition_cc.cc | 2 +- .../gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc | 2 +- .../gnuradio_blocks/pcps_opencl_acquisition_cc.cc | 2 +- .../gnuradio_blocks/pcps_quicksync_acquisition_cc.cc | 2 +- .../gnuradio_blocks/pcps_tong_acquisition_cc.cc | 2 +- .../volk_gnsssdr/apps/volk_gnsssdr_profile.cc | 2 +- .../gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc | 5 +++-- .../gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc | 5 +++-- .../gnuradio_blocks/galileo_telemetry_decoder_gs.cc | 4 ++-- .../glonass_l1_ca_telemetry_decoder_gs.cc | 5 +++-- .../glonass_l2_ca_telemetry_decoder_gs.cc | 5 +++-- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 5 +++-- .../gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc | 3 ++- .../gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc | 5 +++-- .../gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc | 3 ++- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 2 +- .../gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 2 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 4 ++-- .../glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 4 ++-- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 4 ++-- .../gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc | 4 ++-- .../glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 4 ++-- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 4 ++-- .../gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc | 4 ++-- .../gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 5 +++-- .../gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc | 4 ++-- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 4 ++-- .../signal-processing-blocks/pvt/rinex_printer_test.cc | 9 +++++---- 58 files changed, 88 insertions(+), 78 deletions(-) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index b56489784..a5a659369 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -97,7 +97,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h index 1e5b082bf..ccbaf8c53 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h @@ -96,7 +96,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index 9d0ed9abe..7903dff58 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -93,7 +93,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index ec2e2299e..995c2570a 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -96,7 +96,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index 597d9975a..0352d4dbd 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -122,7 +122,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 284b5872a..fb53e690d 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -94,7 +94,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 78b8a582f..7ba948513 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -94,7 +94,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! * \brief Set statistics threshold of PCPS algorithm diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 250f8508c..33390e134 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -94,7 +94,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! * \brief Set statistics threshold of TONG algorithm diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 2a5fa33a2..66323eb11 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -94,7 +94,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 0a300e883..2b0f35050 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -87,7 +87,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index a33f6738e..f57d5d3b0 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -122,7 +122,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h index 48c2bd4d2..76de8b140 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h @@ -118,7 +118,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h index 33545bd2b..34abc3ba6 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h @@ -121,7 +121,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h index 21e2e166f..2902177a7 100644 --- a/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h @@ -96,7 +96,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 938fe0021..84999e6df 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -98,7 +98,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index 3927bd4f2..6d0f68eb4 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -97,7 +97,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 6ad39ab03..5c79bd7de 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -102,7 +102,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 01ef4e245..f59db4494 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -96,7 +96,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index f187d77c0..57786c570 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -123,7 +123,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index 099c38528..2745218ef 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -95,7 +95,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 6f73fd97e..880d94281 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -93,7 +93,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index be692b317..f10cbdaa5 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -96,7 +96,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index b7c7a119b..2a7ba680f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -94,7 +94,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_cc_->set_channel_fsm(channel_fsm); + acquisition_cc_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 8a3627f81..5f9e41615 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -98,7 +98,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index d105ea7e2..2003ab5a7 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -98,7 +98,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 820329821..0578ae793 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -97,7 +97,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_->set_channel_fsm(channel_fsm); + acquisition_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index c68cd7bda..3a6beaf7e 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -125,7 +125,7 @@ public: inline void set_channel_fsm(std::weak_ptr channel_fsm) override { channel_fsm_ = channel_fsm; - acquisition_fpga_->set_channel_fsm(channel_fsm); + acquisition_fpga_->set_channel_fsm(channel_fsm_); } /*! diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 1e0f945b5..98861361b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -730,7 +730,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); return_value = 1; // Number of Gnss_Synchro objects produced } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index e123424d6..17d697fed 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -381,7 +381,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index a1941a060..270238767 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -566,7 +566,7 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); return_value = 1; // Number of Gnss_Synchro objects produced } break; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index 56f4b56b3..3d919f87f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -427,7 +427,7 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } break; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 8498b7c27..e16d184a3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -403,7 +403,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } 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 0d364bdd6..2f0e3662a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -765,7 +765,7 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 44dcb4c73..39bac577c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -507,7 +507,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, auto** out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index 9563f3af6..f072dcd6a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -403,7 +403,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items, auto **out = reinterpret_cast(&output_items[0]); Gnss_Synchro current_synchro_data = Gnss_Synchro(); current_synchro_data = *d_gnss_synchro; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); noutput_items = 1; // Number of Gnss_Synchro objects produced } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index d3c9269e0..5a060c3d1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -232,7 +232,7 @@ void read_results(std::vector *results, std::string if (single_kernel_result.size() == 3) { - volk_gnsssdr_test_results_t kernel_result; + volk_gnsssdr_test_results_t kernel_result{}; kernel_result.name = std::string(single_kernel_result[0]); kernel_result.config_name = std::string(single_kernel_result[0]); kernel_result.best_arch_u = std::string(single_kernel_result[1]); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index 6798a2e17..0edbfee36 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -36,6 +36,7 @@ #include // for setprecision #include // for cout #include // for shared_ptr, make_shared +#include // for std::move #define CRC_ERROR_LIMIT 8 @@ -702,8 +703,8 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + *out[0] = std::move(current_symbol); return 1; } return 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc index dcd4609d0..a1fd40555 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc @@ -35,6 +35,7 @@ #include // for setprecision #include // for cout #include // for shared_ptr, make_shared +#include // for std::move #define CRC_ERROR_LIMIT 8 @@ -726,8 +727,8 @@ int beidou_b3i_telemetry_decoder_gs::general_work( } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + *out[0] = std::move(current_symbol); return 1; } return 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index e597555aa..fbaaaa84f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -1399,8 +1399,8 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( LOG(WARNING) << "Exception writing navigation data dump file " << e.what(); } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + *out[0] = std::move(current_symbol); return 1; } return 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc index 3d6aacbcc..b2cc50cf8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc @@ -33,6 +33,7 @@ #include // for std::setprecision #include // for cout #include // for shared_ptr, make_shared +#include // for std::move #define CRC_ERROR_LIMIT 6 @@ -525,8 +526,8 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + *out[0] = std::move(current_symbol); return 1; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc index 2340b59ff..473e5eb73 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc @@ -33,6 +33,7 @@ #include // for std::setprecision #include // for cout #include // for shared_ptr, make_shared +#include // for std::move #define CRC_ERROR_LIMIT 6 @@ -528,8 +529,8 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + *out[0] = std::move(current_symbol); return 1; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index bf8b9ba21..178eb8bd4 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -36,6 +36,7 @@ #include // for setprecision #include // for cout #include // for shared_ptr +#include // for std::move #include #ifdef COMPILER_HAS_ROTL @@ -659,8 +660,8 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ } } - // 3. Make the output (copy the object contents to the GNU Radio reserved memory) - *out[0] = current_symbol; + // 3. Make the output (move the object contents to the GNU Radio reserved memory) + *out[0] = std::move(current_symbol); return 1; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc index 60b33d5b7..b745738da 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc @@ -35,6 +35,7 @@ #include // for setprecision #include // for cout #include // for shared_ptr, make_shared +#include // for std::move gps_l2c_telemetry_decoder_gs_sptr @@ -368,6 +369,6 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( } // 3. Make the output (copy the object contents to the GNURadio reserved memory) - out[0] = current_synchro_data; + out[0] = std::move(current_synchro_data); return 1; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index f8ad72108..d664551ea 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -33,6 +33,7 @@ #include // for std::exception #include // for std::setprecision #include // for std::cout +#include // for std::move gps_l5_telemetry_decoder_gs_sptr gps_l5_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf) @@ -383,8 +384,8 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u } } - // 3. Make the output (copy the object contents to the GNURadio reserved memory) - out[0] = current_synchro_data; + // 3. Make the output (move the object contents to the GNURadio reserved memory) + out[0] = std::move(current_synchro_data); return 1; } return 0; 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 f1ec40229..9a15fd2b6 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 @@ -25,6 +25,7 @@ #include // for abs #include // for exception #include // for operator<<, setw +#include // for std::move // logging levels #define EVENT 2 // logs important events which don't occur every block @@ -470,7 +471,7 @@ int sbas_l1_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( // UPDATE GNSS SYNCHRO DATA // actually the SBAS telemetry decoder doesn't support ranging current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation - out[0] = current_symbol; + out[0] = std::move(current_symbol); consume_each(1); // tell scheduler input items consumed return 1; // tell scheduler output items produced } 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 1d367d70e..a824f80ef 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -2066,7 +2066,6 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) current_synchro_data.Tracking_sample_counter = this->nitems_read(0); current_synchro_data.Flag_valid_symbol_output = !loss_of_lock; current_synchro_data.Flag_PLL_180_deg_phase_locked = d_Flag_PLL_180_deg_phase_locked; - *out[0] = current_synchro_data; // generate new tag associated with gnss-synchro object @@ -2088,6 +2087,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_timetag_waiting = false; } + *out[0] = std::move(current_synchro_data); return 1; } return 0; 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 923fc8fa0..8e70694ec 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 @@ -2015,7 +2015,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un current_synchro_data.Tracking_sample_counter = d_sample_counter_next; // d_sample_counter; current_synchro_data.Flag_valid_symbol_output = !loss_of_lock; current_synchro_data.Flag_PLL_180_deg_phase_locked = d_Flag_PLL_180_deg_phase_locked; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); return 1; } return 0; diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 4b6a44d14..d40c99783 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -291,7 +291,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); d_sample_counter = d_sample_counter + static_cast(samples_offset); // count for the processed samples d_pull_in = false; consume_each(samples_offset); // shift input to perform alignment with local replica @@ -438,7 +438,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri current_synchro_data.Signal[2] = '\0'; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index d3531eac8..32e0a2e2f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -575,7 +575,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -811,7 +811,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index c7dc7c22c..99108ee19 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -578,7 +578,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -813,7 +813,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(d_correlation_length_samples); } current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index 4962899df..61e9e9feb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -518,7 +518,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -637,7 +637,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index bbba59cbf..6274a0b26 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -574,7 +574,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -806,7 +806,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 410e42599..f88f217c4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -575,7 +575,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_cycles * TWO_PI; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -810,7 +810,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(d_correlation_length_samples); } current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index a1afb3c84..56b892474 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -520,7 +520,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); consume_each(samples_offset); // shift input to perform alignment with local replica return 1; } @@ -639,7 +639,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 1b6e7f2f6..9898ad178 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -30,6 +30,7 @@ #include #include #include +#include gps_l1_ca_dll_pll_tracking_gpu_cc_sptr @@ -344,7 +345,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); d_sample_counter += static_cast(samples_offset); // count for the processed samples d_pull_in = false; consume_each(samples_offset); // shift input to perform alignment with local replica @@ -479,7 +480,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc index 6faf12488..df97429eb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc @@ -634,7 +634,7 @@ int Gps_L1_Ca_Gaussian_Tracking_cc::general_work(int noutput_items __attribute__ current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.fs = d_fs_in; current_synchro_data.correlation_length_ms = 1; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); // Kalman filter initialization reset kf_P_x = kf_P_x_ini; // Update Kalman states based on acquisition information @@ -811,7 +811,7 @@ int Gps_L1_Ca_Gaussian_Tracking_cc::general_work(int noutput_items __attribute__ // assign the GNU Radio block output data current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index f646d7512..fb94fc2de 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -319,7 +319,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); d_sample_counter_seconds = d_sample_counter_seconds + (static_cast(samples_offset) / static_cast(d_fs_in)); d_sample_counter = d_sample_counter + static_cast(samples_offset); // count for the processed samples d_pull_in = false; @@ -468,7 +468,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib current_synchro_data.Signal[2] = '\0'; current_synchro_data.fs = d_fs_in; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); if (d_dump) { diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 8885e7367..68f029c1c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -21,6 +21,7 @@ #include "rtklib_solver.h" #include #include +#include class RinexPrinterTest : public ::testing::Test @@ -296,9 +297,9 @@ TEST_F(RinexPrinterTest, MixedObsHeader) Pvt_Conf conf; conf.use_e6_for_pvt = false; auto pvt_solution = std::make_shared(rtk, conf, "filename", 106, false, false); - pvt_solution->galileo_ephemeris_map[1] = eph_gal; + pvt_solution->galileo_ephemeris_map[1] = std::move(eph_gal); - pvt_solution->gps_ephemeris_map[1] = eph_gps; + pvt_solution->gps_ephemeris_map[1] = std::move(eph_gps); std::map gnss_observables_map; Gnss_Synchro gs{}; @@ -603,8 +604,8 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand) Pvt_Conf conf; conf.use_e6_for_pvt = false; auto pvt_solution = std::make_shared(rtk, conf, "filename", 7, false, false); - pvt_solution->gps_ephemeris_map[1] = eph; - pvt_solution->gps_cnav_ephemeris_map[1] = eph_cnav; + pvt_solution->gps_ephemeris_map[1] = std::move(eph); + pvt_solution->gps_cnav_ephemeris_map[1] = std::move(eph_cnav); std::map gnss_observables_map; Gnss_Synchro gs1 = Gnss_Synchro(); From 1690563acdec6e4673b9504294e4374fe531e9ed Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 27 Nov 2023 14:44:45 +0100 Subject: [PATCH 08/34] Fix: bugprone-use-after-move --- src/algorithms/data_type_adapter/adapters/byte_to_short.cc | 2 +- src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc index 7bb206bc3..43e9d119b 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc @@ -26,7 +26,7 @@ ByteToShort::ByteToShort(const ConfigurationInterface* configuration, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams), - dump_(configuration->property(role + ".dump", false)) + dump_(configuration->property(role_ + ".dump", false)) { const std::string default_input_item_type("byte"); const std::string default_output_item_type("short"); diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index eb1c8affd..1d4e2f386 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -32,7 +32,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configu : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams), - dump_(configuration->property(role + ".dump", false)) + dump_(configuration->property(role_ + ".dump", false)) { const std::string default_input_item_type("gr_complex"); const std::string default_output_item_type("gr_complex"); From f28ed4f45f2b0adacd7c2b0cebcacdad8caafb88 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 27 Nov 2023 15:28:02 +0100 Subject: [PATCH 09/34] Fix data race condition detected by Coverity Scan --- src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 4ac0fd221..5aa106bf3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -871,6 +871,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) // Called by gnuradio to enable drivers, etc for i/o devices. bool pcps_acquisition::start() { + gr::thread::scoped_lock lk(d_setlock); d_sample_counter = 0ULL; calculate_threshold(); return true; @@ -1017,7 +1018,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), { Gnss_Synchro current_synchro_data = d_monitor_queue.front(); d_monitor_queue.pop(); - *out[i] = current_synchro_data; + *out[i] = std::move(current_synchro_data); } return num_gnss_synchro_objects; } From 15c6108fe439be5ba3e0a1234bbc30c052bd50ce Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 27 Nov 2023 15:47:59 +0100 Subject: [PATCH 10/34] Fix data race condition detected by Coverity Scan --- .../gnuradio_blocks/galileo_telemetry_decoder_gs.cc | 1 + .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index fbaaaa84f..a7ed36787 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -918,6 +918,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( // check if there is a problem with the telemetry of the current satellite if (d_sent_tlm_failed_msg == false) { + gr::thread::scoped_lock lock(d_setlock); if ((d_symbol_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { const int message = 1; // bad telemetry diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 178eb8bd4..2229adc6c 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -464,6 +464,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ // check if there is a problem with the telemetry of the current satellite if (d_stat < 2 && d_sent_tlm_failed_msg == false) { + gr::thread::scoped_lock lock(d_setlock); if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { const int message = 1; // bad telemetry @@ -551,6 +552,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ if (d_CRC_error_counter > 2) { DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite; + gr::thread::scoped_lock lock(d_setlock); d_flag_frame_sync = false; d_stat = 0; d_TOW_at_current_symbol_ms = 0; From 9034ce44cb8d51f1b34aa2bd2e2715bb4ccbd8d5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 09:48:59 +0100 Subject: [PATCH 11/34] Fix data race conditions detected by Coverity Scan --- .../gnuradio_blocks/gr_complex_ip_packet_source.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index d5659d0dc..ae557e2d6 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -164,6 +164,7 @@ bool Gr_Complex_Ip_Packet_Source::start() // open the ethernet device if (open() == true) { + gr::thread::scoped_lock guard(d_setlock); // start pcap capture thread d_pcap_thread = new boost::thread( #if HAS_GENERIC_LAMBDA @@ -181,6 +182,7 @@ bool Gr_Complex_Ip_Packet_Source::start() bool Gr_Complex_Ip_Packet_Source::stop() { std::cout << "gr_complex_ip_packet_source STOP\n"; + gr::thread::scoped_lock guard(d_setlock); if (descr != nullptr) { pcap_breakloop(descr); @@ -294,11 +296,11 @@ void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char * const u_char *udp_payload = (reinterpret_cast(uh) + sizeof(gr_udp_header)); if (fifo_items <= (FIFO_SIZE - payload_length_bytes)) { + gr::thread::scoped_lock guard(d_setlock); int aligned_write_items = FIFO_SIZE - fifo_write_ptr; if (aligned_write_items >= payload_length_bytes) { // write all in a single memcpy - gr::thread::scoped_lock guard(d_setlock); memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], payload_length_bytes); // size in bytes fifo_write_ptr += payload_length_bytes; if (fifo_write_ptr == FIFO_SIZE) @@ -310,7 +312,6 @@ void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char * else { // two step wrap write - gr::thread::scoped_lock guard(d_setlock); memcpy(&fifo_buff[fifo_write_ptr], &udp_payload[0], aligned_write_items); // size in bytes fifo_write_ptr = payload_length_bytes - aligned_write_items; memcpy(&fifo_buff[0], &udp_payload[aligned_write_items], fifo_write_ptr); // size in bytes From 2b708c2e4af85038e293d27421ce6d227b3309e8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 09:50:11 +0100 Subject: [PATCH 12/34] Fix wrong API usage --- src/utils/front-end-cal/main.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 5d7122686..f8469e0b3 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -596,8 +596,16 @@ int main(int argc, char** argv) for (auto& it : f_if_estimation_Hz_map) { mean_f_if_Hz += it.second; - mean_fs_Hz += f_fs_estimation_Hz_map.find(it.first)->second; - mean_osc_err_ppm += f_ppm_estimation_Hz_map.find(it.first)->second; + const auto est_Hz = f_fs_estimation_Hz_map.find(it.first); + if (est_Hz != f_fs_estimation_Hz_map.cend()) + { + mean_fs_Hz += est_Hz->second; + } + const auto est_ppm = f_ppm_estimation_Hz_map.find(it.first); + if (est_ppm != f_ppm_estimation_Hz_map.cend()) + { + mean_osc_err_ppm += est_ppm->second; + } } mean_f_if_Hz /= n_elements; From 3c24b564c95528a5cf6772ddb9d7c950523f3ee7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 11:05:18 +0100 Subject: [PATCH 13/34] Better variable names --- src/utils/front-end-cal/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index f8469e0b3..4915b35b5 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -596,10 +596,10 @@ int main(int argc, char** argv) for (auto& it : f_if_estimation_Hz_map) { mean_f_if_Hz += it.second; - const auto est_Hz = f_fs_estimation_Hz_map.find(it.first); - if (est_Hz != f_fs_estimation_Hz_map.cend()) + const auto est_fs = f_fs_estimation_Hz_map.find(it.first); + if (est_fs != f_fs_estimation_Hz_map.cend()) { - mean_fs_Hz += est_Hz->second; + mean_fs_Hz += est_fs->second; } const auto est_ppm = f_ppm_estimation_Hz_map.find(it.first); if (est_ppm != f_ppm_estimation_Hz_map.cend()) From 73100a7b645aae50fd71a84676a568565f5f44d0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 12:01:16 +0100 Subject: [PATCH 14/34] Fix data race condition --- .../galileo_telemetry_decoder_gs.cc | 28 +++++++++++-------- .../galileo_telemetry_decoder_gs.h | 1 + .../gps_l1_ca_telemetry_decoder_gs.cc | 27 +++++++++++------- .../gps_l1_ca_telemetry_decoder_gs.h | 1 + 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index a7ed36787..04c4fc61b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -853,6 +853,22 @@ void galileo_telemetry_decoder_gs::set_channel(int32_t channel) } +void galileo_telemetry_decoder_gs::check_tlm_separation() +{ + gr::thread::scoped_lock lock(d_setlock); + if (d_sent_tlm_failed_msg == false) + { + if ((d_symbol_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) + { + const int message = 1; // bad telemetry + DLOG(INFO) << "Wrong tlm sync in sat " << this->d_satellite; + this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); + d_sent_tlm_failed_msg = true; + } + } +} + + int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -916,17 +932,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( d_flag_preamble = false; // check if there is a problem with the telemetry of the current satellite - if (d_sent_tlm_failed_msg == false) - { - gr::thread::scoped_lock lock(d_setlock); - if ((d_symbol_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) - { - const int message = 1; // bad telemetry - DLOG(INFO) << "sent msg sat " << this->d_satellite; - this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); - d_sent_tlm_failed_msg = true; - } - } + check_tlm_separation(); // ******* frame sync ****************** int32_t corr_value = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h index f571fea86..9cf5c81e0 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h @@ -80,6 +80,7 @@ private: galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf, int frame_type); + void check_tlm_separation(); void msg_handler_read_galileo_tow_map(const pmt::pmt_t &msg); void deinterleaver(int32_t rows, int32_t cols, const float *in, float *out); void decode_INAV_word(float *page_part_symbols, int32_t frame_length, double cn0); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 2229adc6c..c094fa1bc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -428,6 +428,21 @@ void gps_l1_ca_telemetry_decoder_gs::reset() } +void gps_l1_ca_telemetry_decoder_gs::check_tlm_separation() +{ + gr::thread::scoped_lock lock(d_setlock); + if (d_stat < 2 && d_sent_tlm_failed_msg == false) + { + if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) + { + const int message = 1; // bad telemetry + this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); + d_sent_tlm_failed_msg = true; + } + } +} + + int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -461,17 +476,9 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ d_sample_counter++; // count for the processed symbols consume_each(1); d_flag_preamble = false; + // check if there is a problem with the telemetry of the current satellite - if (d_stat < 2 && d_sent_tlm_failed_msg == false) - { - gr::thread::scoped_lock lock(d_setlock); - if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) - { - const int message = 1; // bad telemetry - this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); - d_sent_tlm_failed_msg = true; - } - } + check_tlm_separation(); // ******* frame sync ****************** switch (d_stat) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index 07bfdeee2..2be8cd597 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h @@ -73,6 +73,7 @@ private: gps_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf); + void check_tlm_separation(); bool gps_word_parityCheck(uint32_t gpsword); bool decode_subframe(double cn0, bool flag_invert); From 346cd8f9ac52cae89082bca6f7385fb047b95268 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 12:26:13 +0100 Subject: [PATCH 15/34] Fix data race condition --- src/core/receiver/gnss_flowgraph.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index d5505b4f9..0770b305d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -491,6 +491,7 @@ int GNSSFlowgraph::connect_desktop_flowgraph() } // Activate acquisition in enabled channels + std::lock_guard lock(signal_list_mutex_); for (int i = 0; i < channels_count_; i++) { LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); From 1818c889837c9e8f2c3982d6a0e3701f1cdf3c9f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Nov 2023 18:06:41 +0100 Subject: [PATCH 16/34] Fix data race conditions and performance inefficiencies, update CHANGELOG --- docs/CHANGELOG.md | 9 + .../gr_complex_ip_packet_source.cc | 2 +- .../gps_l1_ca_telemetry_decoder_gs.cc | 188 +++++++++--------- .../gps_l1_ca_telemetry_decoder_gs.h | 1 + src/core/receiver/file_configuration.cc | 8 +- 5 files changed, 111 insertions(+), 97 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index dadd11630..a4348315e 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,10 @@ All notable changes to GNSS-SDR will be documented in this file. ## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) +### Improvements in Efficiency: + +- Fixed some performance inefficiencies detected by Coverity Scan. + ### Improvements in Interoperability: - Added a new PVT configuration boolean flag (`flag_geohash_log_out`) that @@ -41,6 +45,7 @@ All notable changes to GNSS-SDR will be documented in this file. - Updated local `cpu_features` library to v0.9.0. - `volk_gnsssdr`: fix syntax for Python 3.12 without breaking backward compatibility with Python 2.7. +- Fixed linking against latest GNU Radio version. ### Improvements in Repeatability: @@ -54,6 +59,10 @@ All notable changes to GNSS-SDR will be documented in this file. `PVT.kf_system_ecef_pos_sd_m=0.01`, in [m]; and `PVT.kf_system_ecef_vel_sd_ms=0.001`, in [m/s]. +### Improvements in Scalability: + +- Fixed some potential data race conditions detected by Coverity Scan. + ### Improvements in Usability: - The Galileo E1B Reduced CED parameters usage has been set to `false` by diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index ae557e2d6..722fc9b1a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -260,6 +260,7 @@ void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char * // eth frame parameters // **** UDP RAW PACKET DECODER **** + gr::thread::scoped_lock guard(d_setlock); if ((packet[12] == 0x08) & (packet[13] == 0x00)) // IP FRAME { // retrieve the position of the ip header @@ -296,7 +297,6 @@ void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char * const u_char *udp_payload = (reinterpret_cast(uh) + sizeof(gr_udp_header)); if (fifo_items <= (FIFO_SIZE - payload_length_bytes)) { - gr::thread::scoped_lock guard(d_setlock); int aligned_write_items = FIFO_SIZE - fifo_write_ptr; if (aligned_write_items >= payload_length_bytes) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index c094fa1bc..fe04d5369 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -443,6 +443,100 @@ void gps_l1_ca_telemetry_decoder_gs::check_tlm_separation() } +void gps_l1_ca_telemetry_decoder_gs::frame_synchronization(const Gnss_Synchro ¤t_gs) +{ + gr::thread::scoped_lock lock(d_setlock); + switch (d_stat) + { + case 0: // no preamble information + { + // correlate with preamble + int32_t corr_value = 0; + if (d_symbol_history.size() >= d_required_symbols) + { + // ******* preamble correlation ******** + for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) + { + if (d_symbol_history[i] < 0.0) // symbols clipping + { + corr_value -= d_preamble_samples[i]; + } + else + { + corr_value += d_preamble_samples[i]; + } + } + } + if (abs(corr_value) >= d_samples_per_preamble) + { + d_preamble_index = d_sample_counter; // record the preamble sample stamp + if (corr_value < 0) + { + d_flag_PLL_180_deg_phase_locked = true; + } + else + { + d_flag_PLL_180_deg_phase_locked = false; + } + DLOG(INFO) << "Preamble detection for GPS L1 satellite " << this->d_satellite; + d_prev_GPS_frame_4bytes = 0; + if (decode_subframe(current_gs.CN0_dB_hz, d_flag_PLL_180_deg_phase_locked)) + { + d_CRC_error_counter = 0; + d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) + d_last_valid_preamble = d_sample_counter; + if (!d_flag_frame_sync) + { + d_flag_frame_sync = true; + DLOG(INFO) << " Frame sync SAT " << this->d_satellite; + } + d_stat = 1; // preamble acquired + } + } + d_flag_TOW_set = false; + break; + } + case 1: // preamble acquired + { + if (d_sample_counter >= d_preamble_index + static_cast(d_preamble_period_symbols)) + { + DLOG(INFO) << "Preamble received for SAT " << this->d_satellite << "d_sample_counter=" << d_sample_counter << "\n"; + // call the decoder + // 0. fetch the symbols into an array + d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P) + + if (decode_subframe(current_gs.CN0_dB_hz, d_flag_PLL_180_deg_phase_locked)) + { + d_CRC_error_counter = 0; + d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) + d_last_valid_preamble = d_sample_counter; + if (!d_flag_frame_sync) + { + d_flag_frame_sync = true; + DLOG(INFO) << " Frame sync SAT " << this->d_satellite; + } + } + else + { + d_CRC_error_counter++; + if (d_CRC_error_counter > 2) + { + DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite; + d_flag_frame_sync = false; + d_stat = 0; + d_TOW_at_current_symbol_ms = 0; + d_TOW_at_Preamble_ms = 0; + d_CRC_error_counter = 0; + d_flag_TOW_set = false; + } + } + } + break; + } + } +} + + int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -480,98 +574,8 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ // check if there is a problem with the telemetry of the current satellite check_tlm_separation(); - // ******* frame sync ****************** - switch (d_stat) - { - case 0: // no preamble information - { - // correlate with preamble - int32_t corr_value = 0; - if (d_symbol_history.size() >= d_required_symbols) - { - // ******* preamble correlation ******** - for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) - { - if (d_symbol_history[i] < 0.0) // symbols clipping - { - corr_value -= d_preamble_samples[i]; - } - else - { - corr_value += d_preamble_samples[i]; - } - } - } - if (abs(corr_value) >= d_samples_per_preamble) - { - d_preamble_index = d_sample_counter; // record the preamble sample stamp - if (corr_value < 0) - { - d_flag_PLL_180_deg_phase_locked = true; - } - else - { - d_flag_PLL_180_deg_phase_locked = false; - } - DLOG(INFO) << "Preamble detection for GPS L1 satellite " << this->d_satellite; - d_prev_GPS_frame_4bytes = 0; - if (decode_subframe(current_symbol.CN0_dB_hz, d_flag_PLL_180_deg_phase_locked)) - { - d_CRC_error_counter = 0; - d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) - gr::thread::scoped_lock lock(d_setlock); - d_last_valid_preamble = d_sample_counter; - if (!d_flag_frame_sync) - { - d_flag_frame_sync = true; - DLOG(INFO) << " Frame sync SAT " << this->d_satellite; - } - d_stat = 1; // preamble acquired - } - } - d_flag_TOW_set = false; - break; - } - case 1: // preamble acquired - { - if (d_sample_counter >= d_preamble_index + static_cast(d_preamble_period_symbols)) - { - DLOG(INFO) << "Preamble received for SAT " << this->d_satellite << "d_sample_counter=" << d_sample_counter << "\n"; - // call the decoder - // 0. fetch the symbols into an array - d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P) - - if (decode_subframe(current_symbol.CN0_dB_hz, d_flag_PLL_180_deg_phase_locked)) - { - d_CRC_error_counter = 0; - d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) - gr::thread::scoped_lock lock(d_setlock); - d_last_valid_preamble = d_sample_counter; - if (!d_flag_frame_sync) - { - d_flag_frame_sync = true; - DLOG(INFO) << " Frame sync SAT " << this->d_satellite; - } - } - else - { - d_CRC_error_counter++; - if (d_CRC_error_counter > 2) - { - DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite; - gr::thread::scoped_lock lock(d_setlock); - d_flag_frame_sync = false; - d_stat = 0; - d_TOW_at_current_symbol_ms = 0; - d_TOW_at_Preamble_ms = 0; - d_CRC_error_counter = 0; - d_flag_TOW_set = false; - } - } - } - break; - } - } + // frame sync + frame_synchronization(current_symbol); // 2. Add the telemetry decoder information if (d_flag_preamble == true) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index 2be8cd597..8b00d51ce 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h @@ -74,6 +74,7 @@ private: gps_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf); void check_tlm_separation(); + void frame_synchronization(const Gnss_Synchro ¤t_gs); bool gps_word_parityCheck(uint32_t gpsword); bool decode_subframe(double cn0, bool flag_invert); diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 659895934..3c34d54bc 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -84,7 +84,7 @@ bool FileConfiguration::property(std::string property_name, bool default_value) return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -139,7 +139,7 @@ uint16_t FileConfiguration::property(std::string property_name, uint16_t default return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -150,7 +150,7 @@ int16_t FileConfiguration::property(std::string property_name, int16_t default_v return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -172,7 +172,7 @@ double FileConfiguration::property(std::string property_name, double default_val return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } From 4a8c58f6ba9acd933c9719015c28a8822bfdd6cf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 29 Nov 2023 21:34:59 +0100 Subject: [PATCH 17/34] Fix performance inefficiencies detected by Coverity Scan --- .../gnuradio_blocks/hybrid_observables_gs.cc | 2 +- .../telemetry_decoder/libs/tlm_crc_stats.cc | 2 +- .../tracking/gnuradio_blocks/kf_tracking.cc | 2 +- .../tracking/libs/bayesian_estimation.cc | 10 +++++----- .../tracking/libs/nonlinear_tracking.cc | 8 ++++---- src/core/monitor/serdes_gnss_synchro.h | 2 +- src/core/receiver/file_configuration.cc | 12 ++++++------ src/core/receiver/gnss_block_factory.cc | 8 ++++---- src/core/receiver/gnss_flowgraph.cc | 10 +++++----- src/core/receiver/in_memory_configuration.cc | 18 +++++++++--------- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 8569dde24..3ce0ed6e9 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -768,7 +768,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) { n_valid++; } - epoch_data[n] = interpolated_gnss_synchro; + epoch_data[n] = std::move(interpolated_gnss_synchro); } if (d_T_rx_TOW_set) { diff --git a/src/algorithms/telemetry_decoder/libs/tlm_crc_stats.cc b/src/algorithms/telemetry_decoder/libs/tlm_crc_stats.cc index 2a57d55ac..4d6b9d9e6 100644 --- a/src/algorithms/telemetry_decoder/libs/tlm_crc_stats.cc +++ b/src/algorithms/telemetry_decoder/libs/tlm_crc_stats.cc @@ -44,7 +44,7 @@ bool Tlm_CRC_Stats::set_channel(int32_t channel) { std::string dump_filename_ = d_dump_crc_stats_filename.substr(d_dump_crc_stats_filename.find_last_of('/') + 1); dump_path = d_dump_crc_stats_filename.substr(0, d_dump_crc_stats_filename.find_last_of('/')); - d_dump_crc_stats_filename = dump_filename_; + d_dump_crc_stats_filename = std::move(dump_filename_); } else { diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc index eb21fe31f..2a7900f20 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc @@ -2075,7 +2075,7 @@ int kf_tracking::general_work(int noutput_items __attribute__((unused)), gr_vect { current_synchro_data.fs = static_cast(d_trk_parameters.fs_in); current_synchro_data.Tracking_sample_counter = d_sample_counter; - *out[0] = current_synchro_data; + *out[0] = std::move(current_synchro_data); return 1; } return 0; diff --git a/src/algorithms/tracking/libs/bayesian_estimation.cc b/src/algorithms/tracking/libs/bayesian_estimation.cc index e0536e50f..1823efcb3 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.cc +++ b/src/algorithms/tracking/libs/bayesian_estimation.cc @@ -29,7 +29,7 @@ */ #include "bayesian_estimation.h" - +#include Bayesian_estimator::Bayesian_estimator() : kappa_prior(0), @@ -122,10 +122,10 @@ void Bayesian_estimator::update_sequential(const arma::vec& data) Psi_est = Psi_posterior / (nu_posterior + ny + 1); } - mu_prior = mu_posterior; + mu_prior = std::move(mu_posterior); kappa_prior = kappa_posterior; nu_prior = nu_posterior; - Psi_prior = Psi_posterior; + Psi_prior = std::move(Psi_posterior); } @@ -161,10 +161,10 @@ void Bayesian_estimator::update_sequential(const arma::vec& data, const arma::ve Psi_est = Psi_posterior / (nu_posterior + ny + 1); } - mu_prior = mu_posterior; + mu_prior = std::move(mu_posterior); kappa_prior = kappa_posterior; nu_prior = nu_posterior; - Psi_prior = Psi_posterior; + Psi_prior = std::move(Psi_posterior); } diff --git a/src/algorithms/tracking/libs/nonlinear_tracking.cc b/src/algorithms/tracking/libs/nonlinear_tracking.cc index d4f5609db..200c22f5d 100644 --- a/src/algorithms/tracking/libs/nonlinear_tracking.cc +++ b/src/algorithms/tracking/libs/nonlinear_tracking.cc @@ -104,8 +104,8 @@ void CubatureFilter::predict_sequential(const arma::vec& x_post, const arma::mat P_x_pred = P_x_pred / static_cast(np) - x_pred * x_pred.t() + noise_covariance; // Store predicted mean and error covariance - x_pred_out = x_pred; - P_x_pred_out = P_x_pred; + x_pred_out = std::move(x_pred); + P_x_pred_out = std::move(P_x_pred); } @@ -270,8 +270,8 @@ void UnscentedFilter::predict_sequential(const arma::vec& x_post, const arma::ma P_x_pred = P_x_pred + noise_covariance; // Store predicted mean and error covariance - x_pred_out = x_pred; - P_x_pred_out = P_x_pred; + x_pred_out = std::move(x_pred); + P_x_pred_out = std::move(P_x_pred); } diff --git a/src/core/monitor/serdes_gnss_synchro.h b/src/core/monitor/serdes_gnss_synchro.h index 35bbed909..9f45df031 100644 --- a/src/core/monitor/serdes_gnss_synchro.h +++ b/src/core/monitor/serdes_gnss_synchro.h @@ -73,7 +73,7 @@ public: { observables.Clear(); std::string data; - for (auto gs : vgs) + for (const auto& gs : vgs) { gnss_sdr::GnssSynchro* obs = observables.add_observable(); char c = gs.System; diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 3c34d54bc..5e8fff282 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -95,7 +95,7 @@ int64_t FileConfiguration::property(std::string property_name, int64_t default_v return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -106,7 +106,7 @@ uint64_t FileConfiguration::property(std::string property_name, uint64_t default return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -117,7 +117,7 @@ int FileConfiguration::property(std::string property_name, int default_value) co return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -128,7 +128,7 @@ unsigned int FileConfiguration::property(std::string property_name, unsigned int return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -161,7 +161,7 @@ float FileConfiguration::property(std::string property_name, float default_value return overrided_->property(property_name, default_value); } const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } @@ -178,7 +178,7 @@ double FileConfiguration::property(std::string property_name, double default_val void FileConfiguration::set_property(std::string property_name, std::string value) { - overrided_->set_property(property_name, value); + overrided_->set_property(std::move(property_name), std::move(value)); } diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index e1a6d3f15..5742bca83 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -192,16 +192,16 @@ auto const item_prop = ".item_type"s; // "item_type" property template std::unique_ptr dynamic_unique_cast(std::unique_ptr&& p) { - std::unique_ptr result; - if (To* cast = dynamic_cast(p.get())) { - result.reset(cast); + std::unique_ptr result(cast); p.release(); // NOLINT(bugprone-unused-return-value) + return result; } - return result; + return std::unique_ptr(nullptr); } + auto findRole(ConfigurationInterface const* configuration, std::string const& base, int ID) -> std::string { auto role = base + std::to_string(ID); diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0770b305d..1c913a8fc 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -2190,7 +2190,7 @@ void GNSSFlowgraph::set_signals_list() if (!tmp_set.empty()) { - available_galileo_prn = tmp_set; + available_galileo_prn = std::move(tmp_set); } } @@ -2230,7 +2230,7 @@ void GNSSFlowgraph::set_signals_list() if (!tmp_set.empty()) { - available_gps_prn = tmp_set; + available_gps_prn = std::move(tmp_set); } } @@ -2270,7 +2270,7 @@ void GNSSFlowgraph::set_signals_list() if (!tmp_set.empty()) { - available_sbas_prn = tmp_set; + available_sbas_prn = std::move(tmp_set); } } @@ -2310,7 +2310,7 @@ void GNSSFlowgraph::set_signals_list() if (!tmp_set.empty()) { - available_glonass_prn = tmp_set; + available_glonass_prn = std::move(tmp_set); } } @@ -2350,7 +2350,7 @@ void GNSSFlowgraph::set_signals_list() if (!tmp_set.empty()) { - available_beidou_prn = tmp_set; + available_beidou_prn = std::move(tmp_set); } } diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc index df46b0053..b3cde9946 100644 --- a/src/core/receiver/in_memory_configuration.cc +++ b/src/core/receiver/in_memory_configuration.cc @@ -47,63 +47,63 @@ std::string InMemoryConfiguration::property(std::string property_name, std::stri bool InMemoryConfiguration::property(std::string property_name, bool default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } int64_t InMemoryConfiguration::property(std::string property_name, int64_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } uint64_t InMemoryConfiguration::property(std::string property_name, uint64_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } int32_t InMemoryConfiguration::property(std::string property_name, int32_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } uint32_t InMemoryConfiguration::property(std::string property_name, uint32_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } uint16_t InMemoryConfiguration::property(std::string property_name, uint16_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } int16_t InMemoryConfiguration::property(std::string property_name, int16_t default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } float InMemoryConfiguration::property(std::string property_name, float default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } double InMemoryConfiguration::property(std::string property_name, double default_value) const { const std::string empty; - return converter_->convert(property(property_name, empty), default_value); + return converter_->convert(property(std::move(property_name), empty), default_value); } From 0fd604db63caa9cea4a41bb10431dff03fb3b7d0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 29 Nov 2023 21:35:12 +0100 Subject: [PATCH 18/34] Fix performance inefficiencies detected by Coverity Scan --- .../acquisition/adapters/beidou_b1i_pcps_acquisition.h | 1 + .../acquisition/adapters/beidou_b3i_pcps_acquisition.h | 3 ++- .../adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h | 3 ++- .../adapters/galileo_e1_pcps_ambiguous_acquisition.h | 3 ++- .../adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h | 3 ++- .../adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h | 3 ++- .../galileo_e1_pcps_quicksync_ambiguous_acquisition.h | 4 +++- .../adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h | 4 +++- .../adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h | 3 ++- .../acquisition/adapters/galileo_e5a_pcps_acquisition.h | 3 ++- .../acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h | 3 ++- .../acquisition/adapters/galileo_e5b_pcps_acquisition.h | 3 ++- .../acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h | 3 ++- .../acquisition/adapters/galileo_e6_pcps_acquisition.h | 3 ++- .../acquisition/adapters/glonass_l1_ca_pcps_acquisition.h | 3 ++- .../acquisition/adapters/glonass_l2_ca_pcps_acquisition.h | 3 ++- .../acquisition/adapters/gps_l1_ca_pcps_acquisition.h | 3 ++- .../adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h | 3 ++- .../acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h | 3 ++- .../adapters/gps_l1_ca_pcps_assisted_acquisition.h | 3 ++- .../acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h | 3 ++- .../adapters/gps_l1_ca_pcps_quicksync_acquisition.h | 3 ++- .../acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h | 3 ++- .../acquisition/adapters/gps_l2_m_pcps_acquisition.h | 3 ++- .../acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h | 3 ++- .../acquisition/adapters/gps_l5i_pcps_acquisition.h | 3 ++- .../acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h | 3 ++- 27 files changed, 55 insertions(+), 26 deletions(-) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index a5a659369..7a3b3a310 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -30,6 +30,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h index ccbaf8c53..105f3e45c 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h @@ -29,6 +29,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -95,7 +96,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index 7903dff58..7548d1274 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -24,6 +24,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -92,7 +93,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 995c2570a..aea4c2d99 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -27,6 +27,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -95,7 +96,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index 0352d4dbd..db9f10bf1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -25,6 +25,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -121,7 +122,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index fb53e690d..ee0e56abb 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -24,6 +24,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -93,7 +94,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 7ba948513..8eb96a5e0 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -24,6 +24,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -93,9 +94,10 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } + /*! * \brief Set statistics threshold of PCPS algorithm */ diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 33390e134..7d9245148 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -24,6 +24,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -93,9 +94,10 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } + /*! * \brief Set statistics threshold of TONG algorithm */ diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 66323eb11..4a5655080 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -29,6 +29,7 @@ #include "gnss_synchro.h" #include #include +#include #include /** \addtogroup Acquisition @@ -93,7 +94,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 2b0f35050..a2194a729 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -25,6 +25,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -86,7 +87,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index f57d5d3b0..8cebfc042 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -25,6 +25,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -121,7 +122,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h index 76de8b140..940dac140 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition.h @@ -26,6 +26,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -117,7 +118,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h index 34abc3ba6..f42720a92 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.h @@ -26,6 +26,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -120,7 +121,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h index 2902177a7..a3fe58ca2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e6_pcps_acquisition.h @@ -27,6 +27,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -95,7 +96,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 84999e6df..7a30d725d 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -29,6 +29,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -97,7 +98,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index 6d0f68eb4..5cce50b40 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -28,6 +28,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -96,7 +97,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 5c79bd7de..0fd769bce 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -31,6 +31,7 @@ #include #include #include +#include /** \addtogroup Acquisition * Classes for GNSS signal acquisition @@ -101,7 +102,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index f59db4494..c5e27ece5 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -25,6 +25,7 @@ #include "pcps_acquisition_fine_doppler_cc.h" #include #include +#include #include /** \addtogroup Acquisition @@ -95,7 +96,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 57786c570..c3f38a8b7 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -28,6 +28,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -122,7 +123,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index 2745218ef..6a2cfde4c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -25,6 +25,7 @@ #include "pcps_assisted_acquisition_cc.h" #include #include +#include #include /** \addtogroup Acquisition @@ -94,7 +95,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 880d94281..331f8c84b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -24,6 +24,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -92,7 +93,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index f10cbdaa5..c148fa6c0 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -26,6 +26,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -95,7 +96,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index 2a7ba680f..336a1f1f9 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -25,6 +25,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -93,7 +94,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_cc_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 5f9e41615..f485ccd1b 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -28,6 +28,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -97,7 +98,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index 2003ab5a7..c72328be6 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -29,6 +29,7 @@ #include // for size_t #include // for weak_ptr #include // for string +#include /** \addtogroup Acquisition * \{ */ @@ -97,7 +98,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 0578ae793..6230e7a57 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -28,6 +28,7 @@ #include #include #include +#include /** \addtogroup Acquisition * \{ */ @@ -96,7 +97,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index 3a6beaf7e..ee4d193a2 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -28,6 +28,7 @@ #include #include #include +#include #include /** \addtogroup Acquisition @@ -124,7 +125,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_fpga_->set_channel_fsm(channel_fsm_); } From 1a270281c0e93e8e26825f5a97c385e911e44371 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 29 Nov 2023 21:51:14 +0100 Subject: [PATCH 19/34] Add missing include --- src/algorithms/tracking/libs/nonlinear_tracking.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/tracking/libs/nonlinear_tracking.cc b/src/algorithms/tracking/libs/nonlinear_tracking.cc index 200c22f5d..676eac9c7 100644 --- a/src/algorithms/tracking/libs/nonlinear_tracking.cc +++ b/src/algorithms/tracking/libs/nonlinear_tracking.cc @@ -27,6 +27,7 @@ */ #include "nonlinear_tracking.h" +#include /***************** CUBATURE KALMAN FILTER *****************/ From 699050baaf97e0082ee9a6e0f42c1b910cebf560 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 29 Nov 2023 23:45:38 +0100 Subject: [PATCH 20/34] Fix performance inefficiencies detected by Coverity Scan --- src/algorithms/PVT/libs/rtcm.h | 2 +- .../acquisition/adapters/beidou_b1i_pcps_acquisition.h | 2 +- .../adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc | 2 +- .../adapters/gps_l1_ca_pcps_assisted_acquisition.cc | 2 +- .../adapters/gps_l1_ca_pcps_quicksync_acquisition.cc | 2 +- .../acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc | 2 +- .../gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc | 2 +- .../observables/gnuradio_blocks/hybrid_observables_gs.cc | 2 +- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 4 ++-- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 2 +- src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc | 6 +++--- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm.h b/src/algorithms/PVT/libs/rtcm.h index 23d10db71..c7011eec3 100644 --- a/src/algorithms/PVT/libs/rtcm.h +++ b/src/algorithms/PVT/libs/rtcm.h @@ -647,7 +647,7 @@ private: inline void join(const std::shared_ptr& participant) { participants_.insert(participant); - for (auto msg : recent_msgs_) + for (const auto& msg : recent_msgs_) { participant->deliver(msg); } diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index 7a3b3a310..9e0a37ac7 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -97,7 +97,7 @@ public: */ inline void set_channel_fsm(std::weak_ptr channel_fsm) override { - channel_fsm_ = channel_fsm; + channel_fsm_ = std::move(channel_fsm); acquisition_->set_channel_fsm(channel_fsm_); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 0ba02b62c..ffe4ca5d2 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -55,7 +55,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( acq_parameters.fs_in = fs_in_; acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD_S * static_cast(acq_parameters.fs_in))); acq_parameters.dump = dump_; - dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename); + dump_filename_ = configuration->property(role_ + ".dump_filename", std::move(default_dump_filename)); acq_parameters.dump_filename = dump_filename_; if (FLAGS_doppler_max != 0) { diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index 9c9dfd7e3..98fb0b9c6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -46,7 +46,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( { const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./data/acquisition.dat"; - dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename); + dump_filename_ = configuration->property(role_ + ".dump_filename", std::move(default_dump_filename)); item_type_ = configuration->property(role_ + ".item_type", default_item_type); int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index ee09ec085..db6451541 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -99,7 +99,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( max_dwells_ = 2; } - dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename); + dump_filename_ = configuration_->property(role_ + ".dump_filename", std::move(default_dump_filename)); bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index bc31812fb..7dca40c3a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -61,7 +61,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( item_type_ = configuration_->property(role_ + ".item_type", default_item_type); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename); + dump_filename_ = configuration_->property(role_ + ".dump_filename", std::move(default_dump_filename)); if (FLAGS_doppler_max != 0) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 270238767..28624f346 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -84,7 +84,7 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con { std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); - d_dump_filename = dump_filename_; + d_dump_filename = std::move(dump_filename_); } else { diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 3ce0ed6e9..a9bc19407 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -113,7 +113,7 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) { std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); - d_dump_filename = dump_filename_; + d_dump_filename = std::move(dump_filename_); } else { 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 a824f80ef..5ac5f6d62 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -574,7 +574,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) { std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); - d_dump_filename = dump_filename_; + d_dump_filename = std::move(dump_filename_); } else { @@ -1572,7 +1572,7 @@ int32_t dll_pll_veml_tracking::save_matfile() const // WRITE MAT FILE mat_t *matfp; matvar_t *matvar; - std::string filename = dump_filename_; + std::string filename = std::move(dump_filename_); filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); 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 8e70694ec..68df0ec82 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 @@ -1209,7 +1209,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() const // WRITE MAT FILE mat_t *matfp; matvar_t *matvar; - std::string filename = dump_filename_; + std::string filename = std::move(dump_filename_); filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc index 2a7900f20..dd50b4547 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc @@ -564,7 +564,7 @@ kf_tracking::kf_tracking(const Kf_Conf &conf_) { std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); - d_dump_filename = dump_filename_; + d_dump_filename = std::move(dump_filename_); } else { @@ -911,7 +911,7 @@ void kf_tracking::update_kf_narrow_integration_time() Qnew += d_F * d_Q * d_F.t(); d_Q = d_F * d_Q * d_F.t(); } - d_Q = Qnew; + d_Q = std::move(Qnew); // state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz d_F = {{1.0, 0.0, d_beta * Ti, d_beta * TiTi / 2.0}, @@ -1629,7 +1629,7 @@ int32_t kf_tracking::save_matfile() const // WRITE MAT FILE mat_t *matfp; matvar_t *matvar; - std::string filename = dump_filename_; + std::string filename = std::move(dump_filename_); filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); From 9c4090f71aa8cdc8bb7d067fdcc9ae5f4d0278bb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 30 Nov 2023 08:57:30 +0100 Subject: [PATCH 21/34] Fix use of auto that caused a copy --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 7c14b6350..1795671a6 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -498,7 +498,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, std::ostringstream os; #ifdef HAS_PUT_TIME time_t when = std::time(nullptr); - auto const tm = *std::localtime(&when); + const auto& tm = *std::localtime(&when); os << std::put_time(&tm, "%z"); #endif std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM" From bd1f9e5ad978d25925ed8d9061b7217cca33f036 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 30 Nov 2023 09:48:04 +0100 Subject: [PATCH 22/34] Fix performance inefficiencies detected by Coverity Scan --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 2 +- .../conditioner/adapters/array_signal_conditioner.cc | 2 +- .../conditioner/adapters/signal_conditioner.cc | 2 +- .../signal_source/adapters/file_source_base.cc | 10 +++++----- .../signal_source/adapters/gen_signal_source.cc | 2 +- .../gnuradio_blocks/galileo_telemetry_decoder_gs.cc | 4 ++-- .../libs/acquisition_dump_reader.cc | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 1795671a6..80b41440a 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -227,7 +227,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, { std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); - d_dump_filename = dump_filename_; + d_dump_filename = std::move(dump_filename_); } else { diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 206d76793..02471e8a5 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -73,7 +73,7 @@ void ArraySignalConditioner::disconnect(gr::top_block_sptr top_block) // data_type_adapt_->disconnect(top_block); in_filt_->disconnect(top_block); - res_->disconnect(top_block); + res_->disconnect(std::move(top_block)); connected_ = false; } diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index ba724abb0..871ed0a51 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -101,7 +101,7 @@ void SignalConditioner::disconnect(gr::top_block_sptr top_block) data_type_adapt_->disconnect(top_block); in_filt_->disconnect(top_block); - res_->disconnect(top_block); + res_->disconnect(std::move(top_block)); connected_ = false; } diff --git a/src/algorithms/signal_source/adapters/file_source_base.cc b/src/algorithms/signal_source/adapters/file_source_base.cc index 974d4acac..220f65191 100644 --- a/src/algorithms/signal_source/adapters/file_source_base.cc +++ b/src/algorithms/signal_source/adapters/file_source_base.cc @@ -186,11 +186,11 @@ void FileSourceBase::connect(gr::top_block_sptr top_block) // DUMP if (sink()) { - top_block->connect(output, 0, sink(), 0); + top_block->connect(std::move(output), 0, sink(), 0); DLOG(INFO) << "connected output to file sink"; } - post_connect_hook(top_block); + post_connect_hook(std::move(top_block)); } @@ -219,7 +219,7 @@ void FileSourceBase::disconnect(gr::top_block_sptr top_block) // VALVE if (valve()) { - top_block->disconnect(input, 0, valve(), 0); + top_block->disconnect(std::move(input), 0, valve(), 0); DLOG(INFO) << "disconnected source to valve"; output = valve(); @@ -234,11 +234,11 @@ void FileSourceBase::disconnect(gr::top_block_sptr top_block) // DUMP if (sink()) { - top_block->disconnect(output, 0, sink(), 0); + top_block->disconnect(std::move(output), 0, sink(), 0); DLOG(INFO) << "disconnected output to file sink"; } - post_disconnect_hook(top_block); + post_disconnect_hook(std::move(top_block)); } diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index db403234c..a87f77b12 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -70,7 +70,7 @@ void GenSignalSource::disconnect(gr::top_block_sptr top_block) filter_->get_left_block(), 0); signal_generator_->disconnect(top_block); - filter_->disconnect(top_block); + filter_->disconnect(std::move(top_block)); connected_ = false; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index 04c4fc61b..690715725 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -393,7 +393,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in if (page_part_bits[0] == 1) { // DECODE COMPLETE WORD (even + odd) and TEST CRC - d_inav_nav.split_page(page_String, d_flag_even_word_arrived); + d_inav_nav.split_page(std::move(page_String), d_flag_even_word_arrived); if (d_inav_nav.get_flag_CRC_test() == true) { if (d_band == '1') @@ -421,7 +421,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in else { // STORE HALF WORD (even page) - d_inav_nav.split_page(page_String, d_flag_even_word_arrived); + d_inav_nav.split_page(std::move(page_String), d_flag_even_word_arrived); d_flag_even_word_arrived = 1; } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 07b5ff7a4..6ba023893 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -209,7 +209,7 @@ Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename, } d_num_doppler_bins = static_cast(ceil(static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); std::vector > mag_aux(d_num_doppler_bins, std::vector(d_samples_per_code)); - mag = mag_aux; + mag = std::move(mag_aux); d_dump_filename = d_basename + "_ch_" + std::to_string(channel) + "_" + std::to_string(execution) + "_sat_" + std::to_string(d_sat) + ".mat"; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { From 0b4d525feb37d937fd4799203beb89d42684bddf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 30 Nov 2023 13:18:56 +0100 Subject: [PATCH 23/34] Add GCC 14 to FindGFORTRAN.cmake --- cmake/Modules/FindGFORTRAN.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index 5e4d2885d..a6eb38a53 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -20,7 +20,7 @@ if(DEFINED ENV{GFORTRAN_ROOT}) ) endif() -set(GCC_MAJOR_SERIES 13 12 11 10 9 8 7 6 5) +set(GCC_MAJOR_SERIES 14 13 12 11 10 9 8 7 6 5) set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) From 4b60f8a7f2d836419914af82e53400ed4b2dc872 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 1 Dec 2023 10:19:39 +0100 Subject: [PATCH 24/34] Fix performance inefficiencies detected by Coverity Scan --- src/algorithms/PVT/libs/rinex_printer.cc | 2 +- .../signal_source/adapters/file_source_base.cc | 2 +- .../control-plane/file_configuration_test.cc | 7 ++++--- .../control-plane/gnss_block_factory_test.cc | 3 ++- .../control-plane/gnss_flowgraph_test.cc | 9 +++++---- .../filter/fir_filter_test.cc | 3 ++- .../filter/notch_filter_lite_test.cc | 3 ++- .../pvt/rinex_printer_test.cc | 16 ++++++++-------- src/utils/front-end-cal/front_end_cal.cc | 8 ++++---- 9 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 8f3042830..92098517f 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -5651,7 +5651,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.E1B_DVS); - std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS) + "11" + "1" + std::string(E1B_DVS) + std::string(E1B_HS) + std::to_string(galileo_ephemeris_iter->second.E1B_DVS); + std::string SVhealth_str = std::move(E5B_HS) + std::to_string(galileo_ephemeris_iter->second.E5b_DVS) + "11" + "1" + std::string(E1B_DVS) + std::string(E1B_HS) + std::to_string(galileo_ephemeris_iter->second.E1B_DVS); int32_t SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); line += Rinex_Printer::doub2for(static_cast(SVhealth), 18, 2); line += std::string(1, ' '); diff --git a/src/algorithms/signal_source/adapters/file_source_base.cc b/src/algorithms/signal_source/adapters/file_source_base.cc index 220f65191..6efa7cdbc 100644 --- a/src/algorithms/signal_source/adapters/file_source_base.cc +++ b/src/algorithms/signal_source/adapters/file_source_base.cc @@ -171,7 +171,7 @@ void FileSourceBase::connect(gr::top_block_sptr top_block) // VALVE if (valve()) { - top_block->connect(input, 0, valve(), 0); + top_block->connect(std::move(input), 0, valve(), 0); DLOG(INFO) << "connected source to valve"; output = valve(); diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc index 5b2036234..4b09f1096 100644 --- a/src/tests/unit-tests/control-plane/file_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc @@ -19,6 +19,7 @@ #include "file_configuration.h" #include "gnss_sdr_make_unique.h" #include +#include TEST(FileConfigurationTest, OverridedProperties) @@ -31,7 +32,7 @@ TEST(FileConfigurationTest, OverridedProperties) std::string value = configuration->property("NotThere", default_value); EXPECT_STREQ("default_value", value.c_str()); configuration->set_property("NotThere", "Yes!"); - value = configuration->property("NotThere", default_value); + value = configuration->property("NotThere", std::move(default_value)); EXPECT_STREQ("Yes!", value.c_str()); } @@ -40,7 +41,7 @@ TEST(FileConfigurationTest, LoadFromNonExistentFile) { std::unique_ptr configuration = std::make_unique("./i_dont_exist.conf"); std::string default_value = "default_value"; - std::string value = configuration->property("whatever.whatever", default_value); + std::string value = configuration->property("whatever.whatever", std::move(default_value)); EXPECT_STREQ("default_value", value.c_str()); } @@ -51,6 +52,6 @@ TEST(FileConfigurationTest, PropertyDoesNotExist) std::string filename = path + "data/config_file_sample.txt"; std::unique_ptr configuration = std::make_unique(filename); std::string default_value = "default_value"; - std::string value = configuration->property("whatever.whatever", default_value); + std::string value = configuration->property("whatever.whatever", std::move(default_value)); EXPECT_STREQ("default_value", value.c_str()); } diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc index 89352892b..9ce4f0469 100644 --- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc @@ -32,6 +32,7 @@ #include "tracking_interface.h" #include #include +#include #include TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource) @@ -40,7 +41,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource) configuration->set_property("SignalSource.implementation", "File_Signal_Source"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - configuration->set_property("SignalSource.filename", filename); + configuration->set_property("SignalSource.filename", std::move(filename)); std::shared_ptr> queue = std::make_shared>(); // Example of a factory as a shared_ptr std::shared_ptr factory = std::make_shared(); diff --git a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc index 63cf9ea90..158f0ee27 100644 --- a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc @@ -28,6 +28,7 @@ #include "pass_through.h" #include "tracking_interface.h" #include +#include TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopOldNotation /*unused*/) @@ -42,7 +43,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopOldNotation /*unused*/ config->set_property("SignalSource.repeat", "true"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - config->set_property("SignalSource.filename", filename); + config->set_property("SignalSource.filename", std::move(filename)); config->set_property("SignalConditioner.implementation", "Pass_Through"); config->set_property("Channels_1C.count", "1"); config->set_property("Channels.in_acquisition", "1"); @@ -76,7 +77,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStop /*unused*/) config->set_property("SignalSource.repeat", "true"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - config->set_property("SignalSource.filename", filename); + config->set_property("SignalSource.filename", std::move(filename)); config->set_property("SignalConditioner.implementation", "Pass_Through"); config->set_property("Channels_1C.count", "8"); config->set_property("Channels.in_acquisition", "1"); @@ -110,7 +111,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopGalileoE1B /*unused*/) config->set_property("SignalSource.repeat", "true"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - config->set_property("SignalSource.filename", filename); + config->set_property("SignalSource.filename", std::move(filename)); config->set_property("SignalConditioner.implementation", "Pass_Through"); config->set_property("Channels_1B.count", "8"); config->set_property("Channels.in_acquisition", "1"); @@ -145,7 +146,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopHybrid /*unused*/) config->set_property("SignalSource.repeat", "true"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat"; - config->set_property("SignalSource.filename", filename); + config->set_property("SignalSource.filename", std::move(filename)); config->set_property("SignalConditioner.implementation", "Pass_Through"); config->set_property("Channels_1C.count", "8"); config->set_property("Channels_1B.count", "8"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index a0d064dac..60987b0f2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -37,6 +37,7 @@ #include "interleaved_short_to_complex_short.h" #include #include +#include DEFINE_int32(filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); @@ -311,7 +312,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) config2->set_property("Test_Source.sampling_frequency", "4000000"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - config2->set_property("Test_Source.filename", filename); + config2->set_property("Test_Source.filename", std::move(filename)); config2->set_property("Test_Source.item_type", "ibyte"); config2->set_property("Test_Source.repeat", "true"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index db12b3bfc..1c77dc929 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -36,6 +36,7 @@ #include "notch_filter_lite.h" #include #include +#include DEFINE_int32(notch_filter_lite_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); @@ -178,7 +179,7 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) config2->set_property("Test_Source.sampling_frequency", "4000000"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - config2->set_property("Test_Source.filename", filename); + config2->set_property("Test_Source.filename", std::move(filename)); config2->set_property("Test_Source.item_type", "gr_complex"); config2->set_property("Test_Source.repeat", "true"); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 68f029c1c..ea0aac0bd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -149,12 +149,12 @@ TEST_F(RinexPrinterTest, GalileoObsHeader) auto pvt_solution = std::make_shared(rtk, conf, "filename", 4, false, false); auto eph = Galileo_Ephemeris(); eph.PRN = 1; - pvt_solution->galileo_ephemeris_map[1] = eph; + pvt_solution->galileo_ephemeris_map[1] = std::move(eph); std::map gnss_observables_map; Gnss_Synchro gs{}; gs.PRN = 1; - gnss_observables_map[1] = gs; + gnss_observables_map[1] = std::move(gs); auto rp = std::make_shared(); @@ -237,12 +237,12 @@ TEST_F(RinexPrinterTest, GlonassObsHeader) auto pvt_solution = std::make_shared(rtk, conf, "filename", 28, false, false); auto eph = Glonass_Gnav_Ephemeris(); eph.PRN = 1; - pvt_solution->glonass_gnav_ephemeris_map[1] = eph; + pvt_solution->glonass_gnav_ephemeris_map[1] = std::move(eph); std::map gnss_observables_map; Gnss_Synchro gs{}; gs.PRN = 1; - gnss_observables_map[1] = gs; + gnss_observables_map[1] = std::move(gs); auto rp = std::make_shared(3); @@ -305,7 +305,7 @@ TEST_F(RinexPrinterTest, MixedObsHeader) Gnss_Synchro gs{}; gs.PRN = 1; gnss_observables_map[1] = gs; - gnss_observables_map[2] = gs; + gnss_observables_map[2] = std::move(gs); auto rp = std::make_shared(); @@ -369,15 +369,15 @@ TEST_F(RinexPrinterTest, MixedObsHeaderGpsGlo) Pvt_Conf conf; conf.use_e6_for_pvt = false; auto pvt_solution = std::make_shared(rtk, conf, "filename", 26, false, false); - pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo; + pvt_solution->glonass_gnav_ephemeris_map[1] = std::move(eph_glo); - pvt_solution->gps_ephemeris_map[1] = eph_gps; + pvt_solution->gps_ephemeris_map[1] = std::move(eph_gps); std::map gnss_observables_map; Gnss_Synchro gs{}; gs.PRN = 1; gnss_observables_map[1] = gs; - gnss_observables_map[2] = gs; + gnss_observables_map[2] = std::move(gs); auto rp = std::make_shared(); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 8150fcfce..9c527d10e 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -86,8 +86,8 @@ int FrontEndCal::Get_SUPL_Assist() LOG(INFO) << "SUPL RRLP GPS assistance enabled!"; std::string default_acq_server = "supl.nokia.com"; std::string default_eph_server = "supl.google.com"; - supl_client_ephemeris_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_server", default_acq_server); - supl_client_acquisition_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_server", default_eph_server); + supl_client_ephemeris_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_server", std::move(default_acq_server)); + supl_client_acquisition_.server_name = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_server", std::move(default_eph_server)); supl_client_ephemeris_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_port", 7275); supl_client_acquisition_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_port", 7275); supl_mcc = configuration_->property("GNSS-SDR.SUPL_MCC", 244); @@ -97,7 +97,7 @@ int FrontEndCal::Get_SUPL_Assist() std::string default_ci = "0x31b0"; try { - supl_lac = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_LAC", default_lac)); + supl_lac = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_LAC", std::move(default_lac))); } catch (boost::bad_lexical_cast &) { @@ -105,7 +105,7 @@ int FrontEndCal::Get_SUPL_Assist() } try { - supl_ci = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_CI", default_ci)); + supl_ci = boost::lexical_cast(configuration_->property("GNSS-SDR.SUPL_CI", std::move(default_ci))); } catch (boost::bad_lexical_cast &) { From 4f36210536a16dd89870c3e26a598c11dfd06efb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 1 Dec 2023 10:20:52 +0100 Subject: [PATCH 25/34] Fix warnings --- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 19 ++++++++++--------- src/algorithms/libs/rtklib/rtklib_stream.cc | 14 +++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 9d194f7aa..de9bcccb7 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -2983,7 +2983,7 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time, const pcvs_t *pcvs) { pcv_t *pcv; - char buff[MAXANT] = ""; + char buff[MAXANT + 1] = ""; char *types[2]; char *p; int i; @@ -3730,12 +3730,12 @@ int savenav(const char *file, const nav_t *nav) } auto id = satno2id(nav->eph[i].sat); fprintf(fp, - "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%s,%d,%d,%d,%d,%lld,%lld,%lld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%d,%d\n", id.data(), nav->eph[i].iode, nav->eph[i].iodc, nav->eph[i].sva, - nav->eph[i].svh, static_cast(nav->eph[i].toe.time), - static_cast(nav->eph[i].toc.time), static_cast(nav->eph[i].ttr.time), + nav->eph[i].svh, static_cast(nav->eph[i].toe.time), + static_cast(nav->eph[i].toc.time), static_cast(nav->eph[i].ttr.time), nav->eph[i].A, nav->eph[i].e, nav->eph[i].i0, nav->eph[i].OMG0, nav->eph[i].omg, nav->eph[i].M0, nav->eph[i].deln, nav->eph[i].OMGd, nav->eph[i].idot, nav->eph[i].crc, nav->eph[i].crs, nav->eph[i].cuc, @@ -3751,11 +3751,11 @@ int savenav(const char *file, const nav_t *nav) } auto id = satno2id(nav->geph[i].sat); fprintf(fp, - "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%s,%d,%d,%d,%d,%d,%lld,%lld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E\n", id.data(), nav->geph[i].iode, nav->geph[i].frq, nav->geph[i].svh, - nav->geph[i].sva, nav->geph[i].age, static_cast(nav->geph[i].toe.time), - static_cast(nav->geph[i].tof.time), + nav->geph[i].sva, nav->geph[i].age, static_cast(nav->geph[i].toe.time), + static_cast(nav->geph[i].tof.time), nav->geph[i].pos[0], nav->geph[i].pos[1], nav->geph[i].pos[2], nav->geph[i].vel[0], nav->geph[i].vel[1], nav->geph[i].vel[2], nav->geph[i].acc[0], nav->geph[i].acc[1], nav->geph[i].acc[2], @@ -5016,7 +5016,7 @@ int rtk_uncompress(const char *file, char *uncfile) int stat = 0; char *p; char cmd[2048] = ""; - char tmpfile[1024] = ""; + char tmpfile[1025] = ""; char buff[1024]; char *fname; char *dir = const_cast(""); @@ -5157,7 +5157,7 @@ int expath(const char *path, char *paths[], int nmax) int i; int j; int n = 0; - char tmp[1024] = ""; + char tmp[1025] = ""; struct dirent *d; DIR *dp; const char *file = path; @@ -5230,6 +5230,7 @@ int expath(const char *path, char *paths[], int nmax) } std::strncpy(paths[i], paths[j], 1024); std::strncpy(paths[j], tmp, 1024); + paths[j][1023] = '\0'; } } } diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index e9a29cf3f..3cb647ad6 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -81,7 +81,8 @@ serial_t *openserial(const char *path, int mode, char *msg) char *p; char parity = 'N'; char dev[128]; - char port[128]; + char port[128] = ""; + port[127] = '\0'; char fctr[64] = ""; const speed_t bs[] = { @@ -105,7 +106,7 @@ serial_t *openserial(const char *path, int mode, char *msg) } else if (strlen(path) < 128) { - std::strncpy(port, path, 128); + std::strncpy(port, path, 127); port[127] = '\0'; } @@ -124,7 +125,6 @@ serial_t *openserial(const char *path, int mode, char *msg) return nullptr; } parity = static_cast(toupper(static_cast(parity))); - std::string s_aux = "/dev/"s + std::string(port); s_aux.resize(128, '\0'); int n = s_aux.length(); @@ -705,7 +705,7 @@ void syncfile(file_t *file1, file_t *file2) void decodetcppath(const char *path, char *addr, char *port, char *user, char *passwd, char *mntpnt, char *str) { - char buff[MAXSTRPATH] = ""; + char buff[MAXSTRPATH + 1] = ""; char *p; char *q; @@ -1827,7 +1827,7 @@ int statentrip(ntrip_t *ntrip) void decodeftppath(const char *path, char *addr, char *file, char *user, char *passwd, int *topts) { - char buff[MAXSTRPATH] = ""; + char buff[MAXSTRPATH + 1] = ""; char *p; char *q; @@ -1896,7 +1896,7 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, p = buff; } - std::strncpy(addr, p, 1024); + std::strncpy(addr, p, 1023); addr[1023] = '\0'; } @@ -2254,7 +2254,7 @@ int stropen(stream_t *stream, int type, int mode, const char *path) stream->mode = mode; if (strlen(path) < MAXSTRPATH) { - std::strncpy(stream->path, path, MAXSTRPATH); + std::strncpy(stream->path, path, MAXSTRPATH - 1); stream->path[MAXSTRPATH - 1] = '\0'; } stream->inb = stream->inr = stream->outb = stream->outr = 0; From 1a4e5f43afd2692e32b2e9b897cab142f7e58c2c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 1 Dec 2023 11:53:54 +0100 Subject: [PATCH 26/34] Fix warnings --- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index de9bcccb7..512d3958c 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -3730,12 +3730,12 @@ int savenav(const char *file, const nav_t *nav) } auto id = satno2id(nav->eph[i].sat); fprintf(fp, - "%s,%d,%d,%d,%d,%lld,%lld,%lld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%s,%d,%d,%d,%d,%ld,%ld,%ld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%d,%d\n", id.data(), nav->eph[i].iode, nav->eph[i].iodc, nav->eph[i].sva, - nav->eph[i].svh, static_cast(nav->eph[i].toe.time), - static_cast(nav->eph[i].toc.time), static_cast(nav->eph[i].ttr.time), + nav->eph[i].svh, static_cast(nav->eph[i].toe.time), + static_cast(nav->eph[i].toc.time), static_cast(nav->eph[i].ttr.time), nav->eph[i].A, nav->eph[i].e, nav->eph[i].i0, nav->eph[i].OMG0, nav->eph[i].omg, nav->eph[i].M0, nav->eph[i].deln, nav->eph[i].OMGd, nav->eph[i].idot, nav->eph[i].crc, nav->eph[i].crs, nav->eph[i].cuc, @@ -3751,11 +3751,11 @@ int savenav(const char *file, const nav_t *nav) } auto id = satno2id(nav->geph[i].sat); fprintf(fp, - "%s,%d,%d,%d,%d,%d,%lld,%lld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," + "%s,%d,%d,%d,%d,%d,%ld,%ld,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," "%.14E,%.14E,%.14E,%.14E,%.14E,%.14E\n", id.data(), nav->geph[i].iode, nav->geph[i].frq, nav->geph[i].svh, - nav->geph[i].sva, nav->geph[i].age, static_cast(nav->geph[i].toe.time), - static_cast(nav->geph[i].tof.time), + nav->geph[i].sva, nav->geph[i].age, static_cast(nav->geph[i].toe.time), + static_cast(nav->geph[i].tof.time), nav->geph[i].pos[0], nav->geph[i].pos[1], nav->geph[i].pos[2], nav->geph[i].vel[0], nav->geph[i].vel[1], nav->geph[i].vel[2], nav->geph[i].acc[0], nav->geph[i].acc[1], nav->geph[i].acc[2], @@ -5016,7 +5016,8 @@ int rtk_uncompress(const char *file, char *uncfile) int stat = 0; char *p; char cmd[2048] = ""; - char tmpfile[1025] = ""; + char tmpfile[1024] = ""; + tmpfile[1023] = '\0'; char buff[1024]; char *fname; char *dir = const_cast(""); @@ -5067,6 +5068,7 @@ int rtk_uncompress(const char *file, char *uncfile) std::strncpy(uncfile, tmpfile, 1024); uncfile[p - tmpfile] = '\0'; std::strncpy(buff, tmpfile, 1024); + buff[1023] = '\0'; fname = buff; if ((p = strrchr(buff, '/'))) { @@ -5157,7 +5159,8 @@ int expath(const char *path, char *paths[], int nmax) int i; int j; int n = 0; - char tmp[1025] = ""; + char tmp[1024] = ""; + tmp[1023] = '\0'; struct dirent *d; DIR *dp; const char *file = path; @@ -5222,7 +5225,6 @@ int expath(const char *path, char *paths[], int nmax) if (strlen(paths[i]) < 1025) { std::strncpy(tmp, paths[i], 1024); - tmp[1023] = '\0'; } else { From 1685c896eae5e00b2053f17e3825e96730f69167 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 1 Dec 2023 13:35:31 +0100 Subject: [PATCH 27/34] Fix annotation rate for KML, GPX, GeoJSON, and NMEA --- docs/CHANGELOG.md | 10 ++++++++++ src/algorithms/PVT/libs/pvt_conf.h | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a4348315e..648aa380a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -85,6 +85,16 @@ All notable changes to GNSS-SDR will be documented in this file. overkilling nine (the ninth decimal place worths up to 110 microns). Similarly, height in meters is now reported with two decimal places instead of three, and velocity in m/s also with two decimal places instead of three. +- Fixed the rate at which KLM, GPX, GeoJSON, and NMEA annotations are made. The + rate is now set by `PVT.output_rate_ms` (`500` ms by default), and can be + particularized by `PVT.kml_rate_ms`, `PVT.gpx_rate_ms`, `PVT.geojson_rate_ms`, + and `PVT.nmea_rate_ms`. Those values should be multiples of + `PVT.output_rate_ms`, or the least common multiple will be taken. + +See the definitions of concepts and metrics at +https://gnss-sdr.org/design-forces/ + +  ## [GNSS-SDR v0.0.18](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.18) - 2023-04-06 diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 80f4494d5..37d9b5aac 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -56,13 +56,13 @@ public: int32_t output_rate_ms = 0; int32_t display_rate_ms = 0; - int32_t kml_rate_ms = 1000; - int32_t gpx_rate_ms = 1000; - int32_t geojson_rate_ms = 1000; - int32_t nmea_rate_ms = 1000; + int32_t kml_rate_ms = 20; + int32_t gpx_rate_ms = 20; + int32_t geojson_rate_ms = 20; + int32_t nmea_rate_ms = 20; int32_t rinex_version = 0; int32_t rinexobs_rate_ms = 0; - int32_t an_rate_ms = 1000; + int32_t an_rate_ms = 20; int32_t max_obs_block_rx_clock_offset_ms = 40; int udp_port = 0; int udp_eph_port = 0; From 4afee8b7be401a4174e90f5a12524b4d173b8fdc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 2 Dec 2023 12:51:33 +0100 Subject: [PATCH 28/34] Avoid memory illegal access detected by Coverity Scan --- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 512d3958c..f216e1344 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -5225,6 +5225,7 @@ int expath(const char *path, char *paths[], int nmax) if (strlen(paths[i]) < 1025) { std::strncpy(tmp, paths[i], 1024); + tmp[1023] = '\0'; } else { From a152226f50d8268b3c1976fbbbfa9dadbc4f52e8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 2 Dec 2023 12:54:28 +0100 Subject: [PATCH 29/34] Fix potenctial data race condition --- src/algorithms/channel/adapters/channel.cc | 7 +++++++ src/algorithms/channel/adapters/channel.h | 2 +- src/core/interfaces/channel_interface.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 69b84ca0c..444eef958 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -212,6 +212,13 @@ gr::basic_block_sptr Channel::get_right_block() } +Gnss_Signal Channel::get_signal() +{ + std::lock_guard lk(mx_); + return gnss_signal_; +} + + void Channel::set_signal(const Gnss_Signal& gnss_signal) { std::lock_guard lk(mx_); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index a8e80123a..834cc5cd7 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -84,7 +84,7 @@ public: inline std::string role() override { return role_; } inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel" inline size_t item_size() override { return 2 * sizeof(float); } - inline Gnss_Signal get_signal() const override { return gnss_signal_; } + Gnss_Signal get_signal() override; void start_acquisition() override; //!< Start the State Machine void stop_channel() override; //!< Stop the State Machine void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal diff --git a/src/core/interfaces/channel_interface.h b/src/core/interfaces/channel_interface.h index da0da3ccc..9224ed0e3 100644 --- a/src/core/interfaces/channel_interface.h +++ b/src/core/interfaces/channel_interface.h @@ -49,7 +49,7 @@ public: virtual gr::basic_block_sptr get_right_block_acq() = 0; virtual gr::basic_block_sptr get_left_block() = 0; virtual gr::basic_block_sptr get_right_block() = 0; - virtual Gnss_Signal get_signal() const = 0; + virtual Gnss_Signal get_signal() = 0; virtual void start_acquisition() = 0; virtual void assist_acquisition_doppler(double Carrier_Doppler_hz) = 0; virtual void stop_channel() = 0; From 15ddddf7c58492d441325ee4492ae024cfde9b1b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 2 Dec 2023 13:01:08 +0100 Subject: [PATCH 30/34] Fix potenctial data race condition --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 9 ++++++++- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index fe04d5369..bd72d4cde 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -537,6 +537,13 @@ void gps_l1_ca_telemetry_decoder_gs::frame_synchronization(const Gnss_Synchro &c } +bool gps_l1_ca_telemetry_decoder_gs::is_PLL_180_deg_phase_locked() +{ + gr::thread::scoped_lock lock(d_setlock); + return d_flag_PLL_180_deg_phase_locked; +} + + int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -613,7 +620,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ d_nav_msg_packet.nav_message = ""; } - if (d_flag_PLL_180_deg_phase_locked == true) + if (is_PLL_180_deg_phase_locked()) { // correct the accumulated phase for the Costas loop phase shift, if required current_symbol.Carrier_phase_rads += GNSS_PI; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index 8b00d51ce..5939163bc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h @@ -75,6 +75,7 @@ private: void check_tlm_separation(); void frame_synchronization(const Gnss_Synchro ¤t_gs); + bool is_PLL_180_deg_phase_locked(); bool gps_word_parityCheck(uint32_t gpsword); bool decode_subframe(double cn0, bool flag_invert); From 3ad02f6dc1ab1f5b6835272e0ceae619486eb194 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 2 Dec 2023 13:31:29 +0100 Subject: [PATCH 31/34] Update volk_gnsssdr_option_helpers --- .../apps/volk_gnsssdr_option_helpers.cc | 251 ++++++++++++------ .../apps/volk_gnsssdr_option_helpers.h | 36 ++- .../volk_gnsssdr/apps/volk_gnsssdr_profile.cc | 3 +- 3 files changed, 199 insertions(+), 91 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc index 84d09aa3d..752359499 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc @@ -15,70 +15,118 @@ #include // for pair -/* - * Option type - */ -option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)()) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback(callback) { option_type = VOID_CALLBACK; } +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)()) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + callback(t_callback) +{ + option_type = VOID_CALLBACK; +} -option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(int)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)())callback) { option_type = INT_CALLBACK; } -option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(float)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)())callback) { option_type = FLOAT_CALLBACK; } +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(int)) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + callback((void (*)())t_callback) +{ + option_type = INT_CALLBACK; +} -option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(bool)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)())callback) { option_type = BOOL_CALLBACK; } -option_t::option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(std::string)) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - callback((void (*)())callback) { option_type = STRING_CALLBACK; } +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(float)) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + callback((void (*)())t_callback) +{ + option_type = FLOAT_CALLBACK; +} -option_t::option_t(std::string longform, std::string shortform, std::string msg, std::string printval) - : longform("--" + longform), - shortform("-" + shortform), - msg(msg), - printval(printval) { option_type = STRING; } + +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(bool)) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + callback((void (*)())t_callback) +{ + option_type = BOOL_CALLBACK; +} + + +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(std::string)) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + callback((void (*)())t_callback) +{ + option_type = STRING_CALLBACK; +} + + +option_t::option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + std::string t_printval) + : longform("--" + t_longform), + shortform("-" + t_shortform), + msg(t_msg), + printval(t_printval) +{ + option_type = STRING; +} /* * Option List */ -option_list::option_list(std::string program_name) : program_name(program_name) +option_list::option_list(std::string program_name) : d_program_name(program_name) { - { - internal_list = std::vector(); - } + d_internal_list = std::vector(); } -void option_list::add(const option_t &opt) { internal_list.push_back(opt); } -void option_list::parse(int argc, char **argv) +void option_list::add(const option_t& opt) { d_internal_list.push_back(opt); } + + +void option_list::parse(int argc, char** argv) { for (int arg_number = 0; arg_number < argc; ++arg_number) { - for (std::vector::iterator this_option = internal_list.begin(); - this_option != internal_list.end(); + for (std::vector::iterator this_option = d_internal_list.begin(); + this_option != d_internal_list.end(); this_option++) { + int int_val = INT_MIN; if (this_option->longform == std::string(argv[arg_number]) || this_option->shortform == std::string(argv[arg_number])) { + if (d_present_options.count(this_option->longform) == 0) + { + d_present_options.insert( + std::pair(this_option->longform, 1)); + } + else + { + d_present_options[this_option->longform] += 1; + } switch (this_option->option_type) { case VOID_CALLBACK: @@ -87,54 +135,94 @@ void option_list::parse(int argc, char **argv) case INT_CALLBACK: try { - int int_val = std::stoi(argv[++arg_number]); + int_val = atoi(argv[++arg_number]); ((void (*)(int))this_option->callback)(int_val); } - catch (std::exception &exc) + catch (std::exception& exc) { - std::cout << "An int option can only receive a number\n"; + std::cout << "An int option can only receive a number" + << std::endl; throw std::exception(); }; break; case FLOAT_CALLBACK: try { - int int_val = std::stof(argv[++arg_number]); - ((void (*)(float))this_option->callback)(int_val); + double double_val = atof(argv[++arg_number]); + ((void (*)(float))this_option->callback)(double_val); } - catch (std::exception &exc) + catch (std::exception& exc) { - std::cout << "A float option can only receive a number\n"; + std::cout << "A float option can only receive a number" + << std::endl; throw std::exception(); }; break; case BOOL_CALLBACK: try { - bool int_val = (bool)std::stoi(argv[++arg_number]); + if (arg_number == (argc - 1)) + { // this is the last arg + int_val = 1; + } + else + { // sneak a look at the next arg since it's present + char* next_arg = argv[arg_number + 1]; + if ((strncmp(next_arg, "-", 1) == 0) || + (strncmp(next_arg, "--", 2) == 0)) + { + // the next arg is actually an arg, the bool is just + // present, set to true + int_val = 1; + } + else if (strncmp(next_arg, "true", 4) == 0) + { + int_val = 1; + } + else if (strncmp(next_arg, "false", 5) == 0) + { + int_val = 0; + } + else + { + // we got a number or a string. + // convert it to a number and depend on the catch to + // report an error condition + int_val = (bool)atoi(argv[++arg_number]); + } + } + } + catch (std::exception& e) + { + int_val = INT_MIN; + }; + if (int_val == INT_MIN) + { + std::cout + << "option: '" << argv[arg_number - 1] + << "' -> received an unknown value. Boolean " + "options should receive one of '0', '1', 'true', 'false'." + << std::endl; + throw std::exception(); + } + else if (int_val) + { ((void (*)(bool))this_option->callback)(int_val); } - catch (std::exception &exc) - { - std::cout << "A bool option can only receive 0 or 1\n"; - throw std::exception(); - }; break; case STRING_CALLBACK: try { - ((void (*)(std::string))this_option->callback)(argv[++arg_number]); + ((void (*)(std::string))this_option->callback)( + argv[++arg_number]); } - catch (std::exception &exc) + catch (std::exception& exc) { throw std::exception(); }; break; case STRING: - std::cout << this_option->printval << '\n'; - break; - default: - this_option->callback(); + std::cout << this_option->printval << std::endl; break; } } @@ -142,17 +230,31 @@ void option_list::parse(int argc, char **argv) if (std::string("--help") == std::string(argv[arg_number]) || std::string("-h") == std::string(argv[arg_number])) { + d_present_options.insert(std::pair("--help", 1)); help(); } } } + +bool option_list::present(std::string option_name) +{ + if (d_present_options.count("--" + option_name)) + { + return true; + } + else + { + return false; + } +} + void option_list::help() { - std::cout << program_name << '\n'; - std::cout << " -h [ --help ] \t\tDisplay this help message\n"; - for (std::vector::iterator this_option = internal_list.begin(); - this_option != internal_list.end(); + std::cout << d_program_name << std::endl; + std::cout << " -h [ --help ] \t\tdisplay this help message" << std::endl; + for (std::vector::iterator this_option = d_internal_list.begin(); + this_option != d_internal_list.end(); this_option++) { std::string help_line(" "); @@ -165,24 +267,11 @@ void option_list::help() help_line += this_option->shortform + " [ " + this_option->longform + " ]"; } - switch (help_line.size() / 8) + while (help_line.size() < 32) { - case 0: - help_line += "\t\t\t\t"; - break; - case 1: - help_line += "\t\t\t"; - break; - case 2: - help_line += "\t\t"; - break; - case 3: - help_line += "\t"; - break; - default: - break; + help_line += " "; } help_line += this_option->msg; - std::cout << help_line << '\n'; + std::cout << help_line << std::endl; } -} +} \ No newline at end of file diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h index cc481b4a8..6a30eaaaa 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.h @@ -29,12 +29,30 @@ typedef enum class option_t { public: - option_t(std::string longform, std::string shortform, std::string msg, void (*callback)()); - option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(int)); - option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(float)); - option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(bool)); - option_t(std::string longform, std::string shortform, std::string msg, void (*callback)(std::string)); - option_t(std::string longform, std::string shortform, std::string msg, std::string printval); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)()); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(int)); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(float)); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(bool)); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + void (*t_callback)(std::string)); + option_t(std::string t_longform, + std::string t_shortform, + std::string t_msg, + std::string t_printval); std::string longform; std::string shortform; @@ -48,6 +66,7 @@ class option_list { public: explicit option_list(std::string program_name); + bool present(std::string option_name); void add(const option_t &opt); @@ -56,8 +75,9 @@ public: void help(); private: - std::string program_name; - std::vector internal_list; + std::string d_program_name; + std::vector d_internal_list; + std::map d_present_options; }; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 5a060c3d1..f4d248f79 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -81,8 +81,7 @@ int main(int argc, char *argv[]) for (int arg_number = 0; arg_number < argc; ++arg_number) { - if (std::string("--help") == std::string(argv[arg_number]) || - std::string("-h") == std::string(argv[arg_number])) + if (profile_options.present("help")) { return 0; } From e836d8f4714cee90deda7b506851c9582344010e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 3 Dec 2023 10:10:40 +0100 Subject: [PATCH 32/34] Fix more defects detected by Coverity Scan --- .../apps/volk_gnsssdr_option_helpers.cc | 14 +++++++------- .../volk_gnsssdr/apps/volk_gnsssdr_profile.cc | 2 +- .../volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc | 6 +++--- .../control-plane/in_memory_configuration_test.cc | 5 +++-- ...e5a_pcps_acquisition_gsoc2014_gensource_test.cc | 2 +- .../filter/fir_filter_test.cc | 4 ++-- .../pvt/rinex_printer_test.cc | 8 ++++---- .../sources/file_signal_source_test.cc | 5 +++-- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc index 752359499..f88da8bd7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_option_helpers.cc @@ -21,7 +21,7 @@ option_t::option_t(std::string t_longform, void (*t_callback)()) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), + msg(std::move(t_msg)), callback(t_callback) { option_type = VOID_CALLBACK; @@ -34,7 +34,7 @@ option_t::option_t(std::string t_longform, void (*t_callback)(int)) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), + msg(std::move(t_msg)), callback((void (*)())t_callback) { option_type = INT_CALLBACK; @@ -47,7 +47,7 @@ option_t::option_t(std::string t_longform, void (*t_callback)(float)) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), + msg(std::move(t_msg)), callback((void (*)())t_callback) { option_type = FLOAT_CALLBACK; @@ -60,7 +60,7 @@ option_t::option_t(std::string t_longform, void (*t_callback)(bool)) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), + msg(std::move(t_msg)), callback((void (*)())t_callback) { option_type = BOOL_CALLBACK; @@ -73,7 +73,7 @@ option_t::option_t(std::string t_longform, void (*t_callback)(std::string)) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), + msg(std::move(t_msg)), callback((void (*)())t_callback) { option_type = STRING_CALLBACK; @@ -86,8 +86,8 @@ option_t::option_t(std::string t_longform, std::string t_printval) : longform("--" + t_longform), shortform("-" + t_shortform), - msg(t_msg), - printval(t_printval) + msg(std::move(t_msg)), + printval(std::move(t_printval)) { option_type = STRING; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index f4d248f79..27715f406 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) if (!dry_run) { if (config_file != "") - write_results(&results, false, config_file); + write_results(&results, false, std::move(config_file)); else write_results(&results, false); } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index c0105fb21..274d2fd48 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -33,8 +33,8 @@ int main(int argc, char* argv[]) std::string def_kernel_regex = ""; volk_gnsssdr_test_params_t test_params(def_tol, def_scalar, def_vlen, def_iter, - def_benchmark_mode, def_kernel_regex); - std::vector test_cases = init_test_list(test_params); + def_benchmark_mode, std::move(def_kernel_regex)); + std::vector test_cases = init_test_list(std::move(test_params)); std::vector results; if (argc > 1) { @@ -94,7 +94,7 @@ int main(int argc, char* argv[]) } // Generate XML results - print_qa_xml(results, qa_failures.size()); + print_qa_xml(std::move(results), qa_failures.size()); // Summarize QA results std::cerr << "Kernel QA finished: " << qa_failures.size() << " failures out of " diff --git a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc index 4691bc0a0..a51ef89b1 100644 --- a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc @@ -18,6 +18,7 @@ #include "configuration_interface.h" #include "gnss_sdr_make_unique.h" #include "in_memory_configuration.h" +#include TEST(InMemoryConfiguration, IsPresent) { @@ -35,7 +36,7 @@ TEST(InMemoryConfiguration, StoreAndRetrieve) auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "value"); std::string default_value = "default_value"; - std::string value = configuration->property("Foo.property1", default_value); + std::string value = configuration->property("Foo.property1", std::move(default_value)); EXPECT_STREQ("value", value.c_str()); } @@ -45,7 +46,7 @@ TEST(InMemoryConfiguration, NoStoringAndRetrieve) // std::shared_ptr configuration = std::make_shared(); auto configuration = std::make_unique(); std::string default_value = "default_value"; - std::string value = configuration->property("Foo.property1", default_value); + std::string value = configuration->property("Foo.property1", std::move(default_value)); EXPECT_STREQ("default_value", value.c_str()); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index d90e8b0e9..33d60383e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -225,7 +225,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_1() config = std::make_shared(); - config->set_property("Channel.signal", signal); + config->set_property("Channel.signal", std::move(signal)); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in)); config->set_property("SignalSource.fs_hz", std::to_string(fs_in)); config->set_property("SignalSource.item_type", "gr_complex"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 60987b0f2..ec1b783ef 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -267,7 +267,7 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) config2->set_property("Test_Source.sampling_frequency", "4000000"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - config2->set_property("Test_Source.filename", filename); + config2->set_property("Test_Source.filename", std::move(filename)); config2->set_property("Test_Source.item_type", "ishort"); config2->set_property("Test_Source.repeat", "true"); @@ -357,7 +357,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) config2->set_property("Test_Source.sampling_frequency", "4000000"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - config2->set_property("Test_Source.filename", filename); + config2->set_property("Test_Source.filename", std::move(filename)); config2->set_property("Test_Source.item_type", "ibyte"); config2->set_property("Test_Source.repeat", "true"); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index ea0aac0bd..754bae627 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -796,8 +796,8 @@ TEST_F(RinexPrinterTest, MixedObsLog) Pvt_Conf conf; conf.use_e6_for_pvt = false; auto pvt_solution = std::make_shared(rtk, conf, "filename", 9, false, false); - pvt_solution->gps_ephemeris_map[1] = eph_gps; - pvt_solution->galileo_ephemeris_map[1] = eph_gal; + pvt_solution->gps_ephemeris_map[1] = std::move(eph_gps); + pvt_solution->galileo_ephemeris_map[1] = std::move(eph_gal); std::map gnss_observables_map; Gnss_Synchro gs1 = Gnss_Synchro(); @@ -922,8 +922,8 @@ TEST_F(RinexPrinterTest, MixedObsLogGpsGlo) Pvt_Conf conf; conf.use_e6_for_pvt = false; auto pvt_solution = std::make_shared(rtk, conf, "filename", 26, false, false); - pvt_solution->gps_ephemeris_map[1] = eph_gps; - pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo; + pvt_solution->gps_ephemeris_map[1] = std::move(eph_gps); + pvt_solution->glonass_gnav_ephemeris_map[1] = std::move(eph_glo); std::map gnss_observables_map; Gnss_Synchro gs1 = Gnss_Synchro(); diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc index 2057811f4..f07f02835 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc @@ -22,6 +22,7 @@ #include #include #include +#include TEST(FileSignalSource, Instantiate) { @@ -32,7 +33,7 @@ TEST(FileSignalSource, Instantiate) config->set_property("Test.sampling_frequency", "0"); std::string path = std::string(TEST_PATH); std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; - config->set_property("Test.filename", filename); + config->set_property("Test.filename", std::move(filename)); config->set_property("Test.item_type", "gr_complex"); config->set_property("Test.repeat", "false"); @@ -57,5 +58,5 @@ TEST(FileSignalSource, InstantiateFileNotExists) // connect doesn't matter, since the exception should be thrown sooner than any connections auto top = gr::make_top_block("GNSSUnitTest"); auto uptr = std::make_shared(config.get(), "Test", 0, 1, queue.get()); - EXPECT_THROW({ uptr->connect(top); }, std::exception); + EXPECT_THROW({ uptr->connect(std::move(top)); }, std::exception); } From 906d7173816541fd216444f23b9c23f1a589214d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 3 Dec 2023 11:42:30 +0100 Subject: [PATCH 33/34] Fix more defects detected by Coverity Scan --- .../volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 2257e51f0..10697e7a1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -20,8 +20,8 @@ #include // for numeric_limits #include // for map #include // for random_device, default_random_engine, uniform_real_distribution -#include // for vector - +#include +#include // for vector template void random_values(T *buf, unsigned int n, std::default_random_engine &e1) @@ -946,14 +946,14 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc, if (puppet_master_name == "NULL") { - results->back().config_name = name; + results->back().config_name = std::move(name); } else { - results->back().config_name = puppet_master_name; + results->back().config_name = std::move(puppet_master_name); } - results->back().best_arch_a = best_arch_a; - results->back().best_arch_u = best_arch_u; + results->back().best_arch_a = std::move(best_arch_a); + results->back().best_arch_u = std::move(best_arch_u); return fail_global; } From e286a0d807b3e99ee58337fc8b04faacb2e9e9cd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 3 Dec 2023 14:33:23 +0100 Subject: [PATCH 34/34] Fix more defects detected by Coverity Scan --- .../volk_gnsssdr/apps/volk_gnsssdr_profile.cc | 2 +- .../volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc | 3 +-- .../libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h | 9 +++++---- .../pvt/serdes_monitor_pvt_test.cc | 3 ++- .../telemetry_decoder/galileo_fnav_inav_decoder_test.cc | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 27715f406..2c52adf65 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -47,7 +47,7 @@ void set_benchmark(bool val) { test_params.set_benchmark(val); } void set_tolerance(float val) { test_params.set_tol(val); } void set_vlen(int val) { test_params.set_vlen((unsigned int)val); } void set_iter(int val) { test_params.set_iter((unsigned int)val); } -void set_substr(std::string val) { test_params.set_regex(val); } +void set_substr(std::string val) { test_params.set_regex(std::move(val)); } bool update_mode = false; void set_update(bool val) { update_mode = val; } bool dry_run = false; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 10697e7a1..c4aeb1a5e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -20,8 +20,7 @@ #include // for numeric_limits #include // for map #include // for random_device, default_random_engine, uniform_real_distribution -#include -#include // for vector +#include // for vector template void random_values(T *buf, unsigned int n, std::default_random_engine &e1) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index 878c73659..1bfd1c991 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -19,6 +19,7 @@ #include // for NULL #include // for map #include // for string, basic_string +#include // for move #include // for vector @@ -69,14 +70,14 @@ private: public: // ctor volk_gnsssdr_test_params_t(float tol, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, - bool benchmark_mode, std::string kernel_regex) : _tol(tol), _scalar(scalar), _vlen(vlen), _iter(iter), _benchmark_mode(benchmark_mode), _kernel_regex(kernel_regex){}; + bool benchmark_mode, std::string kernel_regex) : _tol(tol), _scalar(scalar), _vlen(vlen), _iter(iter), _benchmark_mode(benchmark_mode), _kernel_regex(std::move(kernel_regex)){}; // setters void set_tol(float tol) { _tol = tol; }; void set_scalar(lv_32fc_t scalar) { _scalar = scalar; }; void set_vlen(unsigned int vlen) { _vlen = vlen; }; void set_iter(unsigned int iter) { _iter = iter; }; void set_benchmark(bool benchmark) { _benchmark_mode = benchmark; }; - void set_regex(std::string regex) { _kernel_regex = regex; }; + void set_regex(std::string regex) { _kernel_regex = std::move(regex); }; // getters float tol() { return _tol; }; lv_32fc_t scalar() { return _scalar; }; @@ -103,10 +104,10 @@ public: volk_gnsssdr_test_params_t test_parameters() { return _test_parameters; }; // normal ctor volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void (*kernel_ptr)(), std::string name, - volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), _puppet_master_name("NULL"){}; + volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(std::move(name)), _test_parameters(std::move(test_parameters)), _puppet_master_name("NULL"){}; // ctor for puppets volk_gnsssdr_test_case_t(volk_gnsssdr_func_desc_t desc, void (*kernel_ptr)(), std::string name, - std::string puppet_master_name, volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(name), _test_parameters(test_parameters), _puppet_master_name(puppet_master_name){}; + std::string puppet_master_name, volk_gnsssdr_test_params_t test_parameters) : _desc(desc), _kernel_ptr(kernel_ptr), _name(std::move(name)), _test_parameters(std::move(test_parameters)), _puppet_master_name(std::move(puppet_master_name)){}; }; /************************************************ diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc index 5cfca59d5..881bb60d8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/serdes_monitor_pvt_test.cc @@ -17,6 +17,7 @@ #include "serdes_galileo_eph.h" #include "serdes_monitor_pvt.h" #include +#include TEST(Serdes_Monitor_Pvt_Test, Simpletest) { @@ -41,7 +42,7 @@ TEST(Serdes_Monitor_Pvt_Test, GalileoEphemerisSerdes) eph->tow = true_tow; Serdes_Galileo_Eph gal_serdes = Serdes_Galileo_Eph(); - std::string serialized_data = gal_serdes.createProtobuffer(eph); + std::string serialized_data = gal_serdes.createProtobuffer(std::move(eph)); gnss_sdr::GalileoEphemeris ephgal; ephgal.ParseFromString(serialized_data); diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc index 61b4d60ef..1a73517bf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc @@ -28,6 +28,7 @@ #include // for std::back_inserter #include #include +#include class Galileo_FNAV_INAV_test : public ::testing::Test @@ -102,7 +103,7 @@ public: if (page_part_bits[0] == 1) { // DECODE COMPLETE WORD (even + odd) and TEST CRC - INAV_decoder.split_page(page_String, flag_even_word_arrived); + INAV_decoder.split_page(std::move(page_String), flag_even_word_arrived); if (INAV_decoder.get_flag_CRC_test() == true) { crc_ok = true;