diff options
author | Patrick Benavoli <patrickx.benavoli@intel.com> | 2011-10-04 15:32:57 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-10 17:14:56 +0100 |
commit | 11e6498a4fa3b27ca34d2fcb76bd6365da9d5c1b (patch) | |
tree | 51a757715ce03dac4cadb51cf742991c650c09a6 /parameter/BitParameterType.cpp | |
parent | 930075cd752694f173605fccde1bac1f2bc1e8e7 (diff) | |
download | external_parameter-framework-11e6498a4fa3b27ca34d2fcb76bd6365da9d5c1b.zip external_parameter-framework-11e6498a4fa3b27ca34d2fcb76bd6365da9d5c1b.tar.gz external_parameter-framework-11e6498a4fa3b27ca34d2fcb76bd6365da9d5c1b.tar.bz2 |
parameter-framework: import/export XML
BZ: 10948
- Max value handling on integers corrected
- Left-justified Qn.m numbers
- Corrections after code review: removed fixed numbers from the code and unified byte to bit conversions
Change-Id: Iaf54e413201eae61013735580e046c5ab1874700
Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com>
Reviewed-on: http://android.intel.com:8080/22316
Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Reviewed-on: http://android.intel.com:8080/26777
Reviewed-by: Barthes, FabienX <fabienx.barthes@intel.com>
Diffstat (limited to 'parameter/BitParameterType.cpp')
-rw-r--r-- | parameter/BitParameterType.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parameter/BitParameterType.cpp b/parameter/BitParameterType.cpp index d4833e3..31d1d77 100644 --- a/parameter/BitParameterType.cpp +++ b/parameter/BitParameterType.cpp @@ -72,10 +72,10 @@ bool CBitParameterType::fromXml(const CXmlElement& xmlElement, CXmlSerializingCo // Size _uiBitSize = xmlElement.getAttributeInteger("Size"); - // TODO: Validate bit pos and size still fit into parent type + // Validate bit pos and size still fit into parent type const CBitParameterBlockType* pBitParameterBlockType = static_cast<const CBitParameterBlockType*>(getParent()); - uint32_t uiParentBlockBitSize = pBitParameterBlockType->getSize() << 3; + uint32_t uiParentBlockBitSize = pBitParameterBlockType->getSize() * 8; if (_uiBitPos + _uiBitSize > uiParentBlockBitSize) { @@ -173,7 +173,7 @@ uint32_t CBitParameterType::getMask() const // Check data has no bit set outside available range bool CBitParameterType::isEncodable(uint32_t uiData) const { - uint32_t uiShift = 32 - _uiBitSize; + uint32_t uiShift = 8 * sizeof(uiData) - _uiBitSize; if (uiShift) { |