From 1fe98e8701dd0b790b172762c3629db32956d1fc Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 28 Sep 2019 11:18:57 +0200 Subject: uhd: Replace usage of boost smart pointers with C++11 counterparts This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include . Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct. --- host/lib/usrp/common/ad9361_ctrl.cpp | 6 +++--- host/lib/usrp/common/ad9361_driver/ad9361_client.h | 6 +++--- host/lib/usrp/common/ad9361_driver/ad9361_device.cpp | 14 +++++++------- host/lib/usrp/common/ad936x_manager.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'host/lib/usrp/common') diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp index b89ec2d32..8e57c48c9 100644 --- a/host/lib/usrp/common/ad9361_ctrl.cpp +++ b/host/lib/usrp/common/ad9361_ctrl.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -325,8 +325,8 @@ ad9361_ctrl::sptr ad9361_ctrl::make_spi(ad9361_params::sptr client_settings, uhd::spi_iface::sptr spi_iface, uint32_t slave_num) { - boost::shared_ptr spi_io_iface = - boost::make_shared(spi_iface, slave_num); + std::shared_ptr spi_io_iface = + std::make_shared(spi_iface, slave_num); return sptr(new ad9361_ctrl_impl(client_settings, spi_io_iface)); } diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_client.h b/host/lib/usrp/common/ad9361_driver/ad9361_client.h index a2343a3db..e8201825a 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_client.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_client.h @@ -8,7 +8,7 @@ #ifndef INCLUDED_AD9361_CLIENT_H #define INCLUDED_AD9361_CLIENT_H -#include +#include namespace uhd { namespace usrp { @@ -49,7 +49,7 @@ typedef struct { class ad9361_params { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; virtual ~ad9361_params() {} @@ -62,7 +62,7 @@ public: class ad9361_io { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; virtual ~ad9361_io() {} diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index a3d3552ef..44b650f52 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -2733,8 +2733,8 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_2(direction_t direction) int16_t taps_array[] = {-9, 0, 73, 128, 73, 0, -9}; std::vector taps(taps_array, taps_array + sizeof(taps_array) / sizeof(int16_t) ); - digital_filter_base::sptr hb_3 = boost::dynamic_pointer_cast >(_get_filter_hb_3(direction)); - digital_filter_base::sptr dec_int_3 = boost::dynamic_pointer_cast >(_get_filter_dec_int_3(direction)); + digital_filter_base::sptr hb_3 = std::dynamic_pointer_cast >(_get_filter_hb_3(direction)); + digital_filter_base::sptr dec_int_3 = std::dynamic_pointer_cast >(_get_filter_dec_int_3(direction)); if(direction == RX) { @@ -2791,7 +2791,7 @@ filter_info_base::sptr ad9361_device_t::_get_filter_hb_1(direction_t direction) int16_t taps_rx_array[] = {-8, 0, 42, 0, -147, 0, 619, 1013, 619, 0, -147, 0, 42, 0, -8}; int16_t taps_tx_array[] = {-53, 0, 313, 0, -1155, 0, 4989, 8192, 4989, 0, -1155, 0, 313, 0, -53}; - digital_filter_base::sptr hb_2 = boost::dynamic_pointer_cast >(_get_filter_hb_2(direction)); + digital_filter_base::sptr hb_2 = std::dynamic_pointer_cast >(_get_filter_hb_2(direction)); if(direction == RX) { @@ -2826,7 +2826,7 @@ filter_info_base::sptr ad9361_device_t::_get_filter_fir(direction_t direction, c size_t max_num_taps = 128; uint8_t enable = 1; - digital_filter_base::sptr hb_1 = boost::dynamic_pointer_cast >(_get_filter_hb_1(direction)); + digital_filter_base::sptr hb_1 = std::dynamic_pointer_cast >(_get_filter_hb_1(direction)); if(direction == RX) { @@ -2861,7 +2861,7 @@ filter_info_base::sptr ad9361_device_t::_get_filter_fir(direction_t direction, c void ad9361_device_t::_set_filter_fir(direction_t direction, chain_t channel, filter_info_base::sptr filter) { - digital_filter_fir::sptr fir = boost::dynamic_pointer_cast >(filter); + digital_filter_fir::sptr fir = std::dynamic_pointer_cast >(filter); //only write taps. Ignore everything else for now _set_fir_taps(direction, channel, fir->get_taps()); } @@ -2873,7 +2873,7 @@ void ad9361_device_t::_set_filter_fir(direction_t direction, chain_t channel, fi */ void ad9361_device_t::_set_filter_lp_bb(direction_t direction, filter_info_base::sptr filter) { - analog_filter_lp::sptr lpf = boost::dynamic_pointer_cast(filter); + analog_filter_lp::sptr lpf = std::dynamic_pointer_cast(filter); double bw = lpf->get_cutoff(); if(direction == RX) { @@ -2888,7 +2888,7 @@ void ad9361_device_t::_set_filter_lp_bb(direction_t direction, filter_info_base: void ad9361_device_t::_set_filter_lp_tia_sec(direction_t direction, filter_info_base::sptr filter) { - analog_filter_lp::sptr lpf = boost::dynamic_pointer_cast(filter); + analog_filter_lp::sptr lpf = std::dynamic_pointer_cast(filter); double bw = lpf->get_cutoff(); if(direction == RX) { diff --git a/host/lib/usrp/common/ad936x_manager.cpp b/host/lib/usrp/common/ad936x_manager.cpp index 5c4cb51ae..b57b94302 100644 --- a/host/lib/usrp/common/ad936x_manager.cpp +++ b/host/lib/usrp/common/ad936x_manager.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -329,5 +329,5 @@ private: ad936x_manager::sptr ad936x_manager::make( const ad9361_ctrl::sptr& codec_ctrl, const size_t n_frontends) { - return boost::make_shared(codec_ctrl, n_frontends); + return std::make_shared(codec_ctrl, n_frontends); } -- cgit v1.2.3