diff options
author | Andrej Rode <andrej.rode@ettus.com> | 2017-02-09 23:19:55 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-02-10 16:44:33 -0800 |
commit | 26cc20847cde543e759aa5cee9a27eaa69c5dd9e (patch) | |
tree | eee102333381e2313af59e725d6b7a06b665161f /host/lib/usrp/dboard | |
parent | f3a004faf7d50cbb5564f5e2f67f54ee07e051dd (diff) | |
download | uhd-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/dboard')
-rw-r--r-- | host/lib/usrp/dboard/db_cbx.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_dbsrx.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_dbsrx2.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_sbx_common.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_sbx_version3.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_sbx_version4.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_tvrx.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_tvrx2.cpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_twinrx.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_ubx.cpp | 10 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_unknown.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_wbx_common.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_wbx_version2.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_wbx_version3.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_wbx_version4.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp | 6 |
18 files changed, 40 insertions, 41 deletions
diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp index c27cbf58a..05f8846d6 100644 --- a/host/lib/usrp/dboard/db_cbx.cpp +++ b/host/lib/usrp/dboard/db_cbx.cpp @@ -40,7 +40,7 @@ sbx_xcvr::cbx::~cbx(void){ void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(uint32_t reg, regs) + for(uint32_t reg: regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index f296820c5..2862f97dc 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -205,7 +205,7 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){ .set("DBSRX"); this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&dbsrx::get_locked, this)); - BOOST_FOREACH(const std::string &name, dbsrx_gain_ranges.keys()){ + for(const std::string &name: dbsrx_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&dbsrx::set_gain, this, _1, name)) .set(dbsrx_gain_ranges[name].start()); @@ -266,7 +266,7 @@ double dbsrx::set_lo_freq(double target_freq){ //choose refclock std::vector<double> clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX); const double max_clock_rate = uhd::sorted(clock_rates).back(); - BOOST_FOREACH(ref_clock, uhd::reversed(uhd::sorted(clock_rates))){ + for(auto ref_clock: uhd::reversed(uhd::sorted(clock_rates))){ //USRP1 feeds the DBSRX clock from a FPGA GPIO line. //make sure that this clock does not exceed rate limit. if (this->get_iface()->get_special_props().soft_clock_divider){ @@ -286,7 +286,7 @@ double dbsrx::set_lo_freq(double target_freq){ if (m >= 32) continue; //choose R - for(r = 0; r <= 6; r += 1) { + for(auto r = 0; r <= 6; r += 1) { //compute divider from setting R = 1 << (r+1); UHD_LOGV(often) << boost::format("DBSRX R:%d\n") % R << std::endl; diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 21b0fd02d..544671d3b 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -192,7 +192,7 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){ .set("DBSRX2"); this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&dbsrx2::get_locked, this)); - BOOST_FOREACH(const std::string &name, dbsrx2_gain_ranges.keys()){ + for(const std::string &name: dbsrx2_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&dbsrx2::set_gain, this, _1, name)) .set(dbsrx2_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 9bbd73425..3982ba224 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -184,7 +184,7 @@ rfx_xcvr::rfx_xcvr( this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX)); - BOOST_FOREACH(const std::string &name, _rx_gain_ranges.keys()){ + for(const std::string &name: _rx_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&rfx_xcvr::set_rx_gain, this, _1, name)) .set(_rx_gain_ranges[name].start()); @@ -379,9 +379,9 @@ double rfx_xcvr::set_lo_freq( * fvco*R/fref = P*B + A = N */ for(R = 2; R <= 32; R+=2){ - BOOST_FOREACH(BS, bandsel_to_enum.keys()){ + for(auto BS: bandsel_to_enum.keys()){ if (ref_freq/R/BS > 1e6) continue; //constraint on band select clock - BOOST_FOREACH(P, prescaler_to_enum.keys()){ + for(auto P: prescaler_to_enum.keys()){ //calculate B and A from N double N = target_freq*R/ref_freq; B = int(std::floor(N/P)); @@ -433,7 +433,7 @@ double rfx_xcvr::set_lo_freq( (adf4360_regs_t::ADDR_CONTROL) (adf4360_regs_t::ADDR_NCOUNTER) ; - BOOST_FOREACH(adf4360_regs_t::addr_t addr, addrs){ + for(adf4360_regs_t::addr_t addr: addrs){ this->get_iface()->write_spi( unit, spi_config_t::EDGE_RISE, regs.get_reg(addr), 24 diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp index efc84d7e6..ab7eb2566 100644 --- a/host/lib/usrp/dboard/db_sbx_common.cpp +++ b/host/lib/usrp/dboard/db_sbx_common.cpp @@ -160,7 +160,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){ this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_RX)); - BOOST_FOREACH(const std::string &name, sbx_rx_gain_ranges.keys()){ + for(const std::string &name: sbx_rx_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&sbx_xcvr::set_rx_gain, this, _1, name)) .set(sbx_rx_gain_ranges[name].start()); @@ -201,7 +201,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){ this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_TX)); - BOOST_FOREACH(const std::string &name, sbx_tx_gain_ranges.keys()){ + for(const std::string &name: sbx_tx_gain_ranges.keys()){ this->get_tx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&sbx_xcvr::set_tx_gain, this, _1, name)) .set(sbx_tx_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/db_sbx_version3.cpp b/host/lib/usrp/dboard/db_sbx_version3.cpp index bb2ba6bd6..91a1b6a53 100644 --- a/host/lib/usrp/dboard/db_sbx_version3.cpp +++ b/host/lib/usrp/dboard/db_sbx_version3.cpp @@ -40,7 +40,7 @@ sbx_xcvr::sbx_version3::~sbx_version3(void){ void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(uint32_t reg, regs) + for(uint32_t reg: regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_sbx_version4.cpp b/host/lib/usrp/dboard/db_sbx_version4.cpp index e5b6e081c..6521285ea 100644 --- a/host/lib/usrp/dboard/db_sbx_version4.cpp +++ b/host/lib/usrp/dboard/db_sbx_version4.cpp @@ -41,7 +41,7 @@ sbx_xcvr::sbx_version4::~sbx_version4(void){ void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(uint32_t reg, regs) + for(uint32_t reg: regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 5c0600c61..5b25883f8 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -107,7 +107,7 @@ static const boost::array<double, 17> tvrx_gains_volts = static uhd::dict<std::string, gain_range_t> get_tvrx_gain_ranges(void) { double rfmax = 0.0, rfmin = FLT_MAX; - BOOST_FOREACH(const std::string range, tvrx_rf_gains_db.keys()) { + for(const std::string range: tvrx_rf_gains_db.keys()) { double my_max = tvrx_rf_gains_db[range].back(); //we're assuming it's monotonic double my_min = tvrx_rf_gains_db[range].front(); //if it's not this is wrong wrong wrong if(my_max > rfmax) rfmax = my_max; @@ -188,7 +188,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){ this->get_rx_subtree()->create<std::string>("name") .set("TVRX"); this->get_rx_subtree()->create<int>("sensors"); //phony property so this dir exists - BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){ + for(const std::string &name: get_tvrx_gain_ranges().keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&tvrx::set_gain, this, _1, name)); this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range") @@ -232,7 +232,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){ this->get_rx_subtree()->access<double>("freq/value").set(tvrx_freq_range.start()); //set default gains - BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){ + for(const std::string &name: get_tvrx_gain_ranges().keys()){ this->get_rx_subtree()->access<double>("gains/"+name+"/value") .set(get_tvrx_gain_ranges()[name].start()); } @@ -247,7 +247,7 @@ tvrx::~tvrx(void){ */ static std::string get_band(double freq) { - BOOST_FOREACH(const std::string &band, tvrx_freq_ranges.keys()) { + for(const std::string &band: tvrx_freq_ranges.keys()) { if(freq >= tvrx_freq_ranges[band].start() && freq <= tvrx_freq_ranges[band].stop()){ UHD_LOGV(often) << "Band: " << band << std::endl; return band; diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp index 1bac81153..3ba581b0f 100644 --- a/host/lib/usrp/dboard/db_tvrx2.cpp +++ b/host/lib/usrp/dboard/db_tvrx2.cpp @@ -962,7 +962,7 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){ .set_publisher(boost::bind(&tvrx2::get_rssi, this)); this->get_rx_subtree()->create<sensor_value_t>("sensors/temperature") .set_publisher(boost::bind(&tvrx2::get_temp, this)); - BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){ + for(const std::string &name: tvrx2_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&tvrx2::set_gain, this, _1, name)); this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range") @@ -1066,7 +1066,7 @@ bool tvrx2::set_enabled(bool enable){ test_rf_filter_robustness(); - BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){ + for(const std::string &name: tvrx2_gain_ranges.keys()){ this->get_rx_subtree()->access<double>("gains/"+name+"/value") .set(tvrx2_gain_ranges[name].start()); } @@ -1271,14 +1271,14 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void) // Loop through rfcal_log_* registers, initialize _rfcal_results - BOOST_FOREACH(const uint32_t &result, result_to_cal_regs.keys()) + for(const uint32_t &result: result_to_cal_regs.keys()) _rfcal_results[result].delta_c = result_to_cal_regs[result] > 63 ? result_to_cal_regs[result] - 128 : result_to_cal_regs[result]; /* read byte 0x26-0x2B */ read_reg(0x26, 0x2B); // Loop through rfcal_byte_* registers, initialize _rfcal_coeffs - BOOST_FOREACH(const uint32_t &subband, _rfcal_coeffs.keys()) + for(const uint32_t &subband: _rfcal_coeffs.keys()) { freq_range_t subband_freqs; @@ -1473,7 +1473,7 @@ void tvrx2::test_rf_filter_robustness(void){ ("UHFHigh_1", 0x43) ; - BOOST_FOREACH(const std::string &name, filter_cal_regs.keys()){ + for(const std::string &name: filter_cal_regs.keys()){ uint8_t cal_result = _tda18272hnm_regs.get_reg(filter_cal_regs[name]); if (cal_result & 0x80) { _filter_ratings.set(name, "E"); @@ -1516,7 +1516,7 @@ void tvrx2::test_rf_filter_robustness(void){ std::stringstream robustness_message; robustness_message << boost::format("TVRX2 (%s): RF Filter Robustness Results:") % (get_subdev_name()) << std::endl; - BOOST_FOREACH(const std::string &name, uhd::sorted(_filter_ratings.keys())){ + for(const std::string &name: uhd::sorted(_filter_ratings.keys())){ robustness_message << boost::format("\t%s:\tMargin = %0.2f,\tRobustness = %c") % name % (_filter_margins[name]) % (_filter_ratings[name]) << std::endl; } diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp index 2af6bc4ff..91b38f90c 100644 --- a/host/lib/usrp/dboard/db_twinrx.cpp +++ b/host/lib/usrp/dboard/db_twinrx.cpp @@ -265,7 +265,7 @@ public: // Add workers to expert //--------------------------------------------------------- //Channel (front-end) specific - BOOST_FOREACH(const std::string& fe, _fe_names) { + for(const std::string& fe: _fe_names) { expert_factory::add_worker_node<twinrx_freq_path_expert>(_expert, _expert->node_retriever(), fe); expert_factory::add_worker_node<twinrx_freq_coercion_expert>(_expert, _expert->node_retriever(), fe); expert_factory::add_worker_node<twinrx_chan_gain_expert>(_expert, _expert->node_retriever(), fe); diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index 3dd0b1c84..2f3c1ebe7 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -300,7 +300,7 @@ public: { std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_RX); double highest_rate = 0.0; - BOOST_FOREACH(double rate, rates) + for(double rate: rates) { if (rate <= pfd_freq_max and rate > highest_rate) highest_rate = rate; @@ -312,7 +312,7 @@ public: { std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_TX); double highest_rate = 0.0; - BOOST_FOREACH(double rate, rates) + for(double rate: rates) { if (rate <= pfd_freq_max and rate > highest_rate) highest_rate = rate; @@ -370,7 +370,7 @@ public: _rxlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1)); _rxlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1)); std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2); - BOOST_FOREACH(max287x_iface::sptr lo, los) + for(max287x_iface::sptr lo: los) { lo->set_auto_retune(false); lo->set_muxout_mode(max287x_iface::MUXOUT_DLD); @@ -384,7 +384,7 @@ public: _rxlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1)); _rxlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1)); std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2); - BOOST_FOREACH(max287x_iface::sptr lo, los) + for(max287x_iface::sptr lo: los) { lo->set_auto_retune(false); //lo->set_cycle_slip_mode(true); // tried it - caused longer lock times @@ -547,7 +547,7 @@ private: { boost::mutex::scoped_lock lock(_spi_mutex); ROUTE_SPI(_iface, dest); - BOOST_FOREACH(uint32_t value, values) + for(uint32_t value: values) WRITE_SPI(_iface, value); } diff --git a/host/lib/usrp/dboard/db_unknown.cpp b/host/lib/usrp/dboard/db_unknown.cpp index 2ed50cd91..7e1c20a9e 100644 --- a/host/lib/usrp/dboard/db_unknown.cpp +++ b/host/lib/usrp/dboard/db_unknown.cpp @@ -23,7 +23,6 @@ #include <uhd/usrp/dboard_manager.hpp> #include <boost/assign/list_of.hpp> #include <boost/format.hpp> -#include <boost/foreach.hpp> #include <boost/tuple/tuple.hpp> #include <vector> @@ -43,7 +42,7 @@ static void warn_if_old_rfx(const dboard_id_t &dboard_id, const std::string &xx) (old_ids_t("Flex 1800 Classic", 0x0030, 0x0031)) (old_ids_t("Flex 2400 Classic", 0x0007, 0x000b)) ; - BOOST_FOREACH(const old_ids_t &old_id, old_rfx_ids){ + for(const old_ids_t &old_id: old_rfx_ids){ std::string name; dboard_id_t rx_id, tx_id; boost::tie(name, rx_id, tx_id) = old_id; if ( diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp index 5afbb1f88..1ad6ad45b 100644 --- a/host/lib/usrp/dboard/db_wbx_common.cpp +++ b/host/lib/usrp/dboard/db_wbx_common.cpp @@ -70,7 +70,7 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){ this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t()); this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_RX)); - BOOST_FOREACH(const std::string &name, wbx_rx_gain_ranges.keys()){ + for(const std::string &name: wbx_rx_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&wbx_base::set_rx_gain, this, _1, name)) .set(wbx_rx_gain_ranges[name].start()); @@ -158,7 +158,7 @@ sensor_value_t wbx_base::get_locked(dboard_iface::unit_t unit){ } void wbx_base::wbx_versionx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(uint32_t reg, regs) { + for(uint32_t reg: regs) { self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32); } } diff --git a/host/lib/usrp/dboard/db_wbx_version2.cpp b/host/lib/usrp/dboard/db_wbx_version2.cpp index 489291881..319434c3a 100644 --- a/host/lib/usrp/dboard/db_wbx_version2.cpp +++ b/host/lib/usrp/dboard/db_wbx_version2.cpp @@ -91,7 +91,7 @@ wbx_base::wbx_version2::wbx_version2(wbx_base *_self_wbx_base) { // Register TX properties //////////////////////////////////////////////////////////////////// this->get_tx_subtree()->create<std::string>("name").set("WBXv2 TX"); - BOOST_FOREACH(const std::string &name, wbx_v2_tx_gain_ranges.keys()){ + for(const std::string &name: wbx_v2_tx_gain_ranges.keys()){ self_base->get_tx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&wbx_base::wbx_version2::set_tx_gain, this, _1, name)) .set(wbx_v2_tx_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp index 1bd326e6f..cb7616e26 100644 --- a/host/lib/usrp/dboard/db_wbx_version3.cpp +++ b/host/lib/usrp/dboard/db_wbx_version3.cpp @@ -96,7 +96,7 @@ wbx_base::wbx_version3::wbx_version3(wbx_base *_self_wbx_base) { // Register TX properties //////////////////////////////////////////////////////////////////// this->get_tx_subtree()->create<std::string>("name").set("WBXv3 TX"); - BOOST_FOREACH(const std::string &name, wbx_v3_tx_gain_ranges.keys()){ + for(const std::string &name: wbx_v3_tx_gain_ranges.keys()){ self_base->get_tx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&wbx_base::wbx_version3::set_tx_gain, this, _1, name)) .set(wbx_v3_tx_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index 3cc0f1887..8db03b961 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -103,7 +103,7 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) { //get_tx_id() will always return GDB ID, so use RX ID to determine WBXv4 vs. WBX-120 if(rx_id == 0x0063) this->get_tx_subtree()->create<std::string>("name").set("WBXv4 TX"); else if(rx_id == 0x0081) this->get_tx_subtree()->create<std::string>("name").set("WBX-120 TX"); - BOOST_FOREACH(const std::string &name, wbx_v4_tx_gain_ranges.keys()){ + for(const std::string &name: wbx_v4_tx_gain_ranges.keys()){ self_base->get_tx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&wbx_base::wbx_version4::set_tx_gain, this, _1, name)) .set(wbx_v4_tx_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 6876ee4be..63053e326 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -234,7 +234,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){ .set_publisher(boost::bind(&xcvr2450::get_locked, this)); this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi") .set_publisher(boost::bind(&xcvr2450::get_rssi, this)); - BOOST_FOREACH(const std::string &name, xcvr_rx_gain_ranges.keys()){ + for(const std::string &name: xcvr_rx_gain_ranges.keys()){ this->get_rx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&xcvr2450::set_rx_gain, this, _1, name)) .set(xcvr_rx_gain_ranges[name].start()); @@ -270,7 +270,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){ .set("XCVR2450 TX"); this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked") .set_publisher(boost::bind(&xcvr2450::get_locked, this)); - BOOST_FOREACH(const std::string &name, xcvr_tx_gain_ranges.keys()){ + for(const std::string &name: xcvr_tx_gain_ranges.keys()){ this->get_tx_subtree()->create<double>("gains/"+name+"/value") .set_coercer(boost::bind(&xcvr2450::set_tx_gain, this, _1, name)) .set(xcvr_tx_gain_ranges[name].start()); diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp index 346f39589..ddbbfaefb 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp @@ -87,10 +87,10 @@ public: //Initialize clocks and LO bool found_rate = false; - BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) { + for(double rate: _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) { found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ); } - BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) { + for(double rate: _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) { found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ); } if (not found_rate) { @@ -506,7 +506,7 @@ private: //Functions void _write_lo_spi(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { - BOOST_FOREACH(uint32_t reg, regs) { + for(uint32_t reg: regs) { spi_config_t spi_config = spi_config_t(spi_config_t::EDGE_RISE); spi_config.use_custom_divider = true; spi_config.divider = 67; |