From 5901c1d3f448af5d0506d889b0543d9e0de0c2ce Mon Sep 17 00:00:00 2001 From: Guillaume Denneulin Date: Wed, 21 Dec 2011 15:02:18 +0100 Subject: PFW: Wrong file export in hexadecimal format BZ: 18097 For fixed point parameters, if the output raw format is hexadecimal, the settings were exported on 32 bits instead of their actual size (8, 16 bits...). Aligns also the way to deal with format on integer type Change-Id: Ifb25f4d6769bcc7c55de5654443a4862ef5a9e0f OLD-Change-Id: I5a9d695de98a7828af185b19e9943d4abf8bb805 Signed-off-by: Guillaume Denneulin Reviewed-on: http://android.intel.com:8080/29818 Reviewed-by: Barthes, FabienX Tested-by: Barthes, FabienX Reviewed-by: buildbot Tested-by: buildbot --- parameter/IntegerParameterType.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'parameter/IntegerParameterType.cpp') diff --git a/parameter/IntegerParameterType.cpp b/parameter/IntegerParameterType.cpp index 3455fd5..cdbb7a5 100644 --- a/parameter/IntegerParameterType.cpp +++ b/parameter/IntegerParameterType.cpp @@ -33,6 +33,7 @@ #include #include #include "ParameterAccessContext.h" +#include #define base CParameterType @@ -163,6 +164,9 @@ bool CIntegerParameterType::asInteger(const string& strValue, uint32_t& uiValue, void CIntegerParameterType::asString(const uint32_t& uiValue, string& strValue, CParameterAccessContext& parameterAccessContext) const { + // Check consistency + assert(isEncodable(uiValue)); + // Format ostringstream strStream; @@ -170,7 +174,7 @@ void CIntegerParameterType::asString(const uint32_t& uiValue, string& strValue, if (parameterAccessContext.valueSpaceIsRaw() && parameterAccessContext.outputRawFormatIsHex()) { // Hexa display with unecessary bits cleared out - strStream << "0x" << hex << uppercase << setw(getSize()*2) << setfill('0') << makeEncodable(uiValue); + strStream << "0x" << hex << uppercase << setw(getSize()*2) << setfill('0') << uiValue; } else { if (_bSigned) { -- cgit v1.1