diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/property_tree.cpp | 37 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 2 |
2 files changed, 22 insertions, 17 deletions
diff --git a/host/lib/property_tree.cpp b/host/lib/property_tree.cpp index 469d59e0d..58cd3f6ea 100644 --- a/host/lib/property_tree.cpp +++ b/host/lib/property_tree.cpp @@ -46,13 +46,14 @@ public: node_type *parent = NULL; node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &branch, path){ - if (not node->has_key(branch)) throw_path_not_found(path); + BOOST_FOREACH(const path_type &branch, path){ + const std::string name = branch.string(); + if (not node->has_key(name)) throw_path_not_found(path); parent = node; - node = &(*node)[branch]; + node = &(*node)[name]; } if (parent == NULL) throw uhd::runtime_error("Cannot uproot"); - parent->pop(path.leaf()); + parent->pop(path_type(path.leaf()).string()); } bool exists(const path_type &path_) const{ @@ -60,9 +61,10 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &branch, path){ - if (not node->has_key(branch)) return false; - node = &(*node)[branch]; + BOOST_FOREACH(const path_type &branch, path){ + const std::string name = branch.string(); + if (not node->has_key(name)) return false; + node = &(*node)[name]; } return true; } @@ -72,9 +74,10 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &branch, path){ - if (not node->has_key(branch)) throw_path_not_found(path); - node = &(*node)[branch]; + BOOST_FOREACH(const path_type &branch, path){ + const std::string name = branch.string(); + if (not node->has_key(name)) throw_path_not_found(path); + node = &(*node)[name]; } return node->keys(); @@ -85,9 +88,10 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &branch, path){ - if (not node->has_key(branch)) (*node)[branch] = node_type(); - node = &(*node)[branch]; + BOOST_FOREACH(const path_type &branch, path){ + const std::string name = branch.string(); + if (not node->has_key(name)) (*node)[name] = node_type(); + node = &(*node)[name]; } if (node->prop.get() != NULL) throw uhd::runtime_error("Cannot create! Property already exists at: " + path.string()); node->prop = prop; @@ -98,9 +102,10 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &branch, path){ - if (not node->has_key(branch)) throw_path_not_found(path); - node = &(*node)[branch]; + BOOST_FOREACH(const path_type &branch, path){ + const std::string name = branch.string(); + if (not node->has_key(name)) throw_path_not_found(path); + node = &(*node)[name]; } if (node->prop.get() == NULL) throw uhd::runtime_error("Cannot access! Property uninitialized at: " + path.string()); return node->prop; diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 7e855d1bd..67bf25c2b 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -273,7 +273,7 @@ void usrp2_impl::io_init(void){ _io_impl->send_handler.set_max_samples_per_packet(get_max_send_samps_per_packet()); //set the packet threshold to be an entire socket buffer's worth - const size_t packets_per_sock_buff = 50e6/_mbc[_mbc.keys().front()].rx_dsp_xports[0]->get_recv_frame_size(); + const size_t packets_per_sock_buff = size_t(50e6/_mbc[_mbc.keys().front()].rx_dsp_xports[0]->get_recv_frame_size()); _io_impl->recv_handler.set_alignment_failure_threshold(packets_per_sock_buff); } |