diff options
| author | Josh Blum <josh@joshknows.com> | 2011-07-08 17:55:49 -0700 | 
|---|---|---|
| committer | Josh Blum <josh@joshknows.com> | 2011-07-08 17:55:49 -0700 | 
| commit | bedd308e605f4772f156b13c702955422bfa87c5 (patch) | |
| tree | 3ffda15a87fbf06af8aefac18db293c4d6a7a80a /host/lib/usrp/common | |
| parent | 7bc972a81ff9ba5e2568f4132346e806d6b8257a (diff) | |
| download | uhd-bedd308e605f4772f156b13c702955422bfa87c5.tar.gz uhd-bedd308e605f4772f156b13c702955422bfa87c5.tar.bz2 uhd-bedd308e605f4772f156b13c702955422bfa87c5.zip  | |
uhd: some tweaks to fix msvc warnings
Diffstat (limited to 'host/lib/usrp/common')
| -rw-r--r-- | host/lib/usrp/common/fx2_ctrl.cpp | 12 | 
1 files changed, 5 insertions, 7 deletions
diff --git a/host/lib/usrp/common/fx2_ctrl.cpp b/host/lib/usrp/common/fx2_ctrl.cpp index 66a03f131..8f2206221 100644 --- a/host/lib/usrp/common/fx2_ctrl.cpp +++ b/host/lib/usrp/common/fx2_ctrl.cpp @@ -240,9 +240,9 @@ public:          while (not file.eof()) {              file.read((char *)buf, sizeof(buf)); -            size_t n = file.gcount(); +            const std::streamsize n = file.gcount();              if(n == 0) continue; -            int ret = usrp_control_write(VRQ_FPGA_LOAD, 0, FL_XFER, buf, n); +            int ret = usrp_control_write(VRQ_FPGA_LOAD, 0, FL_XFER, buf, boost::uint16_t(n));              if (ret < 0 or size_t(ret) != n) {                  throw uhd::io_error("usrp_load_fpga: fpga load error");              } @@ -266,8 +266,6 @@ public:          const char *filename = filestring.c_str();          const boost::uint16_t i2c_addr = 0x50; -        //FIXME: verify types -        int len;          unsigned int addr;          unsigned char data[256];          unsigned char sendbuf[17]; @@ -280,7 +278,7 @@ public:          }          file.read((char *)data, 256); -        len = file.gcount(); +        std::streamsize len = file.gcount();          if(len == 256) {              throw uhd::io_error("usrp_load_eeprom: image size too large"); @@ -290,8 +288,8 @@ public:          addr = 0;          while(len > 0) {              sendbuf[0] = addr; -            memcpy(sendbuf+1, &data[addr], len > pagesize ? pagesize : len); -            int ret = usrp_i2c_write(i2c_addr, sendbuf, (len > pagesize ? pagesize : len)+1); +            memcpy(sendbuf+1, &data[addr], len > pagesize ? pagesize : size_t(len)); +            int ret = usrp_i2c_write(i2c_addr, sendbuf, (len > pagesize ? pagesize : size_t(len))+1);              if (ret < 0) {                  throw uhd::io_error("usrp_load_eeprom: usrp_i2c_write failed");              }  | 
