From 26cc20847cde543e759aa5cee9a27eaa69c5dd9e Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Thu, 9 Feb 2017 23:19:55 -0800 Subject: uhd: replace BOOST_FOREACH with C++11 range-based for loop Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development. --- host/lib/usrp/e100/clock_ctrl.cpp | 3 +-- host/lib/usrp/e100/e100_ctrl.cpp | 1 - host/lib/usrp/e100/e100_impl.cpp | 10 +++++----- host/lib/usrp/e100/io_impl.cpp | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) (limited to 'host/lib/usrp/e100') diff --git a/host/lib/usrp/e100/clock_ctrl.cpp b/host/lib/usrp/e100/clock_ctrl.cpp index 0dbd6a5d3..b49b30a6a 100644 --- a/host/lib/usrp/e100/clock_ctrl.cpp +++ b/host/lib/usrp/e100/clock_ctrl.cpp @@ -23,7 +23,6 @@ #include #include "e100_regs.hpp" //spi slave constants #include -#include #include #include #include //gcd @@ -521,7 +520,7 @@ private: ; //write initial register values and latch/update - BOOST_FOREACH(const range_t &range, ranges){ + for(const range_t &range: ranges){ for(uint16_t addr = range.first; addr <= range.second; addr++){ this->send_reg(addr); } diff --git a/host/lib/usrp/e100/e100_ctrl.cpp b/host/lib/usrp/e100/e100_ctrl.cpp index 4217286f8..777d1b5d5 100644 --- a/host/lib/usrp/e100/e100_ctrl.cpp +++ b/host/lib/usrp/e100/e100_ctrl.cpp @@ -27,7 +27,6 @@ #include //sleep #include #include -#include #include #include diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp index 25c967cfa..41ba24d8f 100644 --- a/host/lib/usrp/e100/e100_impl.cpp +++ b/host/lib/usrp/e100/e100_impl.cpp @@ -269,7 +269,7 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ } if (_gps and _gps->gps_detected()) { - BOOST_FOREACH(const std::string &name, _gps->get_sensors()) + for(const std::string &name: _gps->get_sensors()) { _tree->create(mb_path / "sensors" / name) .set_publisher(boost::bind(&gps_ctrl::get_sensor, _gps, name)); @@ -434,12 +434,12 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ //bind frontend corrections to the dboard freq props const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends"; - BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){ + for(const std::string &name: _tree->list(db_tx_fe_path)){ _tree->access(db_tx_fe_path / name / "freq" / "value") .add_coerced_subscriber(boost::bind(&e100_impl::set_tx_fe_corrections, this, _1)); } const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends"; - BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){ + for(const std::string &name: _tree->list(db_rx_fe_path)){ _tree->access(db_rx_fe_path / name / "freq" / "value") .add_coerced_subscriber(boost::bind(&e100_impl::set_rx_fe_corrections, this, _1)); } @@ -460,10 +460,10 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ .add_coerced_subscriber(boost::bind(&e100_clock_ctrl::set_fpga_clock_rate, _clock_ctrl, _1)); //reset cordic rates and their properties to zero - BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){ + for(const std::string &name: _tree->list(mb_path / "rx_dsps")){ _tree->access(mb_path / "rx_dsps" / name / "freq" / "value").set(0.0); } - BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){ + for(const std::string &name: _tree->list(mb_path / "tx_dsps")){ _tree->access(mb_path / "tx_dsps" / name / "freq" / "value").set(0.0); } diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp index ebed3614c..aedf79d5f 100644 --- a/host/lib/usrp/e100/io_impl.cpp +++ b/host/lib/usrp/e100/io_impl.cpp @@ -75,10 +75,10 @@ void e100_impl::update_rates(void){ _tree->access(mb_path / "tick_rate").update(); //and now that the tick rate is set, init the host rates to something - BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){ + for(const std::string &name: _tree->list(mb_path / "rx_dsps")){ _tree->access(mb_path / "rx_dsps" / name / "rate" / "value").update(); } - BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){ + for(const std::string &name: _tree->list(mb_path / "tx_dsps")){ _tree->access(mb_path / "tx_dsps" / name / "rate" / "value").update(); } } -- cgit v1.2.3