From 26cc20847cde543e759aa5cee9a27eaa69c5dd9e Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Thu, 9 Feb 2017 23:19:55 -0800 Subject: uhd: replace BOOST_FOREACH with C++11 range-based for loop Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development. --- host/lib/transport/libusb1_base.cpp | 3 +-- host/lib/transport/libusb1_zero_copy.cpp | 7 +++---- host/lib/transport/super_recv_packet_handler.hpp | 1 - host/lib/transport/super_send_packet_handler.hpp | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'host/lib/transport') diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index d04b679f8..720e54e4d 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -227,7 +226,7 @@ public: 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(uint8_t byte, string_vec){ + for(uint8_t byte: string_vec){ if (byte < 32 or byte > 127) return out; out += byte; } diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index c32b96b63..719893bcd 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -274,19 +273,19 @@ public: ~libusb_zero_copy_single(void) { //cancel all transfers - BOOST_FOREACH(libusb_transfer *lut, _all_luts) + for(libusb_transfer *lut: _all_luts) { libusb_cancel_transfer(lut); } //process all transfers until timeout occurs - BOOST_FOREACH(libusb_zero_copy_mb *mb, _enqueued) + for(libusb_zero_copy_mb *mb: _enqueued) { mb->wait_for_completion(0.01); } //free all transfers - BOOST_FOREACH(libusb_transfer *lut, _all_luts) + for(libusb_transfer *lut: _all_luts) { libusb_free_transfer(lut); } diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index d34f222e8..161d921bc 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index 0acc8df4b..09ae0c882 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -382,7 +381,7 @@ private: if_packet_info.packet_count = _next_packet_seq; //get a buffer for each channel or timeout - BOOST_FOREACH(xport_chan_props_type &props, _props){ + for(xport_chan_props_type &props: _props){ if (not props.buff) props.buff = props.get_buff(timeout); if (not props.buff) return 0; //timeout } -- cgit v1.2.3