aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-03-11 16:45:19 -0700
committerMartin Braun <martin.braun@ettus.com>2015-03-11 16:58:23 -0700
commitcc7d37f114d5a14b4e45372f38324bf95115b6b9 (patch)
tree0b6a39418c0aa5caafa3039b578c94d3db8f1775 /host/include
parentfae746179cbb1d8ac146dcae9b5d6cb58b366a56 (diff)
downloaduhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.tar.gz
uhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.tar.bz2
uhd-cc7d37f114d5a14b4e45372f38324bf95115b6b9.zip
uhd: Fixed several type-cast related warnings for naggy compilers
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/fp_compare_delta.ipp20
-rw-r--r--host/include/uhd/utils/math.hpp2
2 files changed, 11 insertions, 11 deletions
diff --git a/host/include/uhd/utils/fp_compare_delta.ipp b/host/include/uhd/utils/fp_compare_delta.ipp
index 092ade6e9..49cbc281b 100644
--- a/host/include/uhd/utils/fp_compare_delta.ipp
+++ b/host/include/uhd/utils/fp_compare_delta.ipp
@@ -100,8 +100,8 @@ namespace uhd { namespace math { namespace fp_compare {
template<typename float_t> UHD_INLINE
bool operator==(fp_compare_delta<float_t> lhs, double rhs) {
- float_t delta = fp_compare_select_delta(double(lhs._delta),
- DOUBLE_PRECISION_DELTA);
+ float_t delta = float_t(fp_compare_select_delta(double(lhs._delta),
+ DOUBLE_PRECISION_DELTA));
return (std::fabs(lhs._value - rhs) < delta);
}
@@ -112,8 +112,8 @@ namespace uhd { namespace math { namespace fp_compare {
template<typename float_t> UHD_INLINE
bool operator<(fp_compare_delta<float_t> lhs, double rhs) {
- float_t delta = fp_compare_select_delta(double(lhs._delta),
- DOUBLE_PRECISION_DELTA);
+ float_t delta = float_t(fp_compare_select_delta(double(lhs._delta),
+ DOUBLE_PRECISION_DELTA));
return ((rhs - lhs._value) > delta);
}
@@ -124,8 +124,8 @@ namespace uhd { namespace math { namespace fp_compare {
template<typename float_t> UHD_INLINE
bool operator>(fp_compare_delta<float_t> lhs, double rhs) {
- float_t delta = fp_compare_select_delta(double(lhs._delta),
- DOUBLE_PRECISION_DELTA);
+ float_t delta = float_t(fp_compare_select_delta(double(lhs._delta),
+ DOUBLE_PRECISION_DELTA));
return ((lhs._value - rhs) > delta);
}
@@ -148,8 +148,8 @@ namespace uhd { namespace math { namespace fp_compare {
template<typename float_t> UHD_INLINE
bool operator<(double lhs, fp_compare_delta<float_t> rhs) {
- float_t delta = fp_compare_select_delta(DOUBLE_PRECISION_DELTA,
- double(rhs._delta));
+ float_t delta = float_t(fp_compare_select_delta(DOUBLE_PRECISION_DELTA,
+ double(rhs._delta)));
return ((rhs._value - lhs) > delta);
}
@@ -160,8 +160,8 @@ namespace uhd { namespace math { namespace fp_compare {
template<typename float_t> UHD_INLINE
bool operator>(double lhs, fp_compare_delta<float_t> rhs) {
- float_t delta = fp_compare_select_delta(DOUBLE_PRECISION_DELTA,
- double(rhs._delta));
+ float_t delta = float_t(fp_compare_select_delta(DOUBLE_PRECISION_DELTA,
+ double(rhs._delta)));
return ((lhs - rhs._value) > delta);
}
diff --git a/host/include/uhd/utils/math.hpp b/host/include/uhd/utils/math.hpp
index e6ac4d3dc..4f88494d6 100644
--- a/host/include/uhd/utils/math.hpp
+++ b/host/include/uhd/utils/math.hpp
@@ -155,7 +155,7 @@ namespace fp_compare {
* These are the default deltas used by the 'fp_compare_delta' class for
* single and double-precision floating point comparisons.
*/
- static const float SINGLE_PRECISION_DELTA = 1e-3;
+ static const float SINGLE_PRECISION_DELTA = 1e-3f;
static const double DOUBLE_PRECISION_DELTA = 1e-5;
/*! Floating-point delta to use for frequency comparisons. */