aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-02-09 23:19:55 -0800
committerMartin Braun <martin.braun@ettus.com>2017-02-10 16:44:33 -0800
commit26cc20847cde543e759aa5cee9a27eaa69c5dd9e (patch)
treeeee102333381e2313af59e725d6b7a06b665161f /host/lib/usrp/b100
parentf3a004faf7d50cbb5564f5e2f67f54ee07e051dd (diff)
downloaduhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.tar.gz
uhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.tar.bz2
uhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.zip
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.
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp14
-rw-r--r--host/lib/usrp/b100/clock_ctrl.cpp3
-rw-r--r--host/lib/usrp/b100/io_impl.cpp4
-rw-r--r--host/lib/usrp/b100/usb_zero_copy_wrapper.cpp1
4 files changed, 10 insertions, 12 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 1a38bf3b7..d87d0890d 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -73,7 +73,7 @@ static device_addrs_t b100_find(const device_addr_t &hint)
//find the usrps and load firmware
size_t found = 0;
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid)) {
//extract the firmware path for the b100
std::string b100_fw_image;
try{
@@ -102,7 +102,7 @@ static device_addrs_t b100_find(const device_addr_t &hint)
//search for the device until found or timeout
while (boost::get_system_time() < timeout_time and b100_addrs.empty() and found != 0)
{
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid))
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid))
{
usb_control::sptr control;
try{control = usb_control::make(handle, 0);}
@@ -161,7 +161,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
//locate the matching handle in the device list
usb_device_handle::sptr handle;
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, device_list) {
+ for(usb_device_handle::sptr dev_handle: device_list) {
if (dev_handle->get_serial() == device_addr["serial"]){
handle = dev_handle;
break;
@@ -478,12 +478,12 @@ b100_impl::b100_impl(const 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<double>(db_tx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&b100_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<double>(db_rx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&b100_impl::set_rx_fe_corrections, this, _1));
}
@@ -504,10 +504,10 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
.add_coerced_subscriber(boost::bind(&b100_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<double>(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<double>(mb_path / "tx_dsps" / name / "freq" / "value").set(0.0);
}
diff --git a/host/lib/usrp/b100/clock_ctrl.cpp b/host/lib/usrp/b100/clock_ctrl.cpp
index 5700a321a..99ad6a052 100644
--- a/host/lib/usrp/b100/clock_ctrl.cpp
+++ b/host/lib/usrp/b100/clock_ctrl.cpp
@@ -25,7 +25,6 @@
#include <stdint.h>
#include "b100_regs.hpp" //spi slave constants
#include <boost/assign/list_of.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/thread/thread.hpp>
#include <boost/math/common_factor_rt.hpp> //gcd
@@ -533,7 +532,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/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index c1810ed8c..09973491c 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -36,10 +36,10 @@ void b100_impl::update_rates(void){
_tree->access<double>(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<double>(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<double>(mb_path / "tx_dsps" / name / "rate" / "value").update();
}
}
diff --git a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
index d57d57f21..568b7add9 100644
--- a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
+++ b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
@@ -21,7 +21,6 @@
#include <uhd/utils/msg.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/atomic.hpp>
-#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>