From 47cdd6319c74a7b823843aad5ff3fa370ed1e6ef Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 27 Jun 2017 19:06:50 -0700 Subject: uhd: Replaced many lexical_cast with appropriate C++11 equivalents --- host/lib/usrp/n230/n230_eeprom_manager.cpp | 6 +++--- host/lib/usrp/n230/n230_resource_manager.cpp | 4 +--- host/lib/usrp/n230/n230_stream_manager.cpp | 16 ++++++++-------- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'host/lib/usrp/n230') diff --git a/host/lib/usrp/n230/n230_eeprom_manager.cpp b/host/lib/usrp/n230/n230_eeprom_manager.cpp index c21eb9ddb..4a996ef61 100644 --- a/host/lib/usrp/n230/n230_eeprom_manager.cpp +++ b/host/lib/usrp/n230/n230_eeprom_manager.cpp @@ -68,9 +68,9 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() uint16_t ver_major = uhd::htonx(map.data_version_major); uint16_t ver_minor = uhd::htonx(map.data_version_minor); - _mb_eeprom["product"] = boost::lexical_cast( + _mb_eeprom["product"] = std::to_string( uhd::htonx(map.hw_product)); - _mb_eeprom["revision"] = boost::lexical_cast( + _mb_eeprom["revision"] = std::to_string( uhd::htonx(map.hw_revision)); //The revision_compat field does not exist in version 1.0 //EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set @@ -78,7 +78,7 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() if (ver_major == 1 and ver_minor == 0) { _mb_eeprom["revision_compat"] = _mb_eeprom["revision"]; } else { - _mb_eeprom["revision_compat"] = boost::lexical_cast( + _mb_eeprom["revision_compat"] = std::to_string( uhd::htonx(map.hw_revision_compat)); } _mb_eeprom["serial"] = _bytes_to_string( diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp index 61a80ae43..d454afd40 100644 --- a/host/lib/usrp/n230/n230_resource_manager.cpp +++ b/host/lib/usrp/n230/n230_resource_manager.cpp @@ -26,9 +26,7 @@ #include #include #include -#include #include -#include #include #include "n230_fw_defs.h" #include "n230_fw_host_iface.h" @@ -419,7 +417,7 @@ transport::zero_copy_if::sptr n230_resource_manager::_create_transport( default_buff_args.num_send_frames = 32; transport::zero_copy_if::sptr xport = transport::udp_zero_copy::make( - eth_conn.ip_addr, boost::lexical_cast(fpga::CVITA_UDP_PORT), + eth_conn.ip_addr, std::to_string(fpga::CVITA_UDP_PORT), default_buff_args, buff_params_out, buff_params); if (xport.get()) { diff --git a/host/lib/usrp/n230/n230_stream_manager.cpp b/host/lib/usrp/n230/n230_stream_manager.cpp index 95da2752e..0d5aa693f 100644 --- a/host/lib/usrp/n230/n230_stream_manager.cpp +++ b/host/lib/usrp/n230/n230_stream_manager.cpp @@ -80,13 +80,13 @@ rx_streamer::sptr n230_stream_manager::get_rx_stream(const uhd::stream_args_t &a //TODO: Propagate the device_args class into streamer in the future device_addr_t device_addr = args.args; if (not device_addr.has_key("recv_buff_size")) { - device_addr["recv_buff_size"] = boost::lexical_cast(_dev_args.get_recv_buff_size()); + device_addr["recv_buff_size"] = std::to_string(_dev_args.get_recv_buff_size()); } if (not device_addr.has_key("recv_frame_size")) { - device_addr["recv_frame_size"] = boost::lexical_cast(_dev_args.get_recv_frame_size()); + device_addr["recv_frame_size"] = std::to_string(_dev_args.get_recv_frame_size()); } if (not device_addr.has_key("num_recv_frames")) { - device_addr["num_recv_frames"] = boost::lexical_cast(_dev_args.get_num_recv_frames()); + device_addr["num_recv_frames"] = std::to_string(_dev_args.get_num_recv_frames()); } transport::udp_zero_copy::buff_params buff_params_out; @@ -170,7 +170,7 @@ rx_streamer::sptr n230_stream_manager::get_rx_stream(const uhd::stream_args_t &a if (prop_tree) { //TODO: Update this to support multiple motherboards const fs_path mb_path = "/mboards/0"; - prop_tree->access(mb_path / "rx_dsps" / boost::lexical_cast(chan) / "rate" / "value").update(); + prop_tree->access(mb_path / "rx_dsps" / std::to_string(chan) / "rate" / "value").update(); } } update_stream_states(); @@ -207,13 +207,13 @@ tx_streamer::sptr n230_stream_manager::get_tx_stream(const uhd::stream_args_t &a //TODO: Propagate the device_args class into streamer in the future device_addr_t device_addr = args.args; if (not device_addr.has_key("send_buff_size")) { - device_addr["send_buff_size"] = boost::lexical_cast(_dev_args.get_send_buff_size()); + device_addr["send_buff_size"] = std::to_string(_dev_args.get_send_buff_size()); } if (not device_addr.has_key("send_frame_size")) { - device_addr["send_frame_size"] = boost::lexical_cast(_dev_args.get_send_frame_size()); + device_addr["send_frame_size"] = std::to_string(_dev_args.get_send_frame_size()); } if (not device_addr.has_key("num_send_frames")) { - device_addr["num_send_frames"] = boost::lexical_cast(_dev_args.get_num_send_frames()); + device_addr["num_send_frames"] = std::to_string(_dev_args.get_num_send_frames()); } transport::udp_zero_copy::buff_params buff_params_out; @@ -295,7 +295,7 @@ tx_streamer::sptr n230_stream_manager::get_tx_stream(const uhd::stream_args_t &a if (prop_tree) { //TODO: Update this to support multiple motherboards const fs_path mb_path = "/mboards/0"; - prop_tree->access(mb_path / "tx_dsps" / boost::lexical_cast(chan) / "rate" / "value").update(); + prop_tree->access(mb_path / "tx_dsps" / std::to_string(chan) / "rate" / "value").update(); } } update_stream_states(); -- cgit v1.2.3