aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2015-12-07 20:27:02 +0100
committerDimitri Stolnikov <horiz0n@gmx.net>2015-12-07 20:27:02 +0100
commit69ec75a0b4d2a7fbab0dd456e7190b5c644880f2 (patch)
treefe1b830e6c79017b0cd396ca29c8a2910d2fcde4
parent3198eb927a09cb1741670e3c47a987c820934976 (diff)
hackrf: since devicecount is signed, make comparisons signed as well
-rw-r--r--lib/hackrf/hackrf_sink_c.cc2
-rw-r--r--lib/hackrf/hackrf_source_c.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc
index 7aa864d..e81ae34 100644
--- a/lib/hackrf/hackrf_sink_c.cc
+++ b/lib/hackrf/hackrf_sink_c.cc
@@ -489,7 +489,7 @@ std::vector<std::string> hackrf_sink_c::get_devices()
#ifdef LIBHACKRF_HAVE_DEVICE_LIST
hackrf_device_list_t *list = hackrf_device_list();
- for (unsigned int i = 0; i < list->devicecount; i++) {
+ for (int i = 0; i < list->devicecount; i++) {
label = "HackRF ";
label += hackrf_usb_board_id_name( list->usb_board_ids[i] );
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc
index 81ddad6..79a8c71 100644
--- a/lib/hackrf/hackrf_source_c.cc
+++ b/lib/hackrf/hackrf_source_c.cc
@@ -151,14 +151,14 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
if (hackrf_serial.length() > 1) {
ret = hackrf_open_by_serial( hackrf_serial.c_str(), &_dev );
} else {
- unsigned int dev_index = 0;
+ int dev_index = 0;
try {
- dev_index = boost::lexical_cast< unsigned int >( hackrf_serial );
+ dev_index = boost::lexical_cast< int >( hackrf_serial );
} catch ( std::exception &ex ) {
throw std::runtime_error(
"Failed to use '" + hackrf_serial + "' as HackRF device index number: " + ex.what());
}
-
+
hackrf_device_list_t *list = hackrf_device_list();
if (dev_index < list->devicecount) {
ret = hackrf_device_list_open(list, dev_index, &_dev);
@@ -404,7 +404,7 @@ std::vector<std::string> hackrf_source_c::get_devices()
#ifdef LIBHACKRF_HAVE_DEVICE_LIST
hackrf_device_list_t *list = hackrf_device_list();
- for (unsigned int i = 0; i < list->devicecount; i++) {
+ for (int i = 0; i < list->devicecount; i++) {
label = "HackRF ";
label += hackrf_usb_board_id_name( list->usb_board_ids[i] );