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/aapt/XMLNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/aapt/XMLNode.cpp') diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp index 5b215daeb494..15ec4afa52dd 100644 --- a/tools/aapt/XMLNode.cpp +++ b/tools/aapt/XMLNode.cpp @@ -67,7 +67,7 @@ static const String16 RESOURCES_PREFIX_AUTO_PACKAGE(RESOURCES_AUTO_PACKAGE_NAMES static const String16 RESOURCES_PRV_PREFIX(RESOURCES_ROOT_PRV_NAMESPACE); static const String16 RESOURCES_TOOLS_NAMESPACE("http://schemas.android.com/tools"); -String16 getNamespaceResourcePackage(String16 appPackage, String16 namespaceUri, bool* outIsPublic) +String16 getNamespaceResourcePackage(const String16& appPackage, const String16& namespaceUri, bool* outIsPublic) { //printf("%s starts with %s?\n", String8(namespaceUri).string(), // String8(RESOURCES_PREFIX).string()); @@ -98,7 +98,7 @@ String16 getNamespaceResourcePackage(String16 appPackage, String16 namespaceUri, status_t hasSubstitutionErrors(const char* fileName, ResXMLTree* inXml, - String16 str16) + const String16& str16) { const char16_t* str = str16.string(); const char16_t* p = str; -- cgit v1.2.3-59-g8ed1b