From 00e3f756e001bd65cb8dc0ea0685fb069d7a89d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Poncabar=C3=A9?= Date: Fri, 4 Mar 2016 13:09:10 +0100 Subject: [PATCH 1/3] Formatting namespaces with clang-tidy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using : -checks=llvm-namespace-comment Signed-off-by: Florian PoncabarĂ© --- bindings/c/ParameterFramework.cpp | 2 +- parameter/Element.h | 2 +- parameter/LoggingElementBuilderTemplate.cpp | 2 +- parameter/LoggingElementBuilderTemplate.h | 2 +- parameter/Results.h | 2 +- parameter/log/include/log/Context.h | 4 ++-- parameter/log/include/log/ILogger.h | 4 ++-- parameter/log/include/log/LogWrapper.h | 6 +++--- parameter/log/include/log/Logger.h | 4 ++-- test/functional-tests/AutoSync.cpp | 2 +- test/functional-tests/Basic.cpp | 2 +- test/functional-tests/FloatingPoint.cpp | 2 +- test/functional-tests/include/Config.hpp | 2 +- test/functional-tests/include/ConfigFiles.hpp | 2 +- test/functional-tests/include/ElementHandle.hpp | 2 +- test/functional-tests/include/Exception.hpp | 2 +- test/functional-tests/include/FailureWrapper.hpp | 2 +- test/functional-tests/include/ParameterFramework.hpp | 2 +- test/functional-tests/include/StoreLogger.hpp | 2 +- test/functional-tests/include/Test.hpp | 2 +- test/introspection-subsystem/IntrospectionEntryPoint.cpp | 4 ++-- test/introspection-subsystem/IntrospectionSubsystem.cpp | 4 ++-- test/introspection-subsystem/IntrospectionSubsystem.h | 4 ++-- .../IntrospectionSubsystemObject.cpp | 4 ++-- test/introspection-subsystem/IntrospectionSubsystemObject.h | 4 ++-- .../include/IntrospectionEntryPoint.h | 4 ++-- test/tmpfile/TmpFile.hpp | 4 ++-- test/tmpfile/posix/TmpFile.cpp | 4 ++-- utility/Utility.h | 2 +- 29 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bindings/c/ParameterFramework.cpp b/bindings/c/ParameterFramework.cpp index 53f7a665b..cab2138cf 100644 --- a/bindings/c/ParameterFramework.cpp +++ b/bindings/c/ParameterFramework.cpp @@ -50,7 +50,7 @@ namespace pfw typedef ISelectionCriterionInterface Criterion; typedef std::map Criteria; typedef CParameterMgrPlatformConnector Pfw; -} +} // namespace pfw /** Class to abstract the boolean+string status api. */ class Status diff --git a/parameter/Element.h b/parameter/Element.h index 11d41b537..7d2d8422c 100644 --- a/parameter/Element.h +++ b/parameter/Element.h @@ -43,7 +43,7 @@ class CXmlElementSerializingContext; namespace utility { class ErrorContext; -} +} // namespace utility class PARAMETER_EXPORT CElement : public IXmlSink, public IXmlSource { diff --git a/parameter/LoggingElementBuilderTemplate.cpp b/parameter/LoggingElementBuilderTemplate.cpp index 8c87a47d2..b640c9317 100644 --- a/parameter/LoggingElementBuilderTemplate.cpp +++ b/parameter/LoggingElementBuilderTemplate.cpp @@ -37,4 +37,4 @@ std::string getName(const CXmlElement &xmlElement) { return xmlElement.getNameAttribute(); } -} +} // namespace details diff --git a/parameter/LoggingElementBuilderTemplate.h b/parameter/LoggingElementBuilderTemplate.h index 1bfff0633..1195297a4 100644 --- a/parameter/LoggingElementBuilderTemplate.h +++ b/parameter/LoggingElementBuilderTemplate.h @@ -58,7 +58,7 @@ namespace details * */ std::string PARAMETER_EXPORT getName(const CXmlElement &xmlElement); -} +} // namespace details /** * Builder for elements which need logger at construction diff --git a/parameter/Results.h b/parameter/Results.h index 3f7a13ca8..d0dbaae5c 100644 --- a/parameter/Results.h +++ b/parameter/Results.h @@ -38,4 +38,4 @@ namespace core /** String list type which can hold list of error/info */ typedef std::list Results; -} /** core namespace */ +} // namespace core diff --git a/parameter/log/include/log/Context.h b/parameter/log/include/log/Context.h index a3d5fd4b8..b03f9cab1 100644 --- a/parameter/log/include/log/Context.h +++ b/parameter/log/include/log/Context.h @@ -68,5 +68,5 @@ class Context Logger &mLogger; }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/parameter/log/include/log/ILogger.h b/parameter/log/include/log/ILogger.h index 9b72813c8..c405f5e68 100644 --- a/parameter/log/include/log/ILogger.h +++ b/parameter/log/include/log/ILogger.h @@ -47,5 +47,5 @@ class ILogger virtual ~ILogger() {} }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/parameter/log/include/log/LogWrapper.h b/parameter/log/include/log/LogWrapper.h index 14624e463..822687600 100644 --- a/parameter/log/include/log/LogWrapper.h +++ b/parameter/log/include/log/LogWrapper.h @@ -131,6 +131,6 @@ typedef details::LogWrapper Info; /** Default warning logger type */ typedef details::LogWrapper Warning; -} /** details namespace */ -} /** log namespace */ -} /** core namespace */ +} // namespace details +} // namespace log +} // namespace core diff --git a/parameter/log/include/log/Logger.h b/parameter/log/include/log/Logger.h index b224d354f..ea16f4ea7 100644 --- a/parameter/log/include/log/Logger.h +++ b/parameter/log/include/log/Logger.h @@ -76,5 +76,5 @@ class Logger : private utility::NonCopyable std::string mProlog; }; -} /** log namespace */ -} /** core namespace */ +} // namespace log +} // namespace core diff --git a/test/functional-tests/AutoSync.cpp b/test/functional-tests/AutoSync.cpp index 9353b8d0f..d23c0f741 100644 --- a/test/functional-tests/AutoSync.cpp +++ b/test/functional-tests/AutoSync.cpp @@ -130,4 +130,4 @@ SCENARIO_METHOD(BoolPF, "Auto sync") } } } -} +} // namespace parameterFramework diff --git a/test/functional-tests/Basic.cpp b/test/functional-tests/Basic.cpp index 60e6bbc8f..b41446053 100644 --- a/test/functional-tests/Basic.cpp +++ b/test/functional-tests/Basic.cpp @@ -178,4 +178,4 @@ SCENARIO_METHOD(ParameterFramework, "Raw value space") } } -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/FloatingPoint.cpp b/test/functional-tests/FloatingPoint.cpp index fd41797f1..5581cd49a 100644 --- a/test/functional-tests/FloatingPoint.cpp +++ b/test/functional-tests/FloatingPoint.cpp @@ -176,4 +176,4 @@ SCENARIO_METHOD(FloatsPF, "Floating points", "[floating points]") } } } -} +} // namespace parameterFramework diff --git a/test/functional-tests/include/Config.hpp b/test/functional-tests/include/Config.hpp index 3d3f117bf..3f8029085 100644 --- a/test/functional-tests/include/Config.hpp +++ b/test/functional-tests/include/Config.hpp @@ -79,4 +79,4 @@ struct Config std::string subsystemType = "Virtual"; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/ConfigFiles.hpp b/test/functional-tests/include/ConfigFiles.hpp index 3d14b860c..2aa7107f7 100644 --- a/test/functional-tests/include/ConfigFiles.hpp +++ b/test/functional-tests/include/ConfigFiles.hpp @@ -124,4 +124,4 @@ class ConfigFiles utility::TmpFile mConfigFile; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/ElementHandle.hpp b/test/functional-tests/include/ElementHandle.hpp index fe42b71ea..a2f547540 100644 --- a/test/functional-tests/include/ElementHandle.hpp +++ b/test/functional-tests/include/ElementHandle.hpp @@ -112,4 +112,4 @@ class ElementHandle : private FailureWrapper<::ElementHandle> void setAsBytes(const std::vector &settings) { mayFailSet(&EH::setAsBytes, settings); } }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/Exception.hpp b/test/functional-tests/include/Exception.hpp index 8ae05971c..d9e0658b8 100644 --- a/test/functional-tests/include/Exception.hpp +++ b/test/functional-tests/include/Exception.hpp @@ -41,4 +41,4 @@ struct Exception : std::runtime_error using std::runtime_error::runtime_error; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/FailureWrapper.hpp b/test/functional-tests/include/FailureWrapper.hpp index 753e1dcf1..41c643a3f 100644 --- a/test/functional-tests/include/FailureWrapper.hpp +++ b/test/functional-tests/include/FailureWrapper.hpp @@ -133,4 +133,4 @@ class FailureWrapper : protected Base return res; } }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/ParameterFramework.hpp b/test/functional-tests/include/ParameterFramework.hpp index f6f36a870..207733cc8 100644 --- a/test/functional-tests/include/ParameterFramework.hpp +++ b/test/functional-tests/include/ParameterFramework.hpp @@ -170,4 +170,4 @@ class ParameterFramework : private parameterFramework::ConfigFiles, friend class ElementHandle; }; -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/StoreLogger.hpp b/test/functional-tests/include/StoreLogger.hpp index 836415790..55fcc81cd 100644 --- a/test/functional-tests/include/StoreLogger.hpp +++ b/test/functional-tests/include/StoreLogger.hpp @@ -115,4 +115,4 @@ std::ostream &operator<<(std::ostream &os, const StoreLogger::Log &log) return os << log.level << log.msg << std::endl; } -} // parameterFramework +} // namespace parameterFramework diff --git a/test/functional-tests/include/Test.hpp b/test/functional-tests/include/Test.hpp index 51f397af8..bdc6ca7fa 100644 --- a/test/functional-tests/include/Test.hpp +++ b/test/functional-tests/include/Test.hpp @@ -128,4 +128,4 @@ struct WarningPF : public ParameterFramework setFailureOnFailedSettingsLoad(false); } }; -} +} // namespace parameterFramework diff --git a/test/introspection-subsystem/IntrospectionEntryPoint.cpp b/test/introspection-subsystem/IntrospectionEntryPoint.cpp index b26e938d2..b5028be87 100644 --- a/test/introspection-subsystem/IntrospectionEntryPoint.cpp +++ b/test/introspection-subsystem/IntrospectionEntryPoint.cpp @@ -40,5 +40,5 @@ bool getParameterValue() { return SubsystemObject::getSingletonInstanceValue(); } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/introspection-subsystem/IntrospectionSubsystem.cpp b/test/introspection-subsystem/IntrospectionSubsystem.cpp index 7c3e945fa..450e05252 100644 --- a/test/introspection-subsystem/IntrospectionSubsystem.cpp +++ b/test/introspection-subsystem/IntrospectionSubsystem.cpp @@ -41,5 +41,5 @@ Subsystem::Subsystem(const std::string &name, core::log::Logger &logger) : base( { addSubsystemObjectFactory(new TSubsystemObjectFactory("Object", 0)); } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/introspection-subsystem/IntrospectionSubsystem.h b/test/introspection-subsystem/IntrospectionSubsystem.h index 1f89841eb..76abd264e 100644 --- a/test/introspection-subsystem/IntrospectionSubsystem.h +++ b/test/introspection-subsystem/IntrospectionSubsystem.h @@ -46,5 +46,5 @@ class Subsystem : public CSubsystem private: using base = CSubsystem; }; -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/introspection-subsystem/IntrospectionSubsystemObject.cpp b/test/introspection-subsystem/IntrospectionSubsystemObject.cpp index 2a05981f4..3e5ea378f 100644 --- a/test/introspection-subsystem/IntrospectionSubsystemObject.cpp +++ b/test/introspection-subsystem/IntrospectionSubsystemObject.cpp @@ -79,5 +79,5 @@ bool SubsystemObject::receiveFromHW(std::string & /*error*/) blackboardRead(&mParameter, parameterSize); return true; } -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/introspection-subsystem/IntrospectionSubsystemObject.h b/test/introspection-subsystem/IntrospectionSubsystemObject.h index f91f6864a..ab21cb937 100644 --- a/test/introspection-subsystem/IntrospectionSubsystemObject.h +++ b/test/introspection-subsystem/IntrospectionSubsystemObject.h @@ -85,5 +85,5 @@ class SubsystemObject final : public CSubsystemObject bool mParameter; }; -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/introspection-subsystem/include/IntrospectionEntryPoint.h b/test/introspection-subsystem/include/IntrospectionEntryPoint.h index ce3e22ca5..b7feea9e6 100644 --- a/test/introspection-subsystem/include/IntrospectionEntryPoint.h +++ b/test/introspection-subsystem/include/IntrospectionEntryPoint.h @@ -37,5 +37,5 @@ namespace introspectionSubsystem { INTROSPECTION_SUBSYSTEM_EXPORT bool getParameterValue(); -} -} +} // namespace introspectionSubsystem +} // namespace parameterFramework diff --git a/test/tmpfile/TmpFile.hpp b/test/tmpfile/TmpFile.hpp index ebefa93bf..edde7f216 100644 --- a/test/tmpfile/TmpFile.hpp +++ b/test/tmpfile/TmpFile.hpp @@ -102,5 +102,5 @@ class TmpFile std::string mPath; }; -} // utility -} // parameterFramework +} // namespace utility +} // namespace parameterFramework diff --git a/test/tmpfile/posix/TmpFile.cpp b/test/tmpfile/posix/TmpFile.cpp index 36efbd656..5968cde45 100644 --- a/test/tmpfile/posix/TmpFile.cpp +++ b/test/tmpfile/posix/TmpFile.cpp @@ -53,5 +53,5 @@ std::string TmpFile::mktmp() return path; } -} // utility -} // parameterFramework +} // namespace utility +} // namespace parameterFramework diff --git a/utility/Utility.h b/utility/Utility.h index c32095a02..8a3d5b74f 100644 --- a/utility/Utility.h +++ b/utility/Utility.h @@ -99,4 +99,4 @@ void appendTitle(std::string &strTo, const std::string &strTitle); */ bool isHexadecimal(const std::string &strValue); -} // utility +} // namespace utility From ddb517301c4491239f7ee320b19b5881880ea850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Poncabar=C3=A9?= Date: Fri, 4 Mar 2016 14:08:22 +0100 Subject: [PATCH 2/3] Changing NULL to nullptr with clang-tidy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using : -checks=modernize-use-nullptr Signed-off-by: Florian PoncabarĂ© --- bindings/c/ParameterFramework.cpp | 40 +++++++-------- bindings/c/Test.cpp | 26 +++++----- parameter/BitParameterType.cpp | 2 +- parameter/ComponentType.cpp | 2 +- parameter/ConfigurableDomain.cpp | 24 ++++----- parameter/ConfigurableDomain.h | 2 +- parameter/ConfigurableDomains.cpp | 16 +++--- parameter/ConfigurableElement.cpp | 4 +- parameter/DefaultElementLibrary.h | 4 +- parameter/DomainConfiguration.cpp | 8 +-- parameter/DomainConfiguration.h | 2 +- parameter/Element.cpp | 14 +++--- parameter/ElementLibrary.cpp | 2 +- parameter/HardwareBackSynchronizer.cpp | 2 +- parameter/InstanceConfigurableElement.cpp | 2 +- parameter/InstanceDefinition.cpp | 2 +- parameter/MappingContext.cpp | 6 +-- parameter/ParameterMgr.cpp | 50 +++++++++---------- parameter/ParameterMgrPlatformConnector.cpp | 2 +- parameter/PathNavigator.cpp | 2 +- parameter/RuleParser.cpp | 4 +- parameter/Subsystem.cpp | 2 +- parameter/SyncerSet.cpp | 2 +- .../RemoteCommandHandlerTemplate.h | 4 +- test/test-platform/TestPlatform.cpp | 16 +++--- test/test-subsystem/TESTSubsystem.cpp | 4 +- utility/posix/DynamicLibrary.cpp | 4 +- xmlserializer/XmlDocSource.cpp | 18 +++---- xmlserializer/XmlDocSource.h | 2 +- xmlserializer/XmlElement.cpp | 10 ++-- xmlserializer/XmlMemoryDocSource.cpp | 2 +- xmlserializer/XmlSerializingContext.cpp | 4 +- xmlserializer/XmlStreamDocSink.cpp | 2 +- 33 files changed, 143 insertions(+), 143 deletions(-) diff --git a/bindings/c/ParameterFramework.cpp b/bindings/c/ParameterFramework.cpp index cab2138cf..acaea9224 100644 --- a/bindings/c/ParameterFramework.cpp +++ b/bindings/c/ParameterFramework.cpp @@ -110,7 +110,7 @@ static void defaultLogCb(void *, PfwLogLevel level, const char *logLine) }; } -static PfwLogger defaultLogger = {NULL, &defaultLogCb}; +static PfwLogger defaultLogger = {nullptr, &defaultLogCb}; class LogWrapper : public CParameterMgrPlatformConnector::ILogger { @@ -127,7 +127,7 @@ class LogWrapper : public CParameterMgrPlatformConnector::ILogger { // A LogWrapper should NOT be register to the pfw (thus log called) // if logCb is NULL. - assert(mLogger.logCb != NULL); + assert(mLogger.logCb != nullptr); mLogger.logCb(mLogger.userCtx, level, strLog.c_str()); } @@ -167,10 +167,10 @@ void pfwDestroy(PfwHandler *handle) void PfwHandler::setLogger(const PfwLogger *logger) { - if (logger != NULL and logger->logCb == NULL) { + if (logger != nullptr and logger->logCb == nullptr) { return; // There is no callback, do not log => do not add a logger } - mLogger = logger != NULL ? *logger : defaultLogger; + mLogger = logger != nullptr ? *logger : defaultLogger; pfw->setLogger(&mLogger); } @@ -180,10 +180,10 @@ bool PfwHandler::createCriteria(const PfwCriterion criteriaArray[], size_t crite // Add criteria for (size_t criterionIndex = 0; criterionIndex < criterionNb; ++criterionIndex) { const PfwCriterion &criterion = criteriaArray[criterionIndex]; - if (criterion.name == NULL) { + if (criterion.name == nullptr) { return status.failure("Criterion name is NULL"); } - if (criterion.values == NULL) { + if (criterion.values == nullptr) { return status.failure("Criterion values is NULL"); } // Check that the criterion does not exist @@ -194,9 +194,9 @@ bool PfwHandler::createCriteria(const PfwCriterion criteriaArray[], size_t crite // Create criterion type ISelectionCriterionTypeInterface *type = pfw->createSelectionCriterionType(criterion.inclusive); - assert(type != NULL); + assert(type != nullptr); // Add criterion values - for (size_t valueIndex = 0; criterion.values[valueIndex] != NULL; ++valueIndex) { + for (size_t valueIndex = 0; criterion.values[valueIndex] != nullptr; ++valueIndex) { int value; if (criterion.inclusive) { // Check that (int)1 << valueIndex would not overflow (UB) @@ -227,7 +227,7 @@ bool pfwStart(PfwHandler *handle, const char *configPath, const PfwCriterion cri // Check that the api is correctly used Status &status = handle->lastStatus; - if (handle->pfw != NULL) { + if (handle->pfw != nullptr) { return status.failure("Can not start an already started parameter framework"); } // Create a pfw @@ -250,18 +250,18 @@ const char *pfwGetLastError(const PfwHandler *handle) static pfw::Criterion *getCriterion(const pfw::Criteria &criteria, const string &name) { pfw::Criteria::const_iterator it = criteria.find(name); - return it == criteria.end() ? NULL : it->second; + return it == criteria.end() ? nullptr : it->second; } bool pfwSetCriterion(PfwHandler *handle, const char name[], int value) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not set criterion \"" + string(name) + "\" as the parameter framework is not started."); } pfw::Criterion *criterion = getCriterion(handle->criteria, name); - if (criterion == NULL) { + if (criterion == nullptr) { return status.failure("Can not set criterion " + string(name) + " as does not exist"); } criterion->setCriterionState(value); @@ -270,12 +270,12 @@ bool pfwSetCriterion(PfwHandler *handle, const char name[], int value) bool pfwGetCriterion(const PfwHandler *handle, const char name[], int *value) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not get criterion \"" + string(name) + "\" as the parameter framework is not started."); } pfw::Criterion *criterion = getCriterion(handle->criteria, name); - if (criterion == NULL) { + if (criterion == nullptr) { return status.failure("Can not get criterion " + string(name) + " as it does not exist"); } *value = criterion->getCriterionState(); @@ -285,7 +285,7 @@ bool pfwGetCriterion(const PfwHandler *handle, const char name[], int *value) bool pfwApplyConfigurations(const PfwHandler *handle) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { return status.failure("Can not commit criteria " "as the parameter framework is not started."); } @@ -306,17 +306,17 @@ struct PfwParameterHandler_ PfwParameterHandler *pfwBindParameter(PfwHandler *handle, const char path[]) { Status &status = handle->lastStatus; - if (handle->pfw == NULL) { + if (handle->pfw == nullptr) { status.failure("The parameter framework is not started, " "while trying to bind parameter \"" + string(path) + "\")"); - return NULL; + return nullptr; } CParameterHandle *paramHandle; paramHandle = handle->pfw->createParameterHandle(path, status.msg()); - if (paramHandle == NULL) { - return NULL; + if (paramHandle == nullptr) { + return nullptr; } status.success(); @@ -344,7 +344,7 @@ bool pfwSetIntParameter(PfwParameterHandler *handle, int32_t value) bool pfwGetStringParameter(const PfwParameterHandler *handle, char *value[]) { Status &status = handle->pfw.lastStatus; - *value = NULL; + *value = nullptr; string retValue; bool success = handle->parameter.getAsString(retValue, status.msg()); if (not success) { diff --git a/bindings/c/Test.cpp b/bindings/c/Test.cpp index 39f5df695..9d3b0384a 100644 --- a/bindings/c/Test.cpp +++ b/bindings/c/Test.cpp @@ -114,8 +114,8 @@ struct Test TEST_CASE_METHOD(Test, "Parameter-framework c api use") { // Create criteria - const char *letterList[] = {"a", "b", "c", NULL}; - const char *numberList[] = {"1", "2", "3", NULL}; + const char *letterList[] = {"a", "b", "c", nullptr}; + const char *numberList[] = {"1", "2", "3", nullptr}; const PfwCriterion criteria[] = { {"inclusiveCrit", true, letterList}, {"exclusiveCrit", false, numberList}, }; @@ -165,7 +165,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 2, &logger)); } WHEN ("The pfw is started with duplicated criterion value state") { - const char *values[] = {"a", "a", NULL}; + const char *values[] = {"a", "a", nullptr}; const PfwCriterion duplicatedCriteria[] = {{"name", true, values}}; WHEN ("Using test logger") { @@ -173,15 +173,15 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") } WHEN ("Using default logger") { // Test coverage of default logger warning - REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, NULL)); + REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, nullptr)); } } WHEN ("The pfw is started with NULL name criterion") { - const PfwCriterion duplicatedCriteria[] = {{NULL, true, letterList}}; + const PfwCriterion duplicatedCriteria[] = {{nullptr, true, letterList}}; REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } WHEN ("The pfw is started with NULL criterion state list") { - const PfwCriterion duplicatedCriteria[] = {{"name", true, NULL}}; + const PfwCriterion duplicatedCriteria[] = {{"name", true, nullptr}}; REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } GIVEN ("A criteria with lots of values") { @@ -192,7 +192,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") for (size_t i = 0; i < values.size(); ++i) { values[i] = &names[i]; } - values.back() = NULL; + values.back() = nullptr; /* The pfw c api requires criterion values to be a NULL terminated * array of string. Each string is a pointer to a NULL terminated * array of char. The pfw requires each string to be different @@ -225,7 +225,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_FAILURE(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } WHEN ("The pfw is started with max length criterion state list") { - values[values.size() - 2] = NULL; // Hide last value + values[values.size() - 2] = nullptr; // Hide last value REQUIRE_SUCCESS(pfwStart(pfw, config, duplicatedCriteria, 1, &logger)); } } @@ -240,11 +240,11 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") } WHEN ("The pfw is started without a logger callback") { - PfwLogger noLog = {NULL, NULL}; + PfwLogger noLog = {nullptr, nullptr}; REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, &noLog)); } WHEN ("The pfw is started with default logger") { - REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, NULL)); + REQUIRE_SUCCESS(pfwStart(pfw, config, criteria, criterionNb, nullptr)); } WHEN ("Get criterion of a stopped pfw") { @@ -311,12 +311,12 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") REQUIRE_SUCCESS(pfwApplyConfigurations(pfw)); } WHEN ("Bind a non existing parameter") { - REQUIRE_FAILURE(pfwBindParameter(pfw, "do/not/exist") != NULL); + REQUIRE_FAILURE(pfwBindParameter(pfw, "do/not/exist") != nullptr); } GIVEN ("An integer parameter handle") { PfwParameterHandler *param = pfwBindParameter(pfw, intParameterPath); - REQUIRE_SUCCESS(param != NULL); + REQUIRE_SUCCESS(param != nullptr); WHEN ("Set parameter out of range") { REQUIRE_FAILURE(pfwSetIntParameter(param, 101)); @@ -335,7 +335,7 @@ TEST_CASE_METHOD(Test, "Parameter-framework c api use") GIVEN ("An string parameter handle") { PfwParameterHandler *param = pfwBindParameter(pfw, stringParameterPath); - REQUIRE_SUCCESS(param != NULL); + REQUIRE_SUCCESS(param != nullptr); WHEN ("Set parameter out of range") { REQUIRE_FAILURE(pfwSetStringParameter(param, "ko_1234567")); diff --git a/parameter/BitParameterType.cpp b/parameter/BitParameterType.cpp index 5a5c35325..c4deaf43e 100644 --- a/parameter/BitParameterType.cpp +++ b/parameter/BitParameterType.cpp @@ -123,7 +123,7 @@ bool CBitParameterType::toBlackboard(const string &strValue, uint64_t &uiValue, CParameterAccessContext ¶meterAccessContext) const { // Get value - uint64_t uiConvertedValue = strtoull(strValue.c_str(), NULL, 0); + uint64_t uiConvertedValue = strtoull(strValue.c_str(), nullptr, 0); if (uiConvertedValue > _uiMax) { diff --git a/parameter/ComponentType.cpp b/parameter/ComponentType.cpp index 76fb21190..55cd96e51 100644 --- a/parameter/ComponentType.cpp +++ b/parameter/ComponentType.cpp @@ -129,5 +129,5 @@ CInstanceConfigurableElement *CComponentType::doInstantiate() const // Not supposed to be called directly (instantiation made through CComponentInstance object) assert(0); - return NULL; + return nullptr; } diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index 2a743072b..522388cb8 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -301,7 +301,7 @@ bool CConfigurableDomain::parseConfigurableElements(const CXmlElement &xmlElemen } // Add found element to domain core::Results infos; - if (!addConfigurableElement(pConfigurableElement, NULL, infos)) { + if (!addConfigurableElement(pConfigurableElement, nullptr, infos)) { strError = utility::asString(infos); serializingContext.setError(strError); @@ -439,7 +439,7 @@ CParameterBlackboard *CConfigurableDomain::findConfigurationBlackboard( strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } // Parse all configurable elements @@ -463,7 +463,7 @@ CParameterBlackboard *CConfigurableDomain::findConfigurationBlackboard( strError = "Element not associated to the Domain"; - return NULL; + return nullptr; } // Domain splitting @@ -535,7 +535,7 @@ const CDomainConfiguration *CConfigurableDomain::getPendingConfiguration() const } } - return NULL; + return nullptr; } // Configuration application if required @@ -551,7 +551,7 @@ void CConfigurableDomain::apply(CParameterBlackboard *pParameterBlackboard, CSyn if (bForce) { // Force a configuration restore by forgetting about last applied configuration - _pLastAppliedConfiguration = NULL; + _pLastAppliedConfiguration = nullptr; } const CDomainConfiguration *pApplicableDomainConfiguration = findApplicableDomainConfiguration(); @@ -569,7 +569,7 @@ void CConfigurableDomain::apply(CParameterBlackboard *pParameterBlackboard, CSyn bool bSync = !pSyncerSet && _bSequenceAware; // Do the restore - pApplicableDomainConfiguration->restore(pParameterBlackboard, bSync, NULL); + pApplicableDomainConfiguration->restore(pParameterBlackboard, bSync, nullptr); // Record last applied configuration _pLastAppliedConfiguration = pApplicableDomainConfiguration; @@ -672,7 +672,7 @@ bool CConfigurableDomain::deleteConfiguration(const string &strName, string &str if (pDomainConfiguration == _pLastAppliedConfiguration) { // Forget about it - _pLastAppliedConfiguration = NULL; + _pLastAppliedConfiguration = nullptr; } // Hierarchy @@ -719,7 +719,7 @@ bool CConfigurableDomain::restoreConfiguration(const string &configurationName, const CDomainConfiguration *configuration = findConfiguration(configurationName, error); - if (configuration == NULL) { + if (configuration == nullptr) { errors.push_back(error); return false; @@ -994,7 +994,7 @@ const CDomainConfiguration *CConfigurableDomain::findValidDomainConfiguration( return pDomainConfiguration; } } - return NULL; + return nullptr; } // Search for an applicable configuration @@ -1012,7 +1012,7 @@ const CDomainConfiguration *CConfigurableDomain::findApplicableDomainConfigurati return pDomainConfiguration; } } - return NULL; + return nullptr; } // Gather set of configurable elements @@ -1202,7 +1202,7 @@ CDomainConfiguration *CConfigurableDomain::findConfiguration(const string &strCo strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } return pDomainConfiguration; } @@ -1217,7 +1217,7 @@ const CDomainConfiguration *CConfigurableDomain::findConfiguration(const string strError = "Domain configuration " + strConfiguration + " not found"; - return NULL; + return nullptr; } return pDomainConfiguration; } diff --git a/parameter/ConfigurableDomain.h b/parameter/ConfigurableDomain.h index 256e602e3..9731890a5 100644 --- a/parameter/ConfigurableDomain.h +++ b/parameter/ConfigurableDomain.h @@ -218,7 +218,7 @@ class CConfigurableDomain : public CElement * element are validated. */ void doAddConfigurableElement(CConfigurableElement *pConfigurableElement, core::Results &infos, - const CParameterBlackboard *pMainBlackboard = NULL); + const CParameterBlackboard *pMainBlackboard = nullptr); void doRemoveConfigurableElement(CConfigurableElement *pConfigurableElement, bool bRecomputeSyncSet); diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp index 7c5108381..35674fd59 100644 --- a/parameter/ConfigurableDomains.cpp +++ b/parameter/ConfigurableDomains.cpp @@ -84,7 +84,7 @@ void CConfigurableDomains::apply(CParameterBlackboard *pParameterBlackboard, CSy } } // Synchronize those collected syncers - syncerSet.sync(*pParameterBlackboard, false, NULL); + syncerSet.sync(*pParameterBlackboard, false, nullptr); // Then deal with domains that need to synchronize along apply for (size_t child = 0; child < uiNbConfigurableDomains; child++) { @@ -94,7 +94,7 @@ void CConfigurableDomains::apply(CParameterBlackboard *pParameterBlackboard, CSy std::string info; // Apply and synchronize when relevant - pChildConfigurableDomain->apply(pParameterBlackboard, NULL, bForce, info); + pChildConfigurableDomain->apply(pParameterBlackboard, nullptr, bForce, info); if (!info.empty()) { infos.push_back(info); } @@ -304,7 +304,7 @@ bool CConfigurableDomains::split(const string &domainName, CConfigurableElement std::string error; CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { infos.push_back(error); return false; @@ -411,7 +411,7 @@ bool CConfigurableDomains::restoreConfiguration(const string &domainName, // Find domain const CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { errors.push_back(error); return false; @@ -541,7 +541,7 @@ bool CConfigurableDomains::addConfigurableElementToDomain( std::string error; CConfigurableDomain *domain = findConfigurableDomain(domainName, error); - if (domain == NULL) { + if (domain == nullptr) { infos.push_back(error); return false; @@ -574,7 +574,7 @@ CParameterBlackboard *CConfigurableDomains::findConfigurationBlackboard( if (!pConfigurableDomain) { - return NULL; + return nullptr; } // Check that element belongs to the domain @@ -583,7 +583,7 @@ CParameterBlackboard *CConfigurableDomains::findConfigurationBlackboard( strError = "Element \"" + pConfigurableElement->getPath() + "\" does not belong to domain \"" + strDomain + "\""; - return NULL; + return nullptr; } // Find Configuration Blackboard and Base Offset @@ -612,7 +612,7 @@ const CConfigurableDomain *CConfigurableDomains::findConfigurableDomain(const st strError = "Configurable domain " + strDomain + " not found"; - return NULL; + return nullptr; } return pConfigurableDomain; diff --git a/parameter/ConfigurableElement.cpp b/parameter/ConfigurableElement.cpp index 615d72b44..1aecf1117 100644 --- a/parameter/ConfigurableElement.cpp +++ b/parameter/ConfigurableElement.cpp @@ -378,7 +378,7 @@ ISyncer *CConfigurableElement::getSyncer() const return static_cast(pParent)->getSyncer(); } - return NULL; + return nullptr; } // Syncer set (me, ascendant or descendant ones) @@ -630,7 +630,7 @@ const CSubsystem *CConfigurableElement::getBelongingSubsystem() const // Stop at system class if (!pParent->getParent()) { - return NULL; + return nullptr; } return static_cast(pParent)->getBelongingSubsystem(); diff --git a/parameter/DefaultElementLibrary.h b/parameter/DefaultElementLibrary.h index 9223021f2..f77cf9bf0 100644 --- a/parameter/DefaultElementLibrary.h +++ b/parameter/DefaultElementLibrary.h @@ -81,14 +81,14 @@ CElement *CDefaultElementLibrary::createElement( { CElement *builtElement = CElementLibrary::createElement(xmlElement); - if (builtElement != NULL) { + if (builtElement != nullptr) { // The element was created, return it return builtElement; } if (_defaultBuilder == nullptr) { // The default builder mechanism is not enabled - return NULL; + return nullptr; } // Use the default builder diff --git a/parameter/DomainConfiguration.cpp b/parameter/DomainConfiguration.cpp index a272c1488..f5d7182fe 100644 --- a/parameter/DomainConfiguration.cpp +++ b/parameter/DomainConfiguration.cpp @@ -275,7 +275,7 @@ bool CDomainConfiguration::setApplicationRule( CRuleParser ruleParser(strApplicationRule, pSelectionCriteriaDefinition); // Attempt to parse it - if (!ruleParser.parse(NULL, strError)) { + if (!ruleParser.parse(nullptr, strError)) { return false; } @@ -288,7 +288,7 @@ bool CDomainConfiguration::setApplicationRule( void CDomainConfiguration::clearApplicationRule() { // Replace compound rule - setRule(NULL); + setRule(nullptr); } string CDomainConfiguration::getApplicationRule() const @@ -478,7 +478,7 @@ const CCompoundRule *CDomainConfiguration::getRule() const // Rule created return static_cast(getChild(ECompoundRule)); } - return NULL; + return nullptr; } CCompoundRule *CDomainConfiguration::getRule() @@ -487,7 +487,7 @@ CCompoundRule *CDomainConfiguration::getRule() // Rule created return static_cast(getChild(ECompoundRule)); } - return NULL; + return nullptr; } void CDomainConfiguration::setRule(CCompoundRule *pRule) diff --git a/parameter/DomainConfiguration.h b/parameter/DomainConfiguration.h index f45c155a9..cb21e3a31 100644 --- a/parameter/DomainConfiguration.h +++ b/parameter/DomainConfiguration.h @@ -92,7 +92,7 @@ class CDomainConfiguration : public CElement * @return true if success false otherwise */ bool restore(CParameterBlackboard *pMainBlackboard, bool bSync, - core::Results *errors = NULL) const; + core::Results *errors = nullptr) const; // Ensure validity for configurable element area configuration void validate(const CConfigurableElement *pConfigurableElement, diff --git a/parameter/Element.cpp b/parameter/Element.cpp index 77dfd9d33..831729948 100644 --- a/parameter/Element.cpp +++ b/parameter/Element.cpp @@ -308,7 +308,7 @@ CElement *CElement::createChild(const CXmlElement &childElement, elementSerializingContext.setError("Unable to create XML element " + childElement.getPath()); - return NULL; + return nullptr; } // Store created child! addChild(pChild); @@ -419,7 +419,7 @@ const CElement *CElement::findDescendant(CPathNavigator &pathNavigator) const if (!pChild) { - return NULL; + return nullptr; } return pChild->findDescendant(pathNavigator); @@ -438,7 +438,7 @@ CElement *CElement::findDescendant(CPathNavigator &pathNavigator) if (!pChild) { - return NULL; + return nullptr; } return pChild->findDescendant(pathNavigator); @@ -467,7 +467,7 @@ CElement *CElement::findChild(const string &strName) } } - return NULL; + return nullptr; } const CElement *CElement::findChild(const string &strName) const @@ -480,7 +480,7 @@ const CElement *CElement::findChild(const string &strName) const } } - return NULL; + return nullptr; } CElement *CElement::findChildOfKind(const string &strKind) @@ -493,7 +493,7 @@ CElement *CElement::findChildOfKind(const string &strKind) } } - return NULL; + return nullptr; } const CElement *CElement::findChildOfKind(const string &strKind) const @@ -506,7 +506,7 @@ const CElement *CElement::findChildOfKind(const string &strKind) const } } - return NULL; + return nullptr; } string CElement::getPath() const diff --git a/parameter/ElementLibrary.cpp b/parameter/ElementLibrary.cpp index bde9b9125..f9e6d5c20 100644 --- a/parameter/ElementLibrary.cpp +++ b/parameter/ElementLibrary.cpp @@ -54,7 +54,7 @@ CElement *CElementLibrary::createElement(const CXmlElement &xmlElement) const return it->second->createElement(xmlElement); } - return NULL; + return nullptr; } void CElementLibrary::addElementBuilder(const std::string &type, diff --git a/parameter/HardwareBackSynchronizer.cpp b/parameter/HardwareBackSynchronizer.cpp index dbc23eb69..c46e6dd1d 100644 --- a/parameter/HardwareBackSynchronizer.cpp +++ b/parameter/HardwareBackSynchronizer.cpp @@ -51,5 +51,5 @@ CHardwareBackSynchronizer::CHardwareBackSynchronizer( void CHardwareBackSynchronizer::sync() { // Perform back synchronization - _backSyncerSet.sync(*_pParameterBlackboard, true, NULL); + _backSyncerSet.sync(*_pParameterBlackboard, true, nullptr); } diff --git a/parameter/InstanceConfigurableElement.cpp b/parameter/InstanceConfigurableElement.cpp index f9afa20b8..25a7ec93a 100644 --- a/parameter/InstanceConfigurableElement.cpp +++ b/parameter/InstanceConfigurableElement.cpp @@ -145,7 +145,7 @@ void CInstanceConfigurableElement::setSyncer(ISyncer *pSyncer) void CInstanceConfigurableElement::unsetSyncer() { - _pSyncer = NULL; + _pSyncer = nullptr; } // Syncer diff --git a/parameter/InstanceDefinition.cpp b/parameter/InstanceDefinition.cpp index e461fa42d..12d5126a9 100644 --- a/parameter/InstanceDefinition.cpp +++ b/parameter/InstanceDefinition.cpp @@ -47,7 +47,7 @@ CInstanceConfigurableElement *CInstanceDefinition::doInstantiate() const // Element not supposed to be instantiated direcly assert(0); - return NULL; + return nullptr; } void CInstanceDefinition::createInstances(CElement *pFatherElement) diff --git a/parameter/MappingContext.cpp b/parameter/MappingContext.cpp index 1235e3118..3599296cc 100644 --- a/parameter/MappingContext.cpp +++ b/parameter/MappingContext.cpp @@ -63,15 +63,15 @@ size_t CMappingContext::getItemAsInteger(size_t itemType) const return 0; } - return strtoul(mItems[itemType].strItem->c_str(), NULL, 0); + return strtoul(mItems[itemType].strItem->c_str(), nullptr, 0); } const string *CMappingContext::getItem(const string &strKey) const { auto itemFound = find_if(begin(mItems), end(mItems), [&](const SItem &item) { - return item.strKey != NULL && strKey == *item.strKey; + return item.strKey != nullptr && strKey == *item.strKey; }); - return (itemFound != end(mItems)) ? itemFound->strKey : NULL; + return (itemFound != end(mItems)) ? itemFound->strKey : nullptr; } bool CMappingContext::iSet(size_t itemType) const diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index f45056325..21a6507a2 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -433,7 +433,7 @@ bool CParameterMgr::loadFrameworkConfiguration(string &strError) _xmlDoc *doc = CXmlDocSource::mkXmlDoc(_xmlConfigurationUri, true, true, elementSerializingContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -517,7 +517,7 @@ bool CParameterMgr::loadStructure(string &strError) LOG_CONTEXT("Importing system structure from file " + structureUri); _xmlDoc *doc = CXmlDocSource::mkXmlDoc(structureUri, true, true, parameterBuildContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -608,7 +608,7 @@ bool CParameterMgr::loadSettingsFromConfigFile(string &strError) _xmlDoc *doc = CXmlDocSource::mkXmlDoc(configurationDomainsUri, true, true, xmlDomainImportContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -702,7 +702,7 @@ const CConfigurableElement *CParameterMgr::getConfigurableElement(const string & // Nagivate through system class if (!pathNavigator.navigateThrough(getConstSystemClass()->getName(), strError)) { - return NULL; + return nullptr; } // Find element @@ -712,7 +712,7 @@ const CConfigurableElement *CParameterMgr::getConfigurableElement(const string & strError = "Path not found: " + strPath; - return NULL; + return nullptr; } // Check found element is a parameter @@ -739,7 +739,7 @@ CParameterHandle *CParameterMgr::createParameterHandle(const string &strPath, st // Element not found strError = "Element not found: " + strPath; - return NULL; + return nullptr; } if (!pConfigurableElement->isParameter()) { @@ -747,7 +747,7 @@ CParameterHandle *CParameterMgr::createParameterHandle(const string &strPath, st // Element is not parameter strError = "Not a parameter: " + strPath; - return NULL; + return nullptr; } // Convert as parameter and return new handle @@ -1355,7 +1355,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listElementsCommand { CElementLocator elementLocator(getSystemClass(), false); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1382,7 +1382,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listParametersComma { CElementLocator elementLocator(getSystemClass(), false); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1408,7 +1408,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementStructure { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1432,7 +1432,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementBytesComm { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1479,7 +1479,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setElementBytesComm // Retrieve configurable element CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1622,7 +1622,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::dumpElementCommandP { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1645,7 +1645,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getElementSizeComma { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1667,7 +1667,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::showPropertiesComma { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1715,7 +1715,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listBelongingDomain { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -1737,7 +1737,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listAssociatedDomai { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(remoteCommand.getArgument(0), &pLocatedElement, strResult)) { @@ -2012,7 +2012,7 @@ bool CParameterMgr::accessConfigurationValue(const string &strDomain, { CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strPath, &pLocatedElement, strError)) { @@ -2028,7 +2028,7 @@ bool CParameterMgr::accessConfigurationValue(const string &strDomain, size_t baseOffset; bool bIsLastApplied; - CParameterBlackboard *pConfigurationBlackboard = NULL; + CParameterBlackboard *pConfigurationBlackboard = nullptr; { pConfigurationBlackboard = getConstConfigurableDomains()->findConfigurationBlackboard( @@ -2400,7 +2400,7 @@ bool CParameterMgr::addConfigurableElementToDomain(const string &strDomain, CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2443,7 +2443,7 @@ bool CParameterMgr::removeConfigurableElementFromDomain(const string &strDomain, CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2475,7 +2475,7 @@ bool CParameterMgr::split(const string &strDomain, const string &strConfigurable CElementLocator elementLocator(getSystemClass()); - CElement *pLocatedElement = NULL; + CElement *pLocatedElement = nullptr; if (!elementLocator.locate(strConfigurableElementPath, &pLocatedElement, strError)) { @@ -2603,7 +2603,7 @@ bool CParameterMgr::wrapLegacyXmlImport(const string &xmlSource, bool fromFile, // It doesn't make sense to resolve XIncludes on an imported file because // we can't reliably decide of a "base url" _xmlDoc *doc = CXmlDocSource::mkXmlDoc(xmlSource, fromFile, false, xmlDomainImportContext); - if (doc == NULL) { + if (doc == nullptr) { return false; } @@ -2654,7 +2654,7 @@ bool CParameterMgr::exportSingleDomainXml(string &xmlDest, const string &domainN const CConfigurableDomain *requestedDomain = getConstConfigurableDomains()->findConfigurableDomain(domainName, errorMsg); - if (requestedDomain == NULL) { + if (requestedDomain == nullptr) { return false; } @@ -2863,7 +2863,7 @@ bool CParameterMgr::handleRemoteProcessingInterface(string &strError) return false; } - if (_pRemoteProcessorServer == NULL) { + if (_pRemoteProcessorServer == nullptr) { strError = "ParameterMgr: Unable to create Remote Processor Server"; return false; } diff --git a/parameter/ParameterMgrPlatformConnector.cpp b/parameter/ParameterMgrPlatformConnector.cpp index 8eff7c98a..c69d76eb0 100644 --- a/parameter/ParameterMgrPlatformConnector.cpp +++ b/parameter/ParameterMgrPlatformConnector.cpp @@ -39,7 +39,7 @@ CParameterMgrPlatformConnector::CParameterMgrPlatformConnector( const string &strConfigurationFilePath) : _pParameterMgrLogger(new CParameterMgrLogger(*this)), _pParameterMgr(new CParameterMgr(strConfigurationFilePath, *_pParameterMgrLogger)), - _bStarted(false), _pLogger(NULL) + _bStarted(false), _pLogger(nullptr) { } diff --git a/parameter/PathNavigator.cpp b/parameter/PathNavigator.cpp index 36deaea21..22cf19aef 100644 --- a/parameter/PathNavigator.cpp +++ b/parameter/PathNavigator.cpp @@ -87,7 +87,7 @@ std::string *CPathNavigator::next() return &_astrItems[_currentIndex++]; } - return NULL; + return nullptr; } std::string CPathNavigator::getCurrentPath() const diff --git a/parameter/RuleParser.cpp b/parameter/RuleParser.cpp index 72424d28b..b8fd81df5 100644 --- a/parameter/RuleParser.cpp +++ b/parameter/RuleParser.cpp @@ -114,7 +114,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) return false; } - ALWAYS_ASSERT(pParentRule != NULL, "Invalid parent rule given to rule parser"); + ALWAYS_ASSERT(pParentRule != nullptr, "Invalid parent rule given to rule parser"); // Chain pParentRule->addChild(pCriterionRule); @@ -232,7 +232,7 @@ CCompoundRule *CRuleParser::grabRootRule() assert(pRootRule); - _pRootRule = NULL; + _pRootRule = nullptr; return pRootRule; } diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp index 43e633dd4..c422a88c8 100644 --- a/parameter/Subsystem.cpp +++ b/parameter/Subsystem.cpp @@ -252,7 +252,7 @@ string CSubsystem::getFormattedSubsystemMappingData( findSubsystemObjectFromConfigurableElement(pInstanceConfigurableElement); // Exit if node does not correspond to a SubsystemObject - if (pSubsystemObject == NULL) { + if (pSubsystemObject == nullptr) { return ""; } diff --git a/parameter/SyncerSet.cpp b/parameter/SyncerSet.cpp index c27245c83..b2c091330 100644 --- a/parameter/SyncerSet.cpp +++ b/parameter/SyncerSet.cpp @@ -68,7 +68,7 @@ bool CSyncerSet::sync(CParameterBlackboard ¶meterBlackboard, bool bBack, if (!pSyncer->sync(parameterBlackboard, bBack, strError)) { - if (errors != NULL) { + if (errors != nullptr) { errors->push_back(strError); } diff --git a/remote-processor/RemoteCommandHandlerTemplate.h b/remote-processor/RemoteCommandHandlerTemplate.h index db59a5b3f..631de7e83 100644 --- a/remote-processor/RemoteCommandHandlerTemplate.h +++ b/remote-processor/RemoteCommandHandlerTemplate.h @@ -116,7 +116,7 @@ class TRemoteCommandHandlerTemplate : public IRemoteCommandHandler : _pCommandParser(pCommandParser), _maxCommandUsageLength(0) { // Help Command - addCommandParser("help", NULL, 0, "", "Show commands description and usage"); + addCommandParser("help", nullptr, 0, "", "Show commands description and usage"); } ~TRemoteCommandHandlerTemplate() { @@ -216,7 +216,7 @@ class TRemoteCommandHandlerTemplate : public IRemoteCommandHandler return pRemoteCommandParserItem; } } - return NULL; + return nullptr; } private: diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index e0221310e..69715ea3d 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -156,9 +156,9 @@ CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterionFro CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion( const IRemoteCommand &remoteCommand, string &strResult) { - return createExclusiveSelectionCriterion(remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) + return createExclusiveSelectionCriterion( + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), nullptr, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } @@ -166,9 +166,9 @@ CTestPlatform::CommandReturn CTestPlatform::createExclusiveSelectionCriterion( CTestPlatform::CommandReturn CTestPlatform::createInclusiveSelectionCriterion( const IRemoteCommand &remoteCommand, string &strResult) { - return createInclusiveSelectionCriterion(remoteCommand.getArgument(0), - strtoul(remoteCommand.getArgument(1).c_str(), NULL, 0), - strResult) + return createInclusiveSelectionCriterion( + remoteCommand.getArgument(0), + strtoul(remoteCommand.getArgument(1).c_str(), nullptr, 0), strResult) ? CTestPlatform::CCommandHandler::EDone : CTestPlatform::CCommandHandler::EFailed; } @@ -258,7 +258,7 @@ bool CTestPlatform::createExclusiveSelectionCriterionFromStateList( ISelectionCriterionTypeInterface *pCriterionType = mParameterMgrPlatformConnector.createSelectionCriterionType(false); - assert(pCriterionType != NULL); + assert(pCriterionType != nullptr); size_t nbStates = remoteCommand.getArgumentCount() - 1; @@ -286,7 +286,7 @@ bool CTestPlatform::createInclusiveSelectionCriterionFromStateList( ISelectionCriterionTypeInterface *pCriterionType = mParameterMgrPlatformConnector.createSelectionCriterionType(true); - assert(pCriterionType != NULL); + assert(pCriterionType != nullptr); size_t nbStates = remoteCommand.getArgumentCount() - 1; diff --git a/test/test-subsystem/TESTSubsystem.cpp b/test/test-subsystem/TESTSubsystem.cpp index 473d92388..5a1f0e564 100644 --- a/test/test-subsystem/TESTSubsystem.cpp +++ b/test/test-subsystem/TESTSubsystem.cpp @@ -60,14 +60,14 @@ CTESTSubsystem::CTESTSubsystem(const std::string &strName, core::log::Logger &lo // Susbsystem sanity health bool CTESTSubsystem::isAlive() const { - assert(gacFwNamePropName != NULL); + assert(gacFwNamePropName != nullptr); return read(std::string(gacFwNamePropName) + "/isAlive") == "true"; } // Resynchronization after subsystem restart needed bool CTESTSubsystem::needResync(bool bClear) { - assert(gacFwNamePropName != NULL); + assert(gacFwNamePropName != nullptr); std::string strNeedResyncFile = std::string(gacFwNamePropName) + "/needResync"; bool bNeedResync; diff --git a/utility/posix/DynamicLibrary.cpp b/utility/posix/DynamicLibrary.cpp index 1a3af60e2..10b5e1706 100644 --- a/utility/posix/DynamicLibrary.cpp +++ b/utility/posix/DynamicLibrary.cpp @@ -44,7 +44,7 @@ DynamicLibrary::DynamicLibrary(const std::string &path) : _path(osSanitizePathNa if (_handle == nullptr) { const char *dlError = dlerror(); - throw std::runtime_error((dlError != NULL) ? dlError : "unknown dlopen error"); + throw std::runtime_error((dlError != nullptr) ? dlError : "unknown dlopen error"); } } @@ -60,7 +60,7 @@ void *DynamicLibrary::osGetSymbol(const std::string &symbol) const if (sym == nullptr) { const char *dlError = dlerror(); - throw std::runtime_error((dlError != NULL) ? dlError : "unknown dlsym error"); + throw std::runtime_error((dlError != nullptr) ? dlError : "unknown dlsym error"); } return sym; diff --git a/xmlserializer/XmlDocSource.cpp b/xmlserializer/XmlDocSource.cpp index ed366bf26..c4ec5fa02 100644 --- a/xmlserializer/XmlDocSource.cpp +++ b/xmlserializer/XmlDocSource.cpp @@ -61,7 +61,7 @@ CXmlDocSource::~CXmlDocSource() if (_pDoc) { // Free XML doc xmlFreeDoc(_pDoc); - _pDoc = NULL; + _pDoc = nullptr; } } @@ -110,7 +110,7 @@ _xmlDoc *CXmlDocSource::getDoc() const bool CXmlDocSource::isParsable() const { // Check that the doc has been created - return _pDoc != NULL; + return _pDoc != nullptr; } bool CXmlDocSource::populate(CXmlSerializingContext &serializingContext) @@ -167,7 +167,7 @@ bool CXmlDocSource::isInstanceDocumentValid() #ifdef LIBXML_SCHEMAS_ENABLED string schemaUri = getSchemaUri(); - xmlDocPtr pSchemaDoc = xmlReadFile(schemaUri.c_str(), NULL, XML_PARSE_NONET); + xmlDocPtr pSchemaDoc = xmlReadFile(schemaUri.c_str(), nullptr, XML_PARSE_NONET); if (!pSchemaDoc) { // Unable to load Schema @@ -233,28 +233,28 @@ std::string CXmlDocSource::mkUri(const std::string &base, const std::string &rel _xmlDoc *CXmlDocSource::mkXmlDoc(const string &source, bool fromFile, bool xincludes, CXmlSerializingContext &serializingContext) { - _xmlDoc *doc = NULL; + _xmlDoc *doc = nullptr; if (fromFile) { - doc = xmlReadFile(source.c_str(), NULL, 0); + doc = xmlReadFile(source.c_str(), nullptr, 0); } else { - doc = xmlReadMemory(source.c_str(), (int)source.size(), "", NULL, 0); + doc = xmlReadMemory(source.c_str(), (int)source.size(), "", nullptr, 0); } - if (doc == NULL) { + if (doc == nullptr) { string errorMsg = "libxml failed to read"; if (fromFile) { errorMsg += " \"" + source + "\""; } serializingContext.appendLineToError(errorMsg); - return NULL; + return nullptr; } if (xincludes and (xmlXIncludeProcess(doc) < 0)) { serializingContext.appendLineToError("libxml failed to resolve XIncludes"); xmlFreeDoc(doc); - doc = NULL; + doc = nullptr; } return doc; diff --git a/xmlserializer/XmlDocSource.h b/xmlserializer/XmlDocSource.h index 85b41144e..8093a275d 100644 --- a/xmlserializer/XmlDocSource.h +++ b/xmlserializer/XmlDocSource.h @@ -57,7 +57,7 @@ class CXmlDocSource : private utility::NonCopyable * @param[in] pRootNode a pointer to the root element of the document. * @param[in] bValidateWithSchema a boolean that toggles schema validation */ - CXmlDocSource(_xmlDoc *pDoc, bool bValidateWithSchema = false, _xmlNode *pRootNode = NULL); + CXmlDocSource(_xmlDoc *pDoc, bool bValidateWithSchema = false, _xmlNode *pRootNode = nullptr); /** * Constructor diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp index 902d0d966..5fac6d4a4 100644 --- a/xmlserializer/XmlElement.cpp +++ b/xmlserializer/XmlElement.cpp @@ -38,7 +38,7 @@ CXmlElement::CXmlElement(_xmlNode *pXmlElement) : _pXmlElement(pXmlElement) { } -CXmlElement::CXmlElement() : _pXmlElement(NULL) +CXmlElement::CXmlElement() : _pXmlElement(nullptr) { } @@ -73,7 +73,7 @@ string CXmlElement::getPath() const bool CXmlElement::hasAttribute(const string &strAttributeName) const { - return xmlHasProp(_pXmlElement, (const xmlChar *)strAttributeName.c_str()) != NULL; + return xmlHasProp(_pXmlElement, (const xmlChar *)strAttributeName.c_str()) != nullptr; } template <> @@ -85,7 +85,7 @@ bool CXmlElement::getAttribute(const string &name, string &value) c string backup = value; xmlChar *pucXmlValue = xmlGetProp((xmlNode *)_pXmlElement, (const xmlChar *)name.c_str()); - if (pucXmlValue == NULL) { + if (pucXmlValue == nullptr) { value = backup; return false; } @@ -124,7 +124,7 @@ string CXmlElement::getNameAttribute() const string CXmlElement::getTextContent() const { xmlChar *pucXmlContent = xmlNodeGetContent(_pXmlElement); - if (pucXmlContent == NULL) { + if (pucXmlContent == nullptr) { return ""; } @@ -234,7 +234,7 @@ void CXmlElement::setTextContent(const string &strContent) void CXmlElement::createChild(CXmlElement &childElement, const string &strType) { #ifdef LIBXML_TREE_ENABLED - xmlNodePtr pChildNode = xmlNewChild(_pXmlElement, NULL, BAD_CAST strType.c_str(), NULL); + xmlNodePtr pChildNode = xmlNewChild(_pXmlElement, nullptr, BAD_CAST strType.c_str(), nullptr); childElement.setXmlElement(pChildNode); #endif diff --git a/xmlserializer/XmlMemoryDocSource.cpp b/xmlserializer/XmlMemoryDocSource.cpp index 41b5ef23c..37e3551ab 100644 --- a/xmlserializer/XmlMemoryDocSource.cpp +++ b/xmlserializer/XmlMemoryDocSource.cpp @@ -39,7 +39,7 @@ CXmlMemoryDocSource::CXmlMemoryDocSource(const IXmlSource *pXmlSource, bool bVal const std::string &strProduct, const std::string &strVersion) : base(xmlNewDoc(BAD_CAST "1.0"), bValidateWithSchema, - xmlNewNode(NULL, BAD_CAST strRootElementType.c_str())), + xmlNewNode(nullptr, BAD_CAST strRootElementType.c_str())), _pXmlSource(pXmlSource), _strProduct(strProduct), _strVersion(strVersion) { init(); diff --git a/xmlserializer/XmlSerializingContext.cpp b/xmlserializer/XmlSerializingContext.cpp index 4666c5446..0b08bab8d 100644 --- a/xmlserializer/XmlSerializingContext.cpp +++ b/xmlserializer/XmlSerializingContext.cpp @@ -40,7 +40,7 @@ CXmlSerializingContext::CXmlSerializingContext(std::string &strError) CXmlSerializingContext::~CXmlSerializingContext() { // TODO: restore the previous handler - xmlSetStructuredErrorFunc(NULL, NULL); + xmlSetStructuredErrorFunc(nullptr, nullptr); prependToError(_strXmlError); } @@ -59,7 +59,7 @@ void CXmlSerializingContext::structuredErrorHandler(void *userData, xmlErrorPtr { CXmlSerializingContext *self = static_cast(userData); - std::string filename = (error->file != NULL) ? error->file : "(user input)"; + std::string filename = (error->file != nullptr) ? error->file : "(user input)"; // xmlErrorPtr->int2 contains the column; see xmlerror.h self->_strXmlError += filename + ":" + std::to_string(error->line) + ":" + std::to_string(error->int2) + ": " + error->message; diff --git a/xmlserializer/XmlStreamDocSink.cpp b/xmlserializer/XmlStreamDocSink.cpp index 4acd08984..0cb281e98 100644 --- a/xmlserializer/XmlStreamDocSink.cpp +++ b/xmlserializer/XmlStreamDocSink.cpp @@ -39,7 +39,7 @@ CXmlStreamDocSink::CXmlStreamDocSink(std::ostream &output) : _output(output) bool CXmlStreamDocSink::doProcess(CXmlDocSource &xmlDocSource, CXmlSerializingContext &serializingContext) { - xmlChar *dumpedDoc = NULL; + xmlChar *dumpedDoc = nullptr; int iSize; xmlDocDumpFormatMemoryEnc(xmlDocSource.getDoc(), &dumpedDoc, &iSize, "UTF-8", 1); From 3afc3893c6c0db5bbdc608ead02d454cd5a6a173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Poncabar=C3=A9?= Date: Fri, 4 Mar 2016 14:54:59 +0100 Subject: [PATCH 3/3] Use auto to improve readability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using : -checks=modernize-use-auto Signed-off-by: Florian PoncabarĂ© --- bindings/c/ParameterFramework.cpp | 2 +- parameter/ConfigurableDomain.cpp | 7 +++---- parameter/ElementLibrary.cpp | 2 +- parameter/MappingData.cpp | 2 +- parameter/ParameterMgr.cpp | 6 +++--- parameter/RuleParser.cpp | 4 ++-- parameter/SelectionCriteriaDefinition.cpp | 2 +- parameter/SelectionCriterionLibrary.cpp | 2 +- parameter/SelectionCriterionType.cpp | 2 +- parameter/SystemClass.cpp | 2 +- 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bindings/c/ParameterFramework.cpp b/bindings/c/ParameterFramework.cpp index acaea9224..858994b21 100644 --- a/bindings/c/ParameterFramework.cpp +++ b/bindings/c/ParameterFramework.cpp @@ -249,7 +249,7 @@ const char *pfwGetLastError(const PfwHandler *handle) static pfw::Criterion *getCriterion(const pfw::Criteria &criteria, const string &name) { - pfw::Criteria::const_iterator it = criteria.find(name); + auto it = criteria.find(name); return it == criteria.end() ? nullptr : it->second; } diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index 522388cb8..71bb3e88b 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -627,7 +627,7 @@ bool CConfigurableDomain::createConfiguration(const string &strName, } // Creation - CDomainConfiguration *pDomainConfiguration = new CDomainConfiguration(strName); + auto pDomainConfiguration = new CDomainConfiguration(strName); // Configurable elements association ConfigurableElementListIterator it; @@ -1106,7 +1106,7 @@ void CConfigurableDomain::doAddConfigurableElement(CConfigurableElement *pConfig pConfigurableElement->addAttachedConfigurableDomain(this); // Create associated syncer set - CSyncerSet *pSyncerSet = new CSyncerSet; + auto pSyncerSet = new CSyncerSet; // Add to sync set the configurable element one pConfigurableElement->fillSyncerSet(*pSyncerSet); @@ -1182,8 +1182,7 @@ void CConfigurableDomain::doRemoveConfigurableElement(CConfigurableElement *pCon CSyncerSet *CConfigurableDomain::getSyncerSet( const CConfigurableElement *pConfigurableElement) const { - ConfigurableElementToSyncerSetMapIterator mapIt = - _configurableElementToSyncerSetMap.find(pConfigurableElement); + auto mapIt = _configurableElementToSyncerSetMap.find(pConfigurableElement); ALWAYS_ASSERT(mapIt != _configurableElementToSyncerSetMap.end(), "Could not find syncer set for " << getName() << " configurable domain"); diff --git a/parameter/ElementLibrary.cpp b/parameter/ElementLibrary.cpp index f9e6d5c20..aaeaa0893 100644 --- a/parameter/ElementLibrary.cpp +++ b/parameter/ElementLibrary.cpp @@ -48,7 +48,7 @@ void CElementLibrary::clean() CElement *CElementLibrary::createElement(const CXmlElement &xmlElement) const { - ElementBuilderMapConstIterator it = _elementBuilderMap.find(getBuilderType(xmlElement)); + auto it = _elementBuilderMap.find(getBuilderType(xmlElement)); if (it != _elementBuilderMap.end()) { diff --git a/parameter/MappingData.cpp b/parameter/MappingData.cpp index cc341038b..3ea054e6e 100644 --- a/parameter/MappingData.cpp +++ b/parameter/MappingData.cpp @@ -73,7 +73,7 @@ bool CMappingData::init(const std::string &rawMapping, std::string &error) bool CMappingData::getValue(const std::string &strkey, const std::string *&pStrValue) const { - KeyToValueMapConstIterator it = _keyToValueMap.find(strkey); + auto it = _keyToValueMap.find(strkey); if (it != _keyToValueMap.end()) { diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 21a6507a2..d56277c03 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -2738,7 +2738,7 @@ CParameterBlackboard *CParameterMgr::getParameterBlackboard() void CParameterMgr::feedElementLibraries() { // Global Configuration handling - CElementLibrary *pFrameworkConfigurationLibrary = new CElementLibrary; + auto pFrameworkConfigurationLibrary = new CElementLibrary; pFrameworkConfigurationLibrary->addElementBuilder( "ParameterFrameworkConfiguration", @@ -2759,7 +2759,7 @@ void CParameterMgr::feedElementLibraries() _pElementLibrarySet->addElementLibrary(pFrameworkConfigurationLibrary); // Parameter creation - CElementLibrary *pParameterCreationLibrary = new CElementLibrary; + auto pParameterCreationLibrary = new CElementLibrary; pParameterCreationLibrary->addElementBuilder( "Subsystem", new CSubsystemElementBuilder(getSystemClass()->getSubsystemLibrary())); @@ -2798,7 +2798,7 @@ void CParameterMgr::feedElementLibraries() _pElementLibrarySet->addElementLibrary(pParameterCreationLibrary); // Parameter Configuration Domains creation - CElementLibrary *pParameterConfigurationLibrary = new CElementLibrary; + auto pParameterConfigurationLibrary = new CElementLibrary; pParameterConfigurationLibrary->addElementBuilder( "ConfigurableDomain", new TElementBuilderTemplate()); diff --git a/parameter/RuleParser.cpp b/parameter/RuleParser.cpp index b8fd81df5..e069cd111 100644 --- a/parameter/RuleParser.cpp +++ b/parameter/RuleParser.cpp @@ -70,7 +70,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) case EBeginCompoundRule: { // Create new compound rule - CCompoundRule *pCompoundRule = new CCompoundRule; + auto pCompoundRule = new CCompoundRule; // Parse if (!pCompoundRule->parse(*this, strError)) { @@ -104,7 +104,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError) break; case ECriterionRule: { // Create new criterion rule - CSelectionCriterionRule *pCriterionRule = new CSelectionCriterionRule; + auto pCriterionRule = new CSelectionCriterionRule; // Parse if (!pCriterionRule->parse(*this, strError)) { diff --git a/parameter/SelectionCriteriaDefinition.cpp b/parameter/SelectionCriteriaDefinition.cpp index 12f1aa231..dc8259cfb 100644 --- a/parameter/SelectionCriteriaDefinition.cpp +++ b/parameter/SelectionCriteriaDefinition.cpp @@ -39,7 +39,7 @@ std::string CSelectionCriteriaDefinition::getKind() const CSelectionCriterion *CSelectionCriteriaDefinition::createSelectionCriterion( const std::string &strName, const CSelectionCriterionType *pType, core::log::Logger &logger) { - CSelectionCriterion *pSelectionCriterion = new CSelectionCriterion(strName, pType, logger); + auto pSelectionCriterion = new CSelectionCriterion(strName, pType, logger); addChild(pSelectionCriterion); diff --git a/parameter/SelectionCriterionLibrary.cpp b/parameter/SelectionCriterionLibrary.cpp index fc9e9430e..09fda7c57 100644 --- a/parameter/SelectionCriterionLibrary.cpp +++ b/parameter/SelectionCriterionLibrary.cpp @@ -39,7 +39,7 @@ std::string CSelectionCriterionLibrary::getKind() const // Type creation CSelectionCriterionType *CSelectionCriterionLibrary::createSelectionCriterionType(bool bIsInclusive) { - CSelectionCriterionType *pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive); + auto pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive); addChild(pSelectionCriterionType); diff --git a/parameter/SelectionCriterionType.cpp b/parameter/SelectionCriterionType.cpp index 3354702a2..d97d18b89 100644 --- a/parameter/SelectionCriterionType.cpp +++ b/parameter/SelectionCriterionType.cpp @@ -118,7 +118,7 @@ bool CSelectionCriterionType::getNumericalValue(const std::string &strValue, int bool CSelectionCriterionType::getAtomicNumericalValue(const std::string &strValue, int &iValue) const { - NumToLitMapConstIt it = _numToLitMap.find(strValue); + auto it = _numToLitMap.find(strValue); if (it != _numToLitMap.end()) { diff --git a/parameter/SystemClass.cpp b/parameter/SystemClass.cpp index 21c7a86c8..ef2383b96 100644 --- a/parameter/SystemClass.cpp +++ b/parameter/SystemClass.cpp @@ -182,7 +182,7 @@ bool CSystemClass::loadPlugins(list &lstrPluginFiles, core::Results &err bool bAtLeastOneSubsystemPluginSuccessfullyLoaded = false; - list::iterator it = lstrPluginFiles.begin(); + auto it = lstrPluginFiles.begin(); while (it != lstrPluginFiles.end()) {