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 | |
parent | 7bc972a81ff9ba5e2568f4132346e806d6b8257a (diff) | |
download | uhd-bedd308e605f4772f156b13c702955422bfa87c5.tar.gz uhd-bedd308e605f4772f156b13c702955422bfa87c5.tar.bz2 uhd-bedd308e605f4772f156b13c702955422bfa87c5.zip |
uhd: some tweaks to fix msvc warnings
-rw-r--r-- | host/lib/convert/convert_with_sse2.cpp | 40 | ||||
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/common/fx2_ctrl.cpp | 12 |
3 files changed, 26 insertions, 28 deletions
diff --git a/host/lib/convert/convert_with_sse2.cpp b/host/lib/convert/convert_with_sse2.cpp index 0cbb2c444..0649baab4 100644 --- a/host/lib/convert/convert_with_sse2.cpp +++ b/host/lib/convert/convert_with_sse2.cpp @@ -28,10 +28,10 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ const __m128 scalar = _mm_set_ps1(float(scale_factor)); #define convert_fc32_1_to_item32_1_nswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ - __m128 tmplo = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+0)); \ - __m128 tmphi = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+2)); \ + __m128 tmplo = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+0)); \ + __m128 tmphi = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+2)); \ \ /* convert and scale */ \ __m128i tmpilo = _mm_cvtps_epi32(_mm_mul_ps(tmplo, scalar)); \ @@ -53,9 +53,9 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ case 0x8: output[i] = fc32_to_item32(input[i], float(scale_factor)); i++; case 0x0: - convert_fc32_1_to_item32_1_nswap_guts() + convert_fc32_1_to_item32_1_nswap_guts(_) break; - default: convert_fc32_1_to_item32_1_nswap_guts(u) + default: convert_fc32_1_to_item32_1_nswap_guts(u_) } //convert remainder @@ -71,10 +71,10 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ const __m128 scalar = _mm_set_ps1(float(scale_factor)); #define convert_fc32_1_to_item32_1_bswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ - __m128 tmplo = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+0)); \ - __m128 tmphi = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+2)); \ + __m128 tmplo = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+0)); \ + __m128 tmphi = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+2)); \ \ /* convert and scale */ \ __m128i tmpilo = _mm_cvtps_epi32(_mm_mul_ps(tmplo, scalar)); \ @@ -95,9 +95,9 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ case 0x8: output[i] = uhd::byteswap(fc32_to_item32(input[i], float(scale_factor))); i++; case 0x0: - convert_fc32_1_to_item32_1_bswap_guts() + convert_fc32_1_to_item32_1_bswap_guts(_) break; - default: convert_fc32_1_to_item32_1_bswap_guts(u) + default: convert_fc32_1_to_item32_1_bswap_guts(u_) } //convert remainder @@ -114,7 +114,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ const __m128i zeroi = _mm_setzero_si128(); #define convert_item32_1_to_fc32_1_nswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ __m128i tmpi = _mm_loadu_si128(reinterpret_cast<const __m128i *>(input+i)); \ \ @@ -129,8 +129,8 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ __m128 tmphi = _mm_mul_ps(_mm_cvtepi32_ps(tmpihi), scalar); \ \ /* store to output */ \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+0), tmplo); \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+2), tmphi); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+0), tmplo); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+2), tmphi); \ } \ size_t i = 0; @@ -140,9 +140,9 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ case 0x8: output[i] = item32_to_fc32(input[i], float(scale_factor)); i++; case 0x0: - convert_item32_1_to_fc32_1_nswap_guts() + convert_item32_1_to_fc32_1_nswap_guts(_) break; - default: convert_item32_1_to_fc32_1_nswap_guts(u) + default: convert_item32_1_to_fc32_1_nswap_guts(u_) } //convert remainder @@ -159,7 +159,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ const __m128i zeroi = _mm_setzero_si128(); #define convert_item32_1_to_fc32_1_bswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ __m128i tmpi = _mm_loadu_si128(reinterpret_cast<const __m128i *>(input+i)); \ \ @@ -173,8 +173,8 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ __m128 tmphi = _mm_mul_ps(_mm_cvtepi32_ps(tmpihi), scalar); \ \ /* store to output */ \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+0), tmplo); \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+2), tmphi); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+0), tmplo); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+2), tmphi); \ } \ size_t i = 0; @@ -184,9 +184,9 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ case 0x8: output[i] = item32_to_fc32(uhd::byteswap(input[i]), float(scale_factor)); i++; case 0x0: - convert_item32_1_to_fc32_1_bswap_guts() + convert_item32_1_to_fc32_1_bswap_guts(_) break; - default: convert_item32_1_to_fc32_1_bswap_guts(u) + default: convert_item32_1_to_fc32_1_bswap_guts(u_) } //convert remainder diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index 6d4df7875..9b4290c08 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -206,7 +206,7 @@ libusb::device_handle::sptr libusb::device_handle::get_cached_handle(device::spt handles[dev->get()] = new_handle; return new_handle; } - catch(const uhd::exception &e){ + catch(const uhd::exception &){ std::cerr << "USB open failed: see the application notes for your device." << std::endl; throw; } 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"); } |