diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-02-15 16:42:34 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-02-28 10:24:52 -0800 |
commit | d23df2d9411a0d80e00a6927fff946f2c5f906bc (patch) | |
tree | 5647a4f1c984f1852877b59781c08d7a6d6a15bb /host/lib/types | |
parent | 4047f692d454446b10af4f67f4c208ba19b4dbef (diff) | |
download | uhd-d23df2d9411a0d80e00a6927fff946f2c5f906bc.tar.gz uhd-d23df2d9411a0d80e00a6927fff946f2c5f906bc.tar.bz2 uhd-d23df2d9411a0d80e00a6927fff946f2c5f906bc.zip |
lib: Fix various type-conversion compiler warnings
This makes more type-conversions explicit, to reduce the number of
warnings specifically for MSVC.
Diffstat (limited to 'host/lib/types')
-rw-r--r-- | host/lib/types/serial.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp index afa99d051..83f538f5e 100644 --- a/host/lib/types/serial.cpp +++ b/host/lib/types/serial.cpp @@ -59,7 +59,7 @@ byte_vector_t i2c_iface::read_eeprom( byte_vector_t bytes; for (size_t i = 0; i < num_bytes; i++){ //do a zero byte write to start read cycle - this->write_i2c(addr, byte_vector_t(1, offset+i)); + this->write_i2c(addr, byte_vector_t(1, narrow_cast<uint8_t>(offset+i))); bytes.push_back(this->read_i2c(addr, 1).at(0)); } return bytes; @@ -105,7 +105,7 @@ struct eeprom16_impl : i2c_iface uint16_t offset, const byte_vector_t &bytes ){ - for (size_t i = 0; i < bytes.size(); i++) + for (uint16_t i = 0; i < bytes.size(); i++) { //write a byte at a time, its easy that way uint16_t offset_i = offset+i; |