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/e300/e300_eeprom_manager.cpp | 6 +++--- host/lib/usrp/e300/e300_sensor_manager.cpp | 6 +++--- host/lib/usrp/e300/e300_sysfs_hooks.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'host/lib/usrp/e300') diff --git a/host/lib/usrp/e300/e300_eeprom_manager.cpp b/host/lib/usrp/e300/e300_eeprom_manager.cpp index d43ca3d4c..f994ec996 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.cpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.cpp @@ -67,9 +67,9 @@ const mboard_eeprom_t& e300_eeprom_manager::read_mb_eeprom(void) mb_eeprom_map_t &map = *map_ptr; - _mb_eeprom["product"] = boost::lexical_cast( + _mb_eeprom["product"] = std::to_string( uhd::ntohx(map.hw_product)); - _mb_eeprom["revision"] = boost::lexical_cast( + _mb_eeprom["revision"] = std::to_string( uhd::ntohx(map.hw_revision)); _mb_eeprom["serial"] = _bytes_to_string( map.serial, MB_SERIAL_LEN); @@ -101,7 +101,7 @@ const dboard_eeprom_t& e300_eeprom_manager::read_db_eeprom(void) _db_eeprom.id = uhd::usrp::dboard_id_t::from_uint16( uhd::ntohx(map.hw_product)); - _db_eeprom.revision = boost::lexical_cast( + _db_eeprom.revision = std::to_string( uhd::ntohx(map.hw_revision)); _db_eeprom.serial = _bytes_to_string( map.serial, DB_SERIAL_LEN); diff --git a/host/lib/usrp/e300/e300_sensor_manager.cpp b/host/lib/usrp/e300/e300_sensor_manager.cpp index b96656e5e..52f888799 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.cpp +++ b/host/lib/usrp/e300/e300_sensor_manager.cpp @@ -171,11 +171,11 @@ public: uhd::sensor_value_t get_mb_temp(void) { - double scale = boost::lexical_cast( + double scale = std::stod( e300_get_sysfs_attr(E300_TEMP_SYSFS, "in_temp0_scale")); - unsigned long raw = boost::lexical_cast( + unsigned long raw = std::stoul( e300_get_sysfs_attr(E300_TEMP_SYSFS, "in_temp0_raw")); - unsigned long offset = boost::lexical_cast( + unsigned long offset = std::stoul( e300_get_sysfs_attr(E300_TEMP_SYSFS, "in_temp0_offset")); return sensor_value_t("temp", (raw + offset) * scale / 1000, "C"); } diff --git a/host/lib/usrp/e300/e300_sysfs_hooks.cpp b/host/lib/usrp/e300/e300_sysfs_hooks.cpp index bcfca8b92..08562f7d7 100644 --- a/host/lib/usrp/e300/e300_sysfs_hooks.cpp +++ b/host/lib/usrp/e300/e300_sysfs_hooks.cpp @@ -96,11 +96,11 @@ e300_fifo_config_t e300_read_sysfs(void) e300_fifo_config_t config; - config.buff_length = boost::lexical_cast( + config.buff_length = std::stoul( e300_get_sysfs_attr(E300_AXI_FPGA_SYSFS, "buffer_length")); - config.ctrl_length = boost::lexical_cast( + config.ctrl_length = std::stoul( e300_get_sysfs_attr(E300_AXI_FPGA_SYSFS, "control_length")); - config.phys_addr = boost::lexical_cast( + config.phys_addr = std::stoul( e300_get_sysfs_attr(E300_AXI_FPGA_SYSFS, "phys_addr")); return config; -- cgit v1.2.3