diff options
author | Mattijs Korpershoek <mattijsx.korpershoek@intel.com> | 2014-05-22 15:22:04 +0200 |
---|---|---|
committer | Mattijs Korpershoek <mattijsx.korpershoek@intel.com> | 2014-06-25 10:52:30 +0200 |
commit | d9406eea67ae1d88b36e356d10d491f3bf0dfe1b (patch) | |
tree | cfc0036ebe8a91d12e3f0b80cb00e75fbac11c87 | |
parent | d299108157ee4d0eadb7683b2fa6a6635bc63d95 (diff) | |
download | external_parameter-framework-d9406eea67ae1d88b36e356d10d491f3bf0dfe1b.zip external_parameter-framework-d9406eea67ae1d88b36e356d10d491f3bf0dfe1b.tar.gz external_parameter-framework-d9406eea67ae1d88b36e356d10d491f3bf0dfe1b.tar.bz2 |
Fix fixed-point parameter range check
BZ: 197723
When adding parameters which are far out of bounds, the range check does
not refuse to set the value. This is unexpected behaviour.
This patch adds a correct range check.
Change-Id: I325920bcabc9485bd8f95aadcaff36a67182b97c
Signed-off-by: Mattijs Korpershoek <mattijsx.korpershoek@intel.com>
-rw-r--r-- | parameter/FixedPointParameterType.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/parameter/FixedPointParameterType.cpp b/parameter/FixedPointParameterType.cpp index 33d79e1..d465ace 100644 --- a/parameter/FixedPointParameterType.cpp +++ b/parameter/FixedPointParameterType.cpp @@ -332,13 +332,7 @@ bool CFixedPointParameterType::checkValueAgainstRange(double dValue) const double dMax = 0; getRange(dMin, dMax); - /** - * Bijective transformation is only ensured in raw format. - * So, as the double stored in the XML may be significant, and as the std::setprecision used - * may round up, double representation may go outside the range. - */ - int32_t rawValue = asInteger(dValue); - return (rawValue <= asInteger(dMax)) && (rawValue >= asInteger(dMin)); + return (dValue <= dMax) && (dValue >= dMin); } // Data conversion |