Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions bindings/python/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := _PyPfw

LOCAL_CPP_EXTENSION := .cxx
# As long as the parameter-framework is compiled with gcc, we must avoid
# compiling the bindings with clang and compile with gcc instead.
LOCAL_CLANG := false
# Android only provides a 32bit version of python.
LOCAL_32_BIT_ONLY := true

Expand All @@ -51,13 +48,11 @@ LOCAL_C_INCLUDES := \
prebuilts/python/linux-x86/2.7.5/include/python2.7 \
$(HOST_OUT_HEADERS)/parameter

# The 'unused-but-set-variable' warning must be disabled because SWIG generates
# files that do not respect that constraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
LOCAL_CFLAGS := -Wno-unused-but-set-variable -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK
LOCAL_CFLAGS := -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK

# Undefined symbols will be resolved at runtime
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
Expand Down
4 changes: 1 addition & 3 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ swig_link_libraries(PyPfw parameter ${PYTHON_LIBRARIES})
# ${CMAKE_CURRENT_BINARY_DIR}.
set_property(TARGET _PyPfw PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# The 'unused-but-set-variable' warning must be disabled because SWIG generates
# files that do not respect that contraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable -DSWIG_PYTHON_SILENT_MEMLEAK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSWIG_PYTHON_SILENT_MEMLEAK")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add -Wno-error and add a comment explaining that the code is generated by swig and thus can not be fixed even if warned.



# Find the python modules install path.
Expand Down
3 changes: 1 addition & 2 deletions parameter/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer libpfw_utility libxml2

LOCAL_REQUIRED_MODULES := libremote-processor

LOCAL_CLANG := false
include external/stlport/libstlport.mk
include $(BUILD_SHARED_LIBRARY)

Expand Down Expand Up @@ -186,7 +185,7 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer_host libpfw_utility_host libxml2

LOCAL_LDLIBS += -ldl

LOCAL_CLANG := false
#LOCAL_CLANG := false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code

include $(BUILD_HOST_SHARED_LIBRARY)

################################
Expand Down
4 changes: 2 additions & 2 deletions parameter/BitParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon
}

// Rely on integer access
uint64_t uiValue;
uint32_t uiValue;

if (bSet) {

Expand All @@ -108,7 +108,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon
}

