From 8bd37ba458633ee7b2aeec0a7593817000aa84b2 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 Merged-In: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1 --- tools/aapt2/ResourceParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/aapt2/ResourceParser.cpp') diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index 13f916bfc8f3..ec7bfa5994f6 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -391,7 +391,7 @@ uint32_t ResourceParser::androidTypeToAttributeTypeMask(uint16_t type) { std::unique_ptr ResourceParser::parseItemForAttribute( const StringPiece16& value, uint32_t typeMask, - std::function onCreateReference) { + const std::function& onCreateReference) { std::unique_ptr nullOrEmpty = tryParseNullOrEmpty(value); if (nullOrEmpty) { return std::move(nullOrEmpty); @@ -451,7 +451,7 @@ std::unique_ptr ResourceParser::parseItemForAttribute( */ std::unique_ptr ResourceParser::parseItemForAttribute( const StringPiece16& str, const Attribute& attr, - std::function onCreateReference) { + const std::function& onCreateReference) { const uint32_t typeMask = attr.typeMask; std::unique_ptr value = parseItemForAttribute(str, typeMask, onCreateReference); if (value) { -- cgit v1.2.3-59-g8ed1b