Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 3afc389

Browse files
author
Florian Poncabaré
committed
Use auto to improve readability
Using : -checks=modernize-use-auto Signed-off-by: Florian Poncabaré <[email protected]>
1 parent ddb5173 commit 3afc389

10 files changed

+15
-16
lines changed

bindings/c/ParameterFramework.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const char *pfwGetLastError(const PfwHandler *handle)
249249

250250
static pfw::Criterion *getCriterion(const pfw::Criteria &criteria, const string &name)
251251
{
252-
pfw::Criteria::const_iterator it = criteria.find(name);
252+
auto it = criteria.find(name);
253253
return it == criteria.end() ? nullptr : it->second;
254254
}
255255

parameter/ConfigurableDomain.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ bool CConfigurableDomain::createConfiguration(const string &strName,
627627
}
628628

629629
// Creation
630-
CDomainConfiguration *pDomainConfiguration = new CDomainConfiguration(strName);
630+
auto pDomainConfiguration = new CDomainConfiguration(strName);
631631

632632
// Configurable elements association
633633
ConfigurableElementListIterator it;
@@ -1106,7 +1106,7 @@ void CConfigurableDomain::doAddConfigurableElement(CConfigurableElement *pConfig
11061106
pConfigurableElement->addAttachedConfigurableDomain(this);
11071107

11081108
// Create associated syncer set
1109-
CSyncerSet *pSyncerSet = new CSyncerSet;
1109+
auto pSyncerSet = new CSyncerSet;
11101110

11111111
// Add to sync set the configurable element one
11121112
pConfigurableElement->fillSyncerSet(*pSyncerSet);
@@ -1182,8 +1182,7 @@ void CConfigurableDomain::doRemoveConfigurableElement(CConfigurableElement *pCon
11821182
CSyncerSet *CConfigurableDomain::getSyncerSet(
11831183
const CConfigurableElement *pConfigurableElement) const
11841184
{
1185-
ConfigurableElementToSyncerSetMapIterator mapIt =
1186-
_configurableElementToSyncerSetMap.find(pConfigurableElement);
1185+
auto mapIt = _configurableElementToSyncerSetMap.find(pConfigurableElement);
11871186

11881187
ALWAYS_ASSERT(mapIt != _configurableElementToSyncerSetMap.end(),
11891188
"Could not find syncer set for " << getName() << " configurable domain");

parameter/ElementLibrary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void CElementLibrary::clean()
4848

4949
CElement *CElementLibrary::createElement(const CXmlElement &xmlElement) const
5050
{
51-
ElementBuilderMapConstIterator it = _elementBuilderMap.find(getBuilderType(xmlElement));
51+
auto it = _elementBuilderMap.find(getBuilderType(xmlElement));
5252

5353
if (it != _elementBuilderMap.end()) {
5454

parameter/MappingData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool CMappingData::init(const std::string &rawMapping, std::string &error)
7373

7474
bool CMappingData::getValue(const std::string &strkey, const std::string *&pStrValue) const
7575
{
76-
KeyToValueMapConstIterator it = _keyToValueMap.find(strkey);
76+
auto it = _keyToValueMap.find(strkey);
7777

7878
if (it != _keyToValueMap.end()) {
7979

parameter/ParameterMgr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,7 @@ CParameterBlackboard *CParameterMgr::getParameterBlackboard()
27382738
void CParameterMgr::feedElementLibraries()
27392739
{
27402740
// Global Configuration handling
2741-
CElementLibrary *pFrameworkConfigurationLibrary = new CElementLibrary;
2741+
auto pFrameworkConfigurationLibrary = new CElementLibrary;
27422742

27432743
pFrameworkConfigurationLibrary->addElementBuilder(
27442744
"ParameterFrameworkConfiguration",
@@ -2759,7 +2759,7 @@ void CParameterMgr::feedElementLibraries()
27592759
_pElementLibrarySet->addElementLibrary(pFrameworkConfigurationLibrary);
27602760

27612761
// Parameter creation
2762-
CElementLibrary *pParameterCreationLibrary = new CElementLibrary;
2762+
auto pParameterCreationLibrary = new CElementLibrary;
27632763

27642764
pParameterCreationLibrary->addElementBuilder(
27652765
"Subsystem", new CSubsystemElementBuilder(getSystemClass()->getSubsystemLibrary()));
@@ -2798,7 +2798,7 @@ void CParameterMgr::feedElementLibraries()
27982798
_pElementLibrarySet->addElementLibrary(pParameterCreationLibrary);
27992799

28002800
// Parameter Configuration Domains creation
2801-
CElementLibrary *pParameterConfigurationLibrary = new CElementLibrary;
2801+
auto pParameterConfigurationLibrary = new CElementLibrary;
28022802

28032803
pParameterConfigurationLibrary->addElementBuilder(
28042804
"ConfigurableDomain", new TElementBuilderTemplate<CConfigurableDomain>());

parameter/RuleParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError)
7070
case EBeginCompoundRule: {
7171

7272
// Create new compound rule
73-
CCompoundRule *pCompoundRule = new CCompoundRule;
73+
auto pCompoundRule = new CCompoundRule;
7474

7575
// Parse
7676
if (!pCompoundRule->parse(*this, strError)) {
@@ -104,7 +104,7 @@ bool CRuleParser::parse(CCompoundRule *pParentRule, string &strError)
104104
break;
105105
case ECriterionRule: {
106106
// Create new criterion rule
107-
CSelectionCriterionRule *pCriterionRule = new CSelectionCriterionRule;
107+
auto pCriterionRule = new CSelectionCriterionRule;
108108

109109
// Parse
110110
if (!pCriterionRule->parse(*this, strError)) {

parameter/SelectionCriteriaDefinition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::string CSelectionCriteriaDefinition::getKind() const
3939
CSelectionCriterion *CSelectionCriteriaDefinition::createSelectionCriterion(
4040
const std::string &strName, const CSelectionCriterionType *pType, core::log::Logger &logger)
4141
{
42-
CSelectionCriterion *pSelectionCriterion = new CSelectionCriterion(strName, pType, logger);
42+
auto pSelectionCriterion = new CSelectionCriterion(strName, pType, logger);
4343

4444
addChild(pSelectionCriterion);
4545

parameter/SelectionCriterionLibrary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::string CSelectionCriterionLibrary::getKind() const
3939
// Type creation
4040
CSelectionCriterionType *CSelectionCriterionLibrary::createSelectionCriterionType(bool bIsInclusive)
4141
{
42-
CSelectionCriterionType *pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive);
42+
auto pSelectionCriterionType = new CSelectionCriterionType(bIsInclusive);
4343

4444
addChild(pSelectionCriterionType);
4545

parameter/SelectionCriterionType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ bool CSelectionCriterionType::getNumericalValue(const std::string &strValue, int
118118
bool CSelectionCriterionType::getAtomicNumericalValue(const std::string &strValue,
119119
int &iValue) const
120120
{
121-
NumToLitMapConstIt it = _numToLitMap.find(strValue);
121+
auto it = _numToLitMap.find(strValue);
122122

123123
if (it != _numToLitMap.end()) {
124124

parameter/SystemClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool CSystemClass::loadPlugins(list<string> &lstrPluginFiles, core::Results &err
182182

183183
bool bAtLeastOneSubsystemPluginSuccessfullyLoaded = false;
184184

185-
list<string>::iterator it = lstrPluginFiles.begin();
185+
auto it = lstrPluginFiles.begin();
186186

187187
while (it != lstrPluginFiles.end()) {
188188

0 commit comments

Comments
 (0)