From 1ba93e70a6a79dc06bd9ba09a72e2798debede9b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 26 Apr 2010 21:25:00 -0700 Subject: fixed windows warnings --- host/lib/usrp/dboard/db_xcvr2450.cpp | 8 ++++---- host/lib/usrp/dboard_eeprom.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index efe7687c2..0dfef2a0a 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -263,7 +263,7 @@ void xcvr2450::set_lo_freq(double target_freq){ for(R = 1; R <= 7; R++){ double N = (target_freq*scaler*R*_ad9515div)/ref_freq; intdiv = int(std::floor(N)); - fracdiv = (N - intdiv)*double(1 << 16); + fracdiv = boost::math::iround((N - intdiv)*double(1 << 16)); //actual minimum is 128, but most chips seems to require higher to lock if (intdiv < 131 or intdiv > 255) continue; //constraints met: exit loop @@ -344,8 +344,8 @@ static int gain_to_tx_vga_reg(float &gain){ //calculate the actual gain value if (reg < 4) gain = 0; - else if (reg < 48) gain = reg/2 - 1; - else gain = reg/2.0 - 1.5; + else if (reg < 48) gain = float(reg/2 - 1); + else gain = float(reg/2.0 - 1.5); //return register value return reg; @@ -385,7 +385,7 @@ static max2829_regs_t::tx_baseband_gain_t gain_to_tx_bb_reg(float &gain){ */ static int gain_to_rx_vga_reg(float &gain){ int reg = std::clip(boost::math::iround(gain/2.0), 0, 31); - gain = reg*2; + gain = float(reg*2); return reg; } diff --git a/host/lib/usrp/dboard_eeprom.cpp b/host/lib/usrp/dboard_eeprom.cpp index 1404ed1e6..54e7a4fd9 100644 --- a/host/lib/usrp/dboard_eeprom.cpp +++ b/host/lib/usrp/dboard_eeprom.cpp @@ -83,7 +83,7 @@ dboard_eeprom_t::dboard_eeprom_t(const byte_vector_t &bytes){ id = \ (boost::uint16_t(bytes[DB_EEPROM_ID_LSB]) << 0) | (boost::uint16_t(bytes[DB_EEPROM_ID_MSB]) << 8) ; - }catch(const uhd::assert_error &e){ + }catch(const uhd::assert_error &){ id = dboard_id::NONE; } } -- cgit v1.2.3