// Integer Access
bool CBitParameter::accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const
bool CBitParameter::accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const
{
uint32_t uiOffset = getOffset();

Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CBitParameter : public CBaseParameter
virtual bool accessAsBoolean(bool& bValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;

// Integer Access
virtual bool accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;
virtual bool accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;

// AreaConfiguration creation
virtual CAreaConfiguration* createAreaConfiguration(const CSyncerSet* pSyncerSet) const;
Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameterType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool CBitParameterType::toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CP
return true;
}

void CBitParameterType::fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const
void CBitParameterType::fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const
{
(void)parameterAccessContext;

Expand Down
2 changes: 1 addition & 1 deletion parameter/BitParameterType.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CBitParameterType : public CTypeElement
void fromBlackboard(std::string& strValue, const uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const;
// Integer
bool toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const;
void fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const;
void fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const;
// Access from area configuration
uint64_t merge(uint64_t uiOriginData, uint64_t uiNewData) const;

Expand Down
2 changes: 1 addition & 1 deletion parameter/ConfigurableDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ void CConfigurableDomain::validate(const CParameterBlackboard* pMainBlackboard)
// Ensure validity on areas related to configurable element
void CConfigurableDomain::validateAreas(const CConfigurableElement* pConfigurableElement, const CParameterBlackboard* pMainBlackboard)
{
log_info("Validating domain \"" + getName() + "\" against main blackboard for configurable element \"" + pConfigurableElement->getPath() + "\"");
log_info("Validating domain \"%s\" against main blackboard for configurable element \"%s\"", getName().c_str(), pConfigurableElement->getPath().c_str());

// Propagate
size_t uiNbConfigurations = getNbChildren();
Expand Down
4 changes: 2 additions & 2 deletions parameter/ConfigurableDomains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool CConfigurableDomains::addDomain(CConfigurableDomain& domain, bool bOverwrit
deleteDomain(*pExistingDomain);
}

log_info("Adding configurable domain \"" + strDomainName + "\"");
log_info("Adding configurable domain \"%s\"", strDomainName.c_str());

addChild(&domain);

Expand All @@ -154,7 +154,7 @@ bool CConfigurableDomains::addDomain(CConfigurableDomain& domain, bool bOverwrit

void CConfigurableDomains::deleteDomain(CConfigurableDomain& configurableDomain)
{
log_info("Deleting configurable domain \"" + configurableDomain.getName() + "\"");
log_info("Deleting configurable domain \"%s\"", configurableDomain.getName().c_str() );

removeChild(&configurableDomain);

Expand Down
8 changes: 4 additions & 4 deletions parameter/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ CElement::~CElement()
}

// Logging
void CElement::log_info(const string& strMessage, ...) const
void CElement::log_info(const char* strMessage, ...) const
{
char *pacBuffer;
va_list listPointer;

va_start(listPointer, strMessage);

vasprintf(&pacBuffer, strMessage.c_str(), listPointer);
vasprintf(&pacBuffer, strMessage, listPointer);

va_end(listPointer);

Expand All @@ -67,14 +67,14 @@ void CElement::log_info(const string& strMessage, ...) const
free(pacBuffer);
}

void CElement::log_warning(const string& strMessage, ...) const
void CElement::log_warning(const char* strMessage, ...) const
{
char *pacBuffer;
va_list listPointer;

va_start(listPointer, strMessage);

vasprintf(&pacBuffer, strMessage.c_str(), listPointer);
vasprintf(&pacBuffer, strMessage, listPointer);

va_end(listPointer);

Expand Down
4 changes: 2 additions & 2 deletions parameter/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class CElement : public IXmlSink, public IXmlSource
virtual ~CElement();

// Logging
void log_info(const std::string& strMessage, ...) const;
void log_warning(const std::string& strMessage, ...) const;
void log_info(const char* strMessage, ...) const;
void log_warning(const char* strMessage, ...) const;
void log_table(bool bIsWarning, const std::list<std::string> lstrMessage) const;

// Description
Expand Down
4 changes: 2 additions & 2 deletions parameter/ParameterMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ bool CParameterMgr::loadStructure(string& strError)
// Retrieve system to load structure to
CSystemClass* pSystemClass = getSystemClass();

log_info("Loading " + pSystemClass->getName() + " system class structure");
log_info("Loading %s system class structure", pSystemClass->getName().c_str());

// Get structure description element
const CFrameworkConfigurationLocation* pStructureDescriptionFileLocation = static_cast<const CFrameworkConfigurationLocation*>(getConstFrameworkConfiguration()->findChildOfKind("StructureDescriptionFileLocation"));
Expand Down Expand Up @@ -592,7 +592,7 @@ bool CParameterMgr::loadSettings(string& strError)

if (!success && !_bFailOnFailedSettingsLoad) {
// Load can not fail, ie continue but log the load errors
log_info(strLoadError);
log_info("%s", strLoadError.c_str());
log_info("Failed to load settings, continue without domains.");
success = true;
}
Expand Down
18 changes: 13 additions & 5 deletions parameter/SubsystemObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool CSubsystemObject::sync(CParameterBlackboard& parameterBlackboard, bool bBac
strError = string("Unable to ") + (bBack ? "back" : "forward") + " synchronize configurable element " +
_pInstanceConfigurableElement->getPath() + ": " + strError;

log_warning(strError);
log_warning(strError.c_str());

// Fall back to parameter default initialization
if (bBack) {
Expand Down Expand Up @@ -213,14 +213,15 @@ void CSubsystemObject::blackboardWrite(const void* pvData, uint32_t uiSize)
}

// Logging
void CSubsystemObject::log_info(const string& strMessage, ...) const
void CSubsystemObject::log_info(const char* strMessage, ...) const
{
#if 1
char *pacBuffer;
va_list listPointer;

va_start(listPointer, strMessage);

vasprintf(&pacBuffer, strMessage.c_str(), listPointer);
vasprintf(&pacBuffer, strMessage, listPointer);

va_end(listPointer);

Expand All @@ -229,16 +230,20 @@ void CSubsystemObject::log_info(const string& strMessage, ...) const
}

free(pacBuffer);
#else
_pInstanceConfigurableElement->log_info(strMessage.c_str());
#endif
}

void CSubsystemObject::log_warning(const string& strMessage, ...) const
void CSubsystemObject::log_warning(const char* strMessage, ...) const
{
#if 1
char *pacBuffer;
va_list listPointer;

va_start(listPointer, strMessage);

vasprintf(&pacBuffer, strMessage.c_str(), listPointer);
vasprintf(&pacBuffer, strMessage, listPointer);

va_end(listPointer);

Expand All @@ -247,6 +252,9 @@ void CSubsystemObject::log_warning(const string& strMessage, ...) const
}

free(pacBuffer);
#else
_pInstanceConfigurableElement->log_warning(strMessage.c_str());
#endif
}

// Configurable element retrieval
Expand Down
4 changes: 2 additions & 2 deletions parameter/SubsystemObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class CSubsystemObject : private ISyncer
void blackboardRead(void* pvData, uint32_t uiSize);
void blackboardWrite(const void* pvData, uint32_t uiSize);
// Logging
void log_info(const std::string& strMessage, ...) const;
void log_warning(const std::string& strMessage, ...) const;
void log_info(const char* strMessage, ...) const;
void log_warning(const char* strMessage, ...) const;
// Belonging Subsystem retrieval
const CSubsystem* getSubsystem() const;

Expand Down