diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-20 15:54:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-20 18:39:11 +0200 |
commit | 1d4eb1be35cc393f98496883c2cb4ee89f4bcf0c (patch) | |
tree | 8b918663b9c37780d1fa42b8b1f35f363c7aa8d5 /unoidl | |
parent | 50a6041bfac60ab03ec896bd638504524853300d (diff) |
loplugin:constvars in test..unotools
Change-Id: I087dc53ca5c18893974bbd9d959de56d5a4cdfa0
Reviewed-on: https://gerrit.libreoffice.org/77827
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/sourceprovider-parser.y | 26 | ||||
-rw-r--r-- | unoidl/source/unoidl-read.cxx | 4 | ||||
-rw-r--r-- | unoidl/source/unoidl-write.cxx | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index c867c65551eb..5fb347099ced 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -1334,7 +1334,7 @@ structMember: dynamic_cast<unoidl::detail::SourceProviderPlainStructTypeEntityPad *>( ent->pad.get()); if (p1 != nullptr) { - for (auto & i: p1->members) { + for (const auto & i: p1->members) { if (id == i.name) { error( @3, yyscanner, @@ -1401,7 +1401,7 @@ structMember: p2 = dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>( ent->pad.get()); if (p2 != nullptr) { - for (auto & i: p2->members) { + for (const auto & i: p2->members) { if (id == i.name) { error( @3, yyscanner, @@ -1420,7 +1420,7 @@ structMember: = dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>( ent->pad.get()); assert(p3 != nullptr); - for (auto & i: p3->members) { + for (const auto & i: p3->members) { if (id == i.name) { error( @3, yyscanner, @@ -1869,7 +1869,7 @@ methodParam: default: break; } - for (auto & i: pad->directMethods.back().parameters) { + for (const auto & i: pad->directMethods.back().parameters) { if (id == i.name) { error( @5, yyscanner, @@ -2353,7 +2353,7 @@ singleInterfaceBasedServiceDefn: assert(pad != nullptr); std::vector<unoidl::SingleInterfaceBasedServiceEntity::Constructor> ctors; if ($7) { - for (auto & i: pad->constructors) { + for (const auto & i: pad->constructors) { std::vector<unoidl::SingleInterfaceBasedServiceEntity::Constructor::Parameter> parms; for (auto & j: i.parameters) { parms.emplace_back(j.name, j.type.getName(), j.rest); @@ -2392,7 +2392,7 @@ ctor: rtl::Reference<unoidl::detail::SourceProviderSingleInterfaceBasedServiceEntityPad> pad(getCurrentPad<unoidl::detail::SourceProviderSingleInterfaceBasedServiceEntityPad>( data)); - for (auto & i: pad->constructors) { + for (const auto & i: pad->constructors) { if (id == i.name) { error( @2, yyscanner, @@ -2518,7 +2518,7 @@ ctorParam: + " rest parameter must be last parameter")); YYERROR; } - for (auto & i: pad->constructors.back().parameters) { + for (const auto & i: pad->constructors.back().parameters) { if (id == i.name) { error( @6, yyscanner, @@ -2630,7 +2630,7 @@ serviceBase: std::vector<unoidl::AnnotatedReference> & v( opt ? pad->directOptionalBaseServices : pad->directMandatoryBaseServices); - for (auto & i: v) { + for (const auto & i: v) { if (name == i.name) { error( @4, yyscanner, @@ -2707,7 +2707,7 @@ serviceInterfaceBase: opt ? pad->directOptionalBaseInterfaces : pad->directMandatoryBaseInterfaces); - for (auto & i: v) { + for (const auto & i: v) { if (name == i.name) { error( @4, yyscanner, @@ -2794,7 +2794,7 @@ serviceProperty: rtl::Reference<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad> pad(getCurrentPad<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad>( data)); - for (auto & i: pad->directProperties) { + for (const auto & i: pad->directProperties) { if (id == i.name) { error( @4, yyscanner, @@ -3477,7 +3477,7 @@ primaryExpr: unoidl::detail::SourceProviderEnumTypeEntityPad * p1 = dynamic_cast< unoidl::detail::SourceProviderEnumTypeEntityPad *>(pad.get()); if (p1 != nullptr) { - for (auto & j: p1->members) { + for (const auto & j: p1->members) { if (j.name == name) { v = unoidl::ConstantValue(j.value); found = true; @@ -3490,7 +3490,7 @@ primaryExpr: unoidl::detail::SourceProviderConstantGroupEntityPad *>( pad.get()); if (p2 != nullptr) { - for (auto & j: p2->members) { + for (const auto & j: p2->members) { if (j.name == name) { v = j.value; found = true; @@ -3538,7 +3538,7 @@ primaryExpr: unoidl::detail::SourceProviderConstantGroupEntityPad *>( ent->pad.get()); if (pad != nullptr) { - for (auto & j: pad->members) { + for (const auto & j: pad->members) { if (j.name == id) { v = j.value; found = true; diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx index 6414fb376a1c..2cd44aceefa5 100644 --- a/unoidl/source/unoidl-read.cxx +++ b/unoidl/source/unoidl-read.cxx @@ -204,7 +204,7 @@ void insertTypeDependency( OUString nucl(decomposeType(type, &rank, &args, &entity)); if (entity) { insertEntityDependency(manager, iterator, nucl, true); - for (auto & i: args) { + for (const auto & i: args) { insertTypeDependency(manager, iterator, i); } } @@ -1041,7 +1041,7 @@ SAL_IMPLEMENT_MAIN() { scanMap(mgr, prov->createRootCursor(), published, "", ents); std::vector<OUString> sorted(sort(ents)); std::vector<OUString> mods; - for (auto & i: sorted) { + for (const auto & i: sorted) { writeEntity(ents, mods, i); } closeModules(mods, mods.size()); diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx index ef3d888b66d6..3f51b68c07dd 100644 --- a/unoidl/source/unoidl-write.cxx +++ b/unoidl/source/unoidl-write.cxx @@ -713,7 +713,7 @@ sal_uInt64 writeMap( write32(file, cmap.size()); // overflow from std::map::size_type -> sal_uInt64 is // unrealistic - for (auto & j: cmap) { + for (const auto & j: cmap) { write32(file, j.second.nameOffset); write32(file, j.second.dataOffset); } @@ -846,7 +846,7 @@ sal_uInt64 writeMap( *rootSize = map.size(); // overflow from std::map::size_type -> std::size_t is unrealistic } - for (auto & i: map) { + for (const auto & i: map) { write32(file, i.second.nameOffset); write32(file, i.second.dataOffset); } |