diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2016-06-24 17:21:45 -0400 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-08-01 18:49:53 -0700 |
commit | c286032a2a26edcbbd19686032e8d3517db9868e (patch) | |
tree | ae752eba21c531cdec111f6ad4c5b46f2b4975d6 /host | |
parent | 8c1b03e38ef3985bffd6419d302d23780f1cf39d (diff) | |
download | uhd-c286032a2a26edcbbd19686032e8d3517db9868e.tar.gz uhd-c286032a2a26edcbbd19686032e8d3517db9868e.tar.bz2 uhd-c286032a2a26edcbbd19686032e8d3517db9868e.zip |
usb: tweak types for consistency between LIBUSB API calls and internal UHD usage of returned values.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 6 | ||||
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index c0c1d6a86..7b9e11da9 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -219,12 +219,12 @@ public: ); unsigned char buff[512]; - ssize_t ret = libusb_get_string_descriptor_ascii( - handle->get(), off, buff, sizeof(buff) + int ret = libusb_get_string_descriptor_ascii( + handle->get(), off, buff, int(sizeof(buff)) ); if (ret < 0) return ""; //on error, just return empty string - std::string string_descriptor((char *)buff, ret); + std::string string_descriptor((char *)buff, size_t(ret)); byte_vector_t string_vec(string_descriptor.begin(), string_descriptor.end()); std::string out; BOOST_FOREACH(boost::uint8_t byte, string_vec){ diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index 3f0db74de..c32b96b63 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -133,13 +133,13 @@ public: UHD_INLINE void submit(void) { - _lut->length = (_is_recv)? _frame_size : size(); //always set length + _lut->length = int((_is_recv)? _frame_size : size()); //always set length #ifdef UHD_TXRX_DEBUG_PRINTS result.start_time = boost::get_system_time().time_of_day().total_microseconds(); result.buff_num = num(); result.is_recv = _is_recv; #endif - const int ret = libusb_submit_transfer(_lut); + int ret = libusb_submit_transfer(_lut); if (ret != LIBUSB_SUCCESS) throw uhd::usb_error(ret, str(boost::format( "usb %s submit failed: %s") % _name % libusb_error_name(ret))); @@ -154,7 +154,7 @@ public: throw uhd::io_error(str(boost::format("usb %s transfer status: %d") % _name % libusb_error_name(result.status))); result.completed = 0; - return make(reinterpret_cast<buffer_type *>(this), _lut->buffer, (_is_recv)? result.actual_length : _frame_size); + return make(reinterpret_cast<buffer_type *>(this), _lut->buffer, (_is_recv)? size_t(result.actual_length) : _frame_size); } return typename buffer_type::sptr(); } @@ -227,7 +227,7 @@ public: _handle->get(), // dev_handle endpoint, // endpoint static_cast<unsigned char *>(buff), - sizeof(buff), + int(sizeof(buff)), &transfered, //bytes xfered 10 //timeout ms ); @@ -249,7 +249,7 @@ public: _handle->get(), // dev_handle endpoint, // endpoint static_cast<unsigned char *>(_buffer_pool->at(i)), // buffer - this->get_frame_size(), // length + int(this->get_frame_size()), // length libusb_transfer_cb_fn(&libusb_async_cb), // callback static_cast<void *>(&_mb_pool.back()->result), // user_data 0 // timeout (ms) |