aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/dsp_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-18 12:43:59 -0700
committerJosh Blum <josh@joshknows.com>2010-08-18 12:43:59 -0700
commit4aa48966bff52e5fec2980d27c762b82d3ff8f1e (patch)
treedbe44f9f694e934900b5941554d23f30bfa8a725 /host/lib/usrp/usrp2/dsp_impl.cpp
parent5f27d6edb43f74abd5c8a7bb10b0931b61c6218d (diff)
downloaduhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.tar.gz
uhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.tar.bz2
uhd-4aa48966bff52e5fec2980d27c762b82d3ff8f1e.zip
usrp2: template pick rate to avoid compile errors
Diffstat (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/dsp_impl.cpp5
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;
}