diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2013-11-27 12:11:23 -0800 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2013-11-27 12:11:23 -0800 |
commit | 9e47ad607b597954e786db6614f5b42123184ccd (patch) | |
tree | f8f021498105c1144968c989b73e37d51d2e94f9 /host/lib/usrp/usrp1 | |
parent | 0e3912767266473e08386c910954450d16d33664 (diff) | |
download | uhd-9e47ad607b597954e786db6614f5b42123184ccd.tar.gz uhd-9e47ad607b597954e786db6614f5b42123184ccd.tar.bz2 uhd-9e47ad607b597954e786db6614f5b42123184ccd.zip |
Squashed merge of Coverity fixes.
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r-- | host/lib/usrp/usrp1/io_impl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_iface.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index d384eb13f..e1f17e5a6 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -63,7 +63,7 @@ static const size_t alignment_padding = 512; * Helper struct to associate an offset with a buffer **********************************************************************/ struct offset_send_buffer{ - offset_send_buffer(void){ + offset_send_buffer(void):offset(0){ /* NOP */ } diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp index 9301721aa..6eff9d3ad 100644 --- a/host/lib/usrp/usrp1/usrp1_iface.cpp +++ b/host/lib/usrp/usrp1/usrp1_iface.cpp @@ -91,11 +91,11 @@ public: return uhd::ntohx(value_out); } - + void poke16(boost::uint32_t, boost::uint16_t) { throw uhd::not_implemented_error("Unhandled command poke16()"); } - + boost::uint16_t peek16(boost::uint32_t) { throw uhd::not_implemented_error("Unhandled command peek16()"); return 0; @@ -141,8 +141,10 @@ public: if (readback) { unsigned char buff[4] = { - (bits >> 0) & 0xff, (bits >> 8) & 0xff, - (bits >> 16) & 0xff, (bits >> 24) & 0xff + (unsigned char)(bits & 0xff), + (unsigned char)((bits >> 8) & 0xff), + (unsigned char)((bits >> 16) & 0xff), + (unsigned char)((bits >> 24) & 0xff) }; //conditions where there are two header bytes if (num_bytes >= 3 and buff[num_bytes-1] != 0 and buff[num_bytes-2] != 0 and buff[num_bytes-3] == 0){ @@ -168,7 +170,7 @@ public: (((boost::uint32_t)buff[1]) << 8) | (((boost::uint32_t)buff[2]) << 16) | (((boost::uint32_t)buff[3]) << 24); - return val; + return val; } else { // Byteswap on num_bytes |