aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/block_ctrl_base.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-06-27 19:06:50 -0700
committerMartin Braun <martin.braun@ettus.com>2017-06-29 13:40:07 -0700
commit47cdd6319c74a7b823843aad5ff3fa370ed1e6ef (patch)
tree216e88f36dbb5ba0b933f0a5ec3c2a151e972589 /host/lib/rfnoc/block_ctrl_base.cpp
parent412a7053cc0698fd8e1a09d9c40ec2f96cf629af (diff)
downloaduhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.tar.gz
uhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.tar.bz2
uhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.zip
uhd: Replaced many lexical_cast with appropriate C++11 equivalents
Diffstat (limited to 'host/lib/rfnoc/block_ctrl_base.cpp')
-rw-r--r--host/lib/rfnoc/block_ctrl_base.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp
index e9d6c0030..1a753403a 100644
--- a/host/lib/rfnoc/block_ctrl_base.cpp
+++ b/host/lib/rfnoc/block_ctrl_base.cpp
@@ -195,8 +195,8 @@ void block_ctrl_base::_init_block_args()
fs_path arg_val_path = arg_path / arg["port"] / arg["name"] / "value";
if (not arg["value"].empty()) {
if (arg["type"] == "int_vector") { throw uhd::runtime_error("not yet implemented: int_vector"); }
- else if (arg["type"] == "int") { _tree->access<int>(arg_val_path).set(boost::lexical_cast<int>(arg["value"])); }
- else if (arg["type"] == "double") { _tree->access<double>(arg_val_path).set(boost::lexical_cast<double>(arg["value"])); }
+ else if (arg["type"] == "int") { _tree->access<int>(arg_val_path).set(std::stoi(arg["value"])); }
+ else if (arg["type"] == "double") { _tree->access<double>(arg_val_path).set(std::stod(arg["value"])); }
else if (arg["type"] == "string") { _tree->access<string>(arg_val_path).set(arg["value"]); }
else { UHD_THROW_INVALID_CODE_PATH(); }
}
@@ -453,10 +453,10 @@ void block_ctrl_base::set_arg(const std::string &key, const std::string &val, co
_tree->access<std::string>(arg_val_path).set(val);
}
else if (type == "int") {
- _tree->access<int>(arg_val_path).set(boost::lexical_cast<int>(val));
+ _tree->access<int>(arg_val_path).set(std::stoi(val));
}
else if (type == "double") {
- _tree->access<double>(arg_val_path).set(boost::lexical_cast<double>(val));
+ _tree->access<double>(arg_val_path).set(std::stod(val));
}
else if (type == "int_vector") {
throw uhd::runtime_error("not yet implemented: int_vector");
@@ -494,10 +494,10 @@ std::string block_ctrl_base::get_arg(const std::string &key, const size_t port)
return _tree->access<std::string>(arg_val_path).get();
}
else if (type == "int") {
- return boost::lexical_cast<std::string>(_tree->access<int>(arg_val_path).get());
+ return std::to_string(_tree->access<int>(arg_val_path).get());
}
else if (type == "double") {
- return boost::lexical_cast<std::string>(_tree->access<double>(arg_val_path).get());
+ return std::to_string(_tree->access<double>(arg_val_path).get());
}
else if (type == "int_vector") {
throw uhd::runtime_error("not yet implemented: int_vector");