From 63c1409b8fbbd04362975a441658c4bb3b68eb79 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 16:56:10 +0100 Subject: [PATCH 1/9] Update changelog --- docs/changelog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/changelog b/docs/changelog index 692a939ef..312543bc6 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,14 +1,29 @@ ## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) +### Improvements in Efficiency + +- Applied clang-tidy checks and fixes related to performance. + ### Improvements in Interoperability: - Added the BeiDou B1I receiver chain. +- Fix bug in GLONASS dual frequency receiver. + +### Improvements in Maintainability: + +- Usage of clang-tidy integrated into CMake scripts. New option -DENABLE_CLANG_TIDY=ON executes clang-tidy along with compilation. Requires clang compiler. +- Applied clang-tidy checks and fixes related to readability. ### Improvements in Portability: - CMake scripts now follow a modern approach (targets and properties) but still work in 2.8.12 +## Improvements in Reliability + +- Applied clang-tidy checks and fixes related to High Integrity C++. + + ## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) This release has several improvements in different dimensions, addition of new features and bug fixes: From a05aa22d396ebb9eba64882c9241b7f87380308d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 20:54:41 +0100 Subject: [PATCH 2/9] Fix building of FMCOMMS2 option --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a57aebad3..1272bc341 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1731,6 +1731,7 @@ endif() ############################################## if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) find_package(GRIIO) + find_package(LIBIIO) endif() From 9c2cebd9064d2148cd687c597fd97ef8d1f9a0b5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 21:18:30 +0100 Subject: [PATCH 3/9] Fix flexiband driver building --- src/core/receiver/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 538f2d72a..4909f9ae9 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -168,6 +168,13 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) + target_compile_definitions(core_receiver + PRIVATE + Gnuradio::teleorbit + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(core_receiver From e6ae1a307cac745abc55272006626062f841f04a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 21:22:36 +0100 Subject: [PATCH 4/9] Fix gn3s driver building --- src/core/receiver/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 4909f9ae9..b30c2295e 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -175,6 +175,13 @@ if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) ) endif() +if(ENABLE_GN3S AND GRGN3S_FOUND) + target_compile_definitions(core_receiver + PRIVATE + Gnuradio::gn3s + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(core_receiver From 2f83d1e7339fc4023008ceb8547261279a353879 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 21:34:42 +0100 Subject: [PATCH 5/9] Apply clang-tidy to flexiband driver --- .../adapters/flexiband_signal_source.cc | 12 +++++------- .../signal_source/adapters/flexiband_signal_source.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 95b3c56cd..26d371535 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -1,4 +1,4 @@ -/*! +(item_type_ == "gr_complex") /*! * \file raw_array_signal_source.cc * \brief CTTC Experimental GNSS 8 channels array signal source * \author Javier Arribas, jarribas(at)cttc.es @@ -36,10 +36,10 @@ #include -using google::LogMessage; + using google::LogMessage; FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); @@ -60,7 +60,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati RF_channels_ = configuration->property(role + ".RF_channels", 1); - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); flexiband_source_ = gr::teleorbit::frontend::make(firmware_filename_.c_str(), gain1_, gain2_, gain3_, AGC_, usb_packet_buffer_size_, signal_file.c_str(), flag_read_file); @@ -96,9 +96,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati } -FlexibandSignalSource::~FlexibandSignalSource() -{ -} +FlexibandSignalSource::~FlexibandSignalSource() = default; void FlexibandSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index 54e7eeff4..ed70b5bfd 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -53,7 +53,7 @@ class FlexibandSignalSource : public GNSSBlockInterface { public: FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~FlexibandSignalSource(); From 30a72d5c061839b39e5c86c6b112a32210f5965c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 21:49:07 +0100 Subject: [PATCH 6/9] Fix headers --- .../adapters/flexiband_signal_source.cc | 18 +++++++++++++----- .../adapters/flexiband_signal_source.h | 13 +++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 26d371535..213ab4b6b 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -1,6 +1,8 @@ -(item_type_ == "gr_complex") /*! - * \file raw_array_signal_source.cc - * \brief CTTC Experimental GNSS 8 channels array signal source +/*! + * \file flexiband_signal_source.cc + * \brief ignal Source adapter for the Teleorbit Flexiband front-end device. + * This adapter requires a Flexiband GNU Radio driver + * installed (not included with GNSS-SDR) * \author Javier Arribas, jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -36,10 +38,16 @@ #include - using google::LogMessage; +using google::LogMessage; FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration, - const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, + unsigned int in_stream, + unsigned int out_stream, + gr::msg_queue::sptr queue) : role_(role), + in_stream_(in_stream), + out_stream_(out_stream), + queue_(queue) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index ed70b5bfd..40030af6c 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -1,7 +1,8 @@ /*! - * \file raw_array_signal_source.h - * \brief Signal Source adapter for the Teleorbit Flexiband front-end device. - * This adapter requires a Flexiband GNURadio driver installed (not included with GNSS-SDR) + * \file flexiband_signal_source.h + * \brief ignal Source adapter for the Teleorbit Flexiband front-end device. + * This adapter requires a Flexiband GNU Radio driver + * installed (not included with GNSS-SDR) * \author Javier Arribas, jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -30,8 +31,8 @@ */ -#ifndef FLEXIBAND_SIGNAL_SOURCE_H_ -#define FLEXIBAND_SIGNAL_SOURCE_H_ +#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ +#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" #include @@ -108,4 +109,4 @@ private: boost::shared_ptr queue_; }; -#endif /*FLEXIBAND_SIGNAL_SOURCE_H_*/ +#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ From 13d8d19679f0badd065fa9b0094bb12f9873fbcb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 22:02:37 +0100 Subject: [PATCH 7/9] clang-tidy fixes --- .../signal_source/adapters/raw_array_signal_source.cc | 6 ++---- .../signal_source/adapters/raw_array_signal_source.h | 6 +++--- src/core/receiver/CMakeLists.txt | 11 +++++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc index b7f29a012..589af32c5 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -66,7 +66,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration int sampling_freq_; sampling_freq_ = configuration->property(role + ".sampling_freq", 5000000); - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); raw_array_source_ = gr::dbfcttc::raw_array::make(eth_device_.c_str(), channels_, snapshots_per_frame_, inter_frame_delay_, sampling_freq_); @@ -97,9 +97,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration } -RawArraySignalSource::~RawArraySignalSource() -{ -} +RawArraySignalSource::~RawArraySignalSource() = default; void RawArraySignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index 9af4df30f..321895cef 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -29,8 +29,8 @@ */ -#ifndef RAW_ARRAY_SIGNAL_SOURCE_H_ -#define RAW_ARRAY_SIGNAL_SOURCE_H_ +#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_ +#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" #include @@ -90,4 +90,4 @@ private: boost::shared_ptr queue_; }; -#endif /*RAW_ARRAY_SIGNAL_SOURCE_H_*/ +#endif /*GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_*/ diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index b30c2295e..469960d47 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -169,19 +169,26 @@ if(OS_IS_MACOSX) endif() if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) - target_compile_definitions(core_receiver + target_link_libraries(core_receiver PRIVATE Gnuradio::teleorbit ) endif() if(ENABLE_GN3S AND GRGN3S_FOUND) - target_compile_definitions(core_receiver + target_link_libraries(core_receiver PRIVATE Gnuradio::gn3s ) endif() +if(ENABLE_ARRAY AND GRDBFCTTC_FOUND) + target_link_libraries(core_receiver + PRIVATE + Gnuradio::dbfcttc + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(core_receiver From 00687408956373c673155d9c68e2499cff8e9d03 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 22:12:44 +0100 Subject: [PATCH 8/9] clang-tidy fixes --- .../signal_source/adapters/flexiband_signal_source.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 213ab4b6b..216fa084c 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -36,7 +36,7 @@ #include #include #include - +#include using google::LogMessage; @@ -47,7 +47,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + queue_(std::move(queue)) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); From 07259159afd4ac54d3a1056b2076e5581f53a882 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Feb 2019 21:34:15 +0000 Subject: [PATCH 9/9] Apply clang-tidy checks --- src/algorithms/libs/rtklib/rtklib_rtkpos.cc | 5 +-- .../adapters/ad9361_fpga_signal_source.cc | 2 +- .../adapters/ad9361_fpga_signal_source.h | 2 +- .../adapters/custom_udp_signal_source.cc | 2 +- .../adapters/custom_udp_signal_source.h | 2 +- .../gr_complex_ip_packet_source.cc | 32 +++++++++---------- .../gr_complex_ip_packet_source.h | 8 ++--- .../signal_source/libs/fpga_switch.cc | 12 +++---- .../signal_source/libs/fpga_switch.h | 6 ++-- 9 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 40645f9a0..e59327680 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -57,6 +57,7 @@ #include "rtklib_pntpos.h" #include "rtklib_ppp.h" #include "rtklib_tides.h" +#include #include static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), @@ -2672,7 +2673,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) } rtk->sol.age = static_cast(timediff(rtk->sol.time, solb.time)); - if (fabs(rtk->sol.age) > TTOL_MOVEB) + if (std::fabs(rtk->sol.age) > TTOL_MOVEB) { errmsg(rtk, "time sync error for moving-base (age=%.1f)\n", rtk->sol.age); return 0; @@ -2692,7 +2693,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) { rtk->sol.age = static_cast(timediff(obs[0].time, obs[nu].time)); - if (fabs(rtk->sol.age) > opt->maxtdiff) + if (std::fabs(rtk->sol.age) > opt->maxtdiff) { errmsg(rtk, "age of differential error (age=%.1f)\n", rtk->sol.age); outsolstat(rtk); diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index a9cade7c5..5d989b956 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -110,7 +110,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura std::string default_device_name = "/dev/uio13"; std::string device_name = configuration->property(role + ".devicename", default_device_name); int switch_position = configuration->property(role + ".switch_position", 0); - switch_fpga = std::make_shared(device_name); + switch_fpga = std::make_shared(device_name); switch_fpga->set_switch_position(switch_position); if (in_stream_ > 0) { diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 79ebeff3e..9277c4c2b 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -114,7 +114,7 @@ private: boost::shared_ptr queue_; - std::shared_ptr switch_fpga; + std::shared_ptr switch_fpga; }; #endif /*GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_*/ diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 2f2e76ef3..2b4714bca 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -72,7 +72,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati // output item size is always gr_complex item_size_ = sizeof(gr_complex); - udp_gnss_rx_source_ = gr_complex_ip_packet_source::make(capture_device, + udp_gnss_rx_source_ = Gr_Complex_Ip_Packet_Source::make(capture_device, address, port, payload_bytes, diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index bec7c3d73..18cc21c9e 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -97,7 +97,7 @@ private: bool dump_; std::string dump_filename_; std::vector> null_sinks_; - gr_complex_ip_packet_source::sptr udp_gnss_rx_source_; + Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; std::vector> file_sink_; boost::shared_ptr queue_; }; 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 ba6a8ec3e..8085e9e81 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 @@ -75,8 +75,8 @@ typedef struct gr_udp_header } gr_udp_header; -gr_complex_ip_packet_source::sptr -gr_complex_ip_packet_source::make(std::string src_device, +Gr_Complex_Ip_Packet_Source::sptr +Gr_Complex_Ip_Packet_Source::make(std::string src_device, const std::string &origin_address, int udp_port, int udp_packet_size, @@ -85,7 +85,7 @@ gr_complex_ip_packet_source::make(std::string src_device, size_t item_size, bool IQ_swap_) { - return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(src_device), + return gnuradio::get_initial_sptr(new Gr_Complex_Ip_Packet_Source(std::move(src_device), origin_address, udp_port, udp_packet_size, @@ -99,7 +99,7 @@ gr_complex_ip_packet_source::make(std::string src_device, /* * The private constructor */ -gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, +Gr_Complex_Ip_Packet_Source::Gr_Complex_Ip_Packet_Source(std::string src_device, __attribute__((unused)) const std::string &origin_address, int udp_port, int udp_packet_size, @@ -151,14 +151,14 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, // Called by gnuradio to enable drivers, etc for i/o devices. -bool gr_complex_ip_packet_source::start() +bool Gr_Complex_Ip_Packet_Source::start() { std::cout << "gr_complex_ip_packet_source START\n"; // open the ethernet device if (open() == true) { // start pcap capture thread - d_pcap_thread = new boost::thread(boost::bind(&gr_complex_ip_packet_source::my_pcap_loop_thread, this, descr)); + d_pcap_thread = new boost::thread(boost::bind(&Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread, this, descr)); return true; } else @@ -169,7 +169,7 @@ bool gr_complex_ip_packet_source::start() // Called by gnuradio to disable drivers, etc for i/o devices. -bool gr_complex_ip_packet_source::stop() +bool Gr_Complex_Ip_Packet_Source::stop() { std::cout << "gr_complex_ip_packet_source STOP\n"; if (descr != nullptr) @@ -182,7 +182,7 @@ bool gr_complex_ip_packet_source::stop() } -bool gr_complex_ip_packet_source::open() +bool Gr_Complex_Ip_Packet_Source::open() { char errbuf[PCAP_ERRBUF_SIZE]; boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function @@ -219,7 +219,7 @@ bool gr_complex_ip_packet_source::open() } -gr_complex_ip_packet_source::~gr_complex_ip_packet_source() +Gr_Complex_Ip_Packet_Source::~Gr_Complex_Ip_Packet_Source() { if (d_pcap_thread != nullptr) { @@ -230,15 +230,15 @@ gr_complex_ip_packet_source::~gr_complex_ip_packet_source() } -void gr_complex_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, +void Gr_Complex_Ip_Packet_Source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet) { - auto *bridge = reinterpret_cast(args); + auto *bridge = reinterpret_cast(args); bridge->pcap_callback(args, pkthdr, packet); } -void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr, +void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr, const u_char *packet) { boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function @@ -312,13 +312,13 @@ void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char * } -void gr_complex_ip_packet_source::my_pcap_loop_thread(pcap_t *pcap_handle) +void Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread(pcap_t *pcap_handle) { - pcap_loop(pcap_handle, -1, gr_complex_ip_packet_source::static_pcap_callback, reinterpret_cast(this)); + pcap_loop(pcap_handle, -1, Gr_Complex_Ip_Packet_Source::static_pcap_callback, reinterpret_cast(this)); } -void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) +void Gr_Complex_Ip_Packet_Source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) { int8_t real; int8_t imag; @@ -383,7 +383,7 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items } -int gr_complex_ip_packet_source::work(int noutput_items, +int Gr_Complex_Ip_Packet_Source::work(int noutput_items, __attribute__((unused)) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index d008e1314..8807be5bb 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -43,7 +43,7 @@ #include #include -class gr_complex_ip_packet_source : virtual public gr::sync_block +class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block { private: boost::mutex d_mutex; @@ -82,7 +82,7 @@ private: static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; static sptr make(std::string src_device, const std::string &origin_address, int udp_port, @@ -91,7 +91,7 @@ public: const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); - gr_complex_ip_packet_source(std::string src_device, + Gr_Complex_Ip_Packet_Source(std::string src_device, const std::string &origin_address, int udp_port, int udp_packet_size, @@ -99,7 +99,7 @@ public: const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); - ~gr_complex_ip_packet_source(); + ~Gr_Complex_Ip_Packet_Source(); // Where all the action really happens int work(int noutput_items, diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index 71fd26eba..3f1caec12 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -45,7 +45,7 @@ const size_t PAGE_SIZE = 0x10000; const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; -fpga_switch::fpga_switch(const std::string &device_name) +Fpga_Switch::Fpga_Switch(const std::string &device_name) { if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) { @@ -67,7 +67,7 @@ fpga_switch::fpga_switch(const std::string &device_name) // sanity check : check test register unsigned writeval = TEST_REGISTER_TRACK_WRITEVAL; unsigned readval; - readval = fpga_switch::fpga_switch_test_register(writeval); + readval = Fpga_Switch::fpga_switch_test_register(writeval); if (writeval != readval) { LOG(WARNING) << "Test register sanity check failed"; @@ -81,19 +81,19 @@ fpga_switch::fpga_switch(const std::string &device_name) } -fpga_switch::~fpga_switch() +Fpga_Switch::~Fpga_Switch() { close_device(); } -void fpga_switch::set_switch_position(int switch_position) +void Fpga_Switch::set_switch_position(int switch_position) { d_map_base[0] = switch_position; } -unsigned fpga_switch::fpga_switch_test_register( +unsigned Fpga_Switch::fpga_switch_test_register( unsigned writeval) { unsigned readval; @@ -106,7 +106,7 @@ unsigned fpga_switch::fpga_switch_test_register( } -void fpga_switch::close_device() +void Fpga_Switch::close_device() { auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index 2ab67dbef..f535bce7d 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -41,11 +41,11 @@ #define MAX_LENGTH_DEVICEIO_NAME 50 -class fpga_switch +class Fpga_Switch { public: - fpga_switch(const std::string& device_name); - ~fpga_switch(); + Fpga_Switch(const std::string& device_name); + ~Fpga_Switch(); void set_switch_position(int switch_position); private: