From 5d9a7c92d3eb0a9cb719e6e6386d533da59a51db Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Apr 2018 13:13:32 -0700 Subject: lib: Purge use of boost::assign, except for uhd::dict Replaced with initialization lists. Note: uhd::dict does not work with initializer lists without making changes to said data structure. This commit has no functional changes, so keeping the boost::assigns for uhd::dict. --- host/lib/types/serial.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'host/lib/types') diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp index 24da51e7f..afa99d051 100644 --- a/host/lib/types/serial.cpp +++ b/host/lib/types/serial.cpp @@ -6,7 +6,7 @@ // #include -#include +#include #include #include @@ -42,7 +42,10 @@ void i2c_iface::write_eeprom( ){ for (size_t i = 0; i < bytes.size(); i++){ //write a byte at a time, its easy that way - byte_vector_t cmd = boost::assign::list_of(offset+i)(bytes[i]); + byte_vector_t cmd = { + narrow_cast(offset+i), + narrow_cast(bytes[i]) + }; this->write_i2c(addr, cmd); std::this_thread::sleep_for(std::chrono::milliseconds(10)); //worst case write } @@ -89,7 +92,10 @@ struct eeprom16_impl : i2c_iface uint16_t offset, size_t num_bytes ){ - byte_vector_t cmd = boost::assign::list_of(offset >> 8)(offset & 0xff); + byte_vector_t cmd = { + narrow_cast(offset >> 8), + narrow_cast(offset & 0xff) + }; this->write_i2c(addr, cmd); return this->read_i2c(addr, num_bytes); } @@ -103,7 +109,11 @@ struct eeprom16_impl : i2c_iface { //write a byte at a time, its easy that way uint16_t offset_i = offset+i; - byte_vector_t cmd = boost::assign::list_of(offset_i >> 8)(offset_i & 0xff)(bytes[i]); + byte_vector_t cmd{ + narrow_cast(offset_i >> 8), + narrow_cast(offset_i & 0xff), + bytes[i] + }; this->write_i2c(addr, cmd); std::this_thread::sleep_for(std::chrono::milliseconds(10)); //worst case write } -- cgit v1.2.3