summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-14 18:47:40 -0700
committerJosh Blum <josh@joshknows.com>2010-06-14 18:47:40 -0700
commit6f9ce938de36476de68720e8090e9a92d0f2fefe (patch)
tree862b327c1e9f43d131db666de44f0a66571bd36e /host/lib
parenteac881f6dcc169749001d5147f0f32f36ad34a21 (diff)
parent00ca9fcc3d7645d3f1a9d7d767b8ccab110325bb (diff)
downloaduhd-6f9ce938de36476de68720e8090e9a92d0f2fefe.tar.gz
uhd-6f9ce938de36476de68720e8090e9a92d0f2fefe.tar.bz2
uhd-6f9ce938de36476de68720e8090e9a92d0f2fefe.zip
Merge branch 'work'
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/device.cpp8
-rw-r--r--host/lib/transport/udp_zero_copy_asio.cpp7
-rw-r--r--host/lib/usrp/tune_helper.cpp2
3 files changed, 8 insertions, 9 deletions
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 <uhd/types/dict.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/utils/static.hpp>
+#include <uhd/utils/algorithm.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/functional/hash.hpp>
#include <boost/tuple/tuple.hpp>
#include <stdexcept>
-#include <algorithm>
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<std::string> 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/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp
index ced606777..c3c02707e 100644
--- a/host/lib/transport/udp_zero_copy_asio.cpp
+++ b/host/lib/transport/udp_zero_copy_asio.cpp
@@ -148,9 +148,12 @@ template<typename Opt> static void resize_buff_helper(
if (target_size > 0){
size_t actual_size = udp_trans->resize_buff<Opt>(target_size);
if (target_size != actual_size) std::cout << boost::format(
- "Target %s buffer size: %d\n"
- "Actual %s byffer size: %d"
+ "Target %s sock buff size: %d bytes\n"
+ "Actual %s sock buff size: %d bytes"
) % name % target_size % name % actual_size << std::endl;
+ else std::cout << boost::format(
+ "Current %s sock buff size: %d bytes"
+ ) % name % actual_size << std::endl;
}
//otherwise, ensure that the buffer is at least the minimum size
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;