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
diff --git a/tools/aapt/ResourceFilter.h b/tools/aapt/ResourceFilter.h
index d6430c0..40d5b75 100644
--- a/tools/aapt/ResourceFilter.h
+++ b/tools/aapt/ResourceFilter.h
@@ -78,7 +78,7 @@
class StrongResourceFilter : public ResourceFilter {
public:
StrongResourceFilter() {}
- StrongResourceFilter(const std::set<ConfigDescription>& configs)
+ explicit StrongResourceFilter(const std::set<ConfigDescription>& configs)
: mConfigs(configs) {}
android::status_t parse(const android::String8& str);
@@ -106,7 +106,7 @@
*/
class InverseResourceFilter : public ResourceFilter {
public:
- InverseResourceFilter(const android::sp<ResourceFilter>& filter)
+ explicit InverseResourceFilter(const android::sp<ResourceFilter>& filter)
: mFilter(filter) {}
bool match(const android::ResTable_config& config) const {