From 9b8528fee4eed35b8e887ded0851d08eb2b10db6 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 10 Aug 2016 14:15:30 -0700 Subject: Fix clang-tidy warnings in aapt and aapt2. * Add explicit keyword to conversion constructors. * Add NOLINT(implicit) comments for implicit conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1 --- tools/aapt2/ResourceTable.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/aapt2/ResourceTable.cpp') diff --git a/tools/aapt2/ResourceTable.cpp b/tools/aapt2/ResourceTable.cpp index 4d418d9c2e93..460de0e800d3 100644 --- a/tools/aapt2/ResourceTable.cpp +++ b/tools/aapt2/ResourceTable.cpp @@ -274,7 +274,7 @@ bool ResourceTable::addResource(const ResourceNameRef& name, } bool ResourceTable::addResource(const ResourceNameRef& name, - const ResourceId resId, + const ResourceId& resId, const ConfigDescription& config, const StringPiece& product, std::unique_ptr value, @@ -325,7 +325,7 @@ bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name, } bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name, - const ResourceId id, + const ResourceId& id, const ConfigDescription& config, const StringPiece& product, std::unique_ptr value, @@ -335,12 +335,12 @@ bool ResourceTable::addResourceAllowMangled(const ResourceNameRef& name, } bool ResourceTable::addResourceImpl(const ResourceNameRef& name, - const ResourceId resId, + const ResourceId& resId, const ConfigDescription& config, const StringPiece& product, std::unique_ptr value, const char* validChars, - std::function conflictResolver, + const std::function& conflictResolver, IDiagnostics* diag) { assert(value && "value can't be nullptr"); assert(diag && "diagnostics can't be nullptr"); @@ -426,18 +426,18 @@ bool ResourceTable::addResourceImpl(const ResourceNameRef& name, return true; } -bool ResourceTable::setSymbolState(const ResourceNameRef& name, const ResourceId resId, +bool ResourceTable::setSymbolState(const ResourceNameRef& name, const ResourceId& resId, const Symbol& symbol, IDiagnostics* diag) { return setSymbolStateImpl(name, resId, symbol, kValidNameChars, diag); } bool ResourceTable::setSymbolStateAllowMangled(const ResourceNameRef& name, - const ResourceId resId, + const ResourceId& resId, const Symbol& symbol, IDiagnostics* diag) { return setSymbolStateImpl(name, resId, symbol, kValidNameMangledChars, diag); } -bool ResourceTable::setSymbolStateImpl(const ResourceNameRef& name, const ResourceId resId, +bool ResourceTable::setSymbolStateImpl(const ResourceNameRef& name, const ResourceId& resId, const Symbol& symbol, const char* validChars, IDiagnostics* diag) { assert(diag && "diagnostics can't be nullptr"); -- cgit v1.2.3