diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-18 12:43:59 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-18 12:43:59 -0700 |
commit | 4aa48966bff52e5fec2980d27c762b82d3ff8f1e (patch) | |
tree | dbe44f9f694e934900b5941554d23f30bfa8a725 /host/lib/usrp | |
parent | 5f27d6edb43f74abd5c8a7bb10b0931b61c6218d (diff) | |
download | uhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.tar.gz uhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.tar.bz2 uhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.zip |
usrp2: template pick rate to avoid compile errors
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/usrp2/dsp_impl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 347ec38af..6422142ce 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -31,9 +31,10 @@ static const size_t default_interp = 16; /*********************************************************************** * DDC Helper Methods **********************************************************************/ -static unsigned pick_closest_rate(double exact_rate, const std::vector<unsigned> &rates){ +template <typename rate_type> +static rate_type pick_closest_rate(double exact_rate, const std::vector<rate_type> &rates){ unsigned closest_match = rates.front(); - BOOST_FOREACH(unsigned possible_rate, rates){ + BOOST_FOREACH(rate_type possible_rate, rates){ if(std::abs(exact_rate - possible_rate) < std::abs(exact_rate - closest_match)) closest_match = possible_rate; } |