From 0c6fbdfe3738e2d15b369fbd28d51ee0115628f9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 14 Jun 2010 10:44:50 -0700 Subject: work on algorithms and documentation --- host/lib/device.cpp | 8 ++------ host/lib/usrp/tune_helper.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'host/lib') diff --git a/host/lib/device.cpp b/host/lib/device.cpp index f139ecb20..431595c4f 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -19,13 +19,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include using namespace uhd; @@ -41,13 +41,9 @@ using namespace uhd; static size_t hash_device_addr( const device_addr_t &dev_addr ){ - //sort the keys of the device address - std::vector keys = dev_addr.keys(); - std::sort(keys.begin(), keys.end()); - //combine the hashes of sorted keys/value pairs size_t hash = 0; - BOOST_FOREACH(const std::string &key, keys){ + BOOST_FOREACH(const std::string &key, std::sorted(dev_addr.keys())){ boost::hash_combine(hash, key); boost::hash_combine(hash, dev_addr[key]); } diff --git a/host/lib/usrp/tune_helper.cpp b/host/lib/usrp/tune_helper.cpp index a7d695b4e..082c39f6d 100644 --- a/host/lib/usrp/tune_helper.cpp +++ b/host/lib/usrp/tune_helper.cpp @@ -46,7 +46,7 @@ static tune_result_t tune_xx_subdev_and_dxc( // Calculate the DDC setting that will downconvert the baseband from the // daughterboard to our target frequency. double delta_freq = target_freq - actual_inter_freq; - double delta_sign = std::signum(delta_freq); + int delta_sign = std::signum(delta_freq); delta_freq *= delta_sign; delta_freq = std::fmod(delta_freq, dxc_sample_rate); bool inverted = delta_freq > dxc_sample_rate/2.0; -- cgit v1.2.3