From e898450a2e9bff57ebc25b48ed10508ac6383b30 Mon Sep 17 00:00:00 2001 From: Balint Seeber Date: Wed, 19 Mar 2014 14:33:12 -0700 Subject: b200: addressed review comments (boost::uint16_t & source code long line breaking) --- host/lib/usrp/b200/b200_impl.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index a80e96ba2..a02ef2e03 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -156,12 +156,12 @@ b200_impl::b200_impl(const device_addr_t &device_addr) const fs_path mb_path = "/mboards/0"; //try to match the given device address with something on the USB bus - unsigned int vid = B200_VENDOR_ID; - unsigned int pid = B200_PRODUCT_ID; + boost::uint16_t vid = B200_VENDOR_ID; + boost::uint16_t pid = B200_PRODUCT_ID; if (device_addr.has_key("vid")) - sscanf(device_addr.get("vid").c_str(), "%x", &vid); + sscanf(device_addr.get("vid").c_str(), "%hx", &vid); if (device_addr.has_key("pid")) - sscanf(device_addr.get("pid").c_str(), "%x", &pid); + sscanf(device_addr.get("pid").c_str(), "%hx", &pid); std::vector device_list = usb_device_handle::get_device_list(vid, pid); @@ -664,13 +664,26 @@ void b200_impl::enforce_tick_rate_limits(size_t chan_count, double tick_rate, co const size_t max_chans = 2; if (chan_count > max_chans) { - throw uhd::value_error(boost::str(boost::format("cannot not setup %d %s channels (maximum is %d)") % chan_count % (direction ? direction : "data") % max_chans)); + throw uhd::value_error(boost::str( + boost::format("cannot not setup %d %s channels (maximum is %d)") + % chan_count + % (direction ? direction : "data") + % max_chans + )); } else { const double max_tick_rate = ((chan_count <= 1) ? AD9361_1_CHAN_CLOCK_RATE_MAX : AD9361_2_CHAN_CLOCK_RATE_MAX); if (tick_rate > max_tick_rate) - throw uhd::value_error(boost::str(boost::format("current master clock rate (%.2f MHz) exceeds maximum possible master clock rate (%.2f MHz) when using %d %s channels") % (tick_rate/1e6) % (max_tick_rate/1e6) % chan_count % (direction ? direction : "data"))); + { + throw uhd::value_error(boost::str( + boost::format("current master clock rate (%.2f MHz) exceeds maximum possible master clock rate (%.2f MHz) when using %d %s channels") + % (tick_rate/1e6) + % (max_tick_rate/1e6) + % chan_count + % (direction ? direction : "data") + )); + } } } -- cgit v1.2.3