diff options
author | Chih-Hung Hsieh <chh@google.com> | 2019-01-04 12:20:01 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-04 12:20:01 -0800 |
commit | 3b3be3f10f666f0c9fc368d0567466ee9bb8cc68 (patch) | |
tree | f1a91f4089ea24dea0d4ce26dc3f950867205e93 | |
parent | e2ad62f797d794717790ee955c09dd378a4c74bf (diff) | |
parent | 0bf62f1309fc279039b98a5faaa999ac95f9ee24 (diff) |
Merge "Fix/suppress aapt/aapt2 google-explicit-constructor warnings" am: cdf6be573f am: d42fe48c93
am: 0bf62f1309
Change-Id: Iffb7e4a145b172a35dd58b9450d4a5184d8b07f7
-rw-r--r-- | tools/aapt/ConfigDescription.h | 2 | ||||
-rw-r--r-- | tools/aapt2/Debug.cpp | 2 | ||||
-rw-r--r-- | tools/aapt2/Resource.h | 4 | ||||
-rw-r--r-- | tools/aapt2/cmd/Compile.cpp | 2 | ||||
-rw-r--r-- | tools/aapt2/cmd/Link.cpp | 4 | ||||
-rw-r--r-- | tools/aapt2/java/ProguardRules.h | 2 | ||||
-rw-r--r-- | tools/aapt2/link/XmlCompatVersioner.h | 4 | ||||
-rw-r--r-- | tools/aapt2/process/SymbolTable.h | 2 | ||||
-rw-r--r-- | tools/aapt2/test/Common.h | 4 | ||||
-rw-r--r-- | tools/aapt2/util/Maybe.h | 8 |
10 files changed, 19 insertions, 15 deletions
diff --git a/tools/aapt/ConfigDescription.h b/tools/aapt/ConfigDescription.h index 09430f2532fa..b4ea624524b3 100644 --- a/tools/aapt/ConfigDescription.h +++ b/tools/aapt/ConfigDescription.h @@ -29,7 +29,7 @@ struct ConfigDescription : public android::ResTable_config { size = sizeof(android::ResTable_config); } - ConfigDescription(const android::ResTable_config&o) { // NOLINT(implicit) + ConfigDescription(const android::ResTable_config&o) { // NOLINT(google-explicit-constructor) *static_cast<android::ResTable_config*>(this) = o; size = sizeof(android::ResTable_config); } diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 9460c9e596e9..5f664f5fdd5c 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -445,7 +445,7 @@ class XmlPrinter : public xml::ConstVisitor { public: using xml::ConstVisitor::Visit; - XmlPrinter(Printer* printer) : printer_(printer) { + explicit XmlPrinter(Printer* printer) : printer_(printer) { } void Visit(const xml::Element* el) override { diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h index dd5c751967b8..67ba895e51d1 100644 --- a/tools/aapt2/Resource.h +++ b/tools/aapt2/Resource.h @@ -113,7 +113,7 @@ struct ResourceNameRef { ResourceNameRef() = default; ResourceNameRef(const ResourceNameRef&) = default; ResourceNameRef(ResourceNameRef&&) = default; - ResourceNameRef(const ResourceName& rhs); // NOLINT(implicit) + ResourceNameRef(const ResourceName& rhs); // NOLINT(google-explicit-constructor) ResourceNameRef(const android::StringPiece& p, ResourceType t, const android::StringPiece& e); ResourceNameRef& operator=(const ResourceNameRef& rhs) = default; ResourceNameRef& operator=(ResourceNameRef&& rhs) = default; @@ -144,7 +144,7 @@ struct ResourceId { ResourceId(); ResourceId(const ResourceId& rhs); - ResourceId(uint32_t res_id); // NOLINT(implicit) + ResourceId(uint32_t res_id); // NOLINT(google-explicit-constructor) ResourceId(uint8_t p, uint8_t t, uint16_t e); bool is_valid() const; diff --git a/tools/aapt2/cmd/Compile.cpp b/tools/aapt2/cmd/Compile.cpp index f63a0745690b..52375a39b93f 100644 --- a/tools/aapt2/cmd/Compile.cpp +++ b/tools/aapt2/cmd/Compile.cpp @@ -584,7 +584,7 @@ static bool CompileFile(IAaptContext* context, const CompileOptions& options, class CompileContext : public IAaptContext { public: - CompileContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics) { + explicit CompileContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics) { } PackageType GetPackageType() override { diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp index f5b7acf36859..729447ee1de5 100644 --- a/tools/aapt2/cmd/Link.cpp +++ b/tools/aapt2/cmd/Link.cpp @@ -78,7 +78,7 @@ namespace aapt { class LinkContext : public IAaptContext { public: - LinkContext(IDiagnostics* diagnostics) + explicit LinkContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics), name_mangler_({}), symbols_(&name_mangler_) { } @@ -163,7 +163,7 @@ class LinkContext : public IAaptContext { // See b/37498913. class FeatureSplitSymbolTableDelegate : public DefaultSymbolTableDelegate { public: - FeatureSplitSymbolTableDelegate(IAaptContext* context) : context_(context) { + explicit FeatureSplitSymbolTableDelegate(IAaptContext* context) : context_(context) { } virtual ~FeatureSplitSymbolTableDelegate() = default; diff --git a/tools/aapt2/java/ProguardRules.h b/tools/aapt2/java/ProguardRules.h index 38b4860d1d61..f9656d112b7b 100644 --- a/tools/aapt2/java/ProguardRules.h +++ b/tools/aapt2/java/ProguardRules.h @@ -49,7 +49,7 @@ class KeepSet { public: KeepSet() = default; - KeepSet(bool conditional_keep_rules) : conditional_keep_rules_(conditional_keep_rules) { + explicit KeepSet(bool conditional_keep_rules) : conditional_keep_rules_(conditional_keep_rules) { } inline void AddManifestClass(const UsageLocation& file, const std::string& class_name) { diff --git a/tools/aapt2/link/XmlCompatVersioner.h b/tools/aapt2/link/XmlCompatVersioner.h index 099e23c9e479..998061806279 100644 --- a/tools/aapt2/link/XmlCompatVersioner.h +++ b/tools/aapt2/link/XmlCompatVersioner.h @@ -55,7 +55,7 @@ class XmlCompatVersioner { public: using Rules = std::unordered_map<ResourceId, std::unique_ptr<IDegradeRule>>; - XmlCompatVersioner(const Rules* rules); + explicit XmlCompatVersioner(const Rules* rules); std::vector<std::unique_ptr<xml::XmlResource>> Process(IAaptContext* context, xml::XmlResource* doc, @@ -83,7 +83,7 @@ struct ReplacementAttr { class DegradeToManyRule : public IDegradeRule { public: - DegradeToManyRule(std::vector<ReplacementAttr> attrs); + explicit DegradeToManyRule(std::vector<ReplacementAttr> attrs); virtual ~DegradeToManyRule() = default; std::vector<DegradeResult> Degrade(const xml::Element& src_el, const xml::Attribute& src_attr, diff --git a/tools/aapt2/process/SymbolTable.h b/tools/aapt2/process/SymbolTable.h index 51a2e373596a..2d8bd02a3799 100644 --- a/tools/aapt2/process/SymbolTable.h +++ b/tools/aapt2/process/SymbolTable.h @@ -71,7 +71,7 @@ class SymbolTable { bool is_dynamic = false; }; - SymbolTable(NameMangler* mangler); + explicit SymbolTable(NameMangler* mangler); // Overrides the default ISymbolTableDelegate, which allows a custom defined strategy for // looking up resources from a set of sources. diff --git a/tools/aapt2/test/Common.h b/tools/aapt2/test/Common.h index 50b41f1cb1e8..777ca5c72619 100644 --- a/tools/aapt2/test/Common.h +++ b/tools/aapt2/test/Common.h @@ -173,10 +173,12 @@ class ValueEqImpl : public ::testing::MatcherInterface<T> { template <typename TValue> class ValueEqMatcher { public: + // NOLINTNEXTLINE(google-explicit-constructor) ValueEqMatcher(TValue expected) : expected_(std::move(expected)) { } template <typename T> + // NOLINTNEXTLINE(google-explicit-constructor) operator ::testing::Matcher<T>() const { return ::testing::Matcher<T>(new ValueEqImpl<T>(&expected_)); } @@ -188,10 +190,12 @@ class ValueEqMatcher { template <typename TValue> class ValueEqPointerMatcher { public: + // NOLINTNEXTLINE(google-explicit-constructor) ValueEqPointerMatcher(const TValue* expected) : expected_(expected) { } template <typename T> + // NOLINTNEXTLINE(google-explicit-constructor) operator ::testing::Matcher<T>() const { return ::testing::Matcher<T>(new ValueEqImpl<T>(expected_)); } diff --git a/tools/aapt2/util/Maybe.h b/tools/aapt2/util/Maybe.h index 031276c8b885..047e1a581330 100644 --- a/tools/aapt2/util/Maybe.h +++ b/tools/aapt2/util/Maybe.h @@ -44,12 +44,12 @@ class Maybe { Maybe(const Maybe& rhs); template <typename U> - Maybe(const Maybe<U>& rhs); // NOLINT(implicit) + Maybe(const Maybe<U>& rhs); // NOLINT(google-explicit-constructor) Maybe(Maybe&& rhs) noexcept; template <typename U> - Maybe(Maybe<U>&& rhs); // NOLINT(implicit) + Maybe(Maybe<U>&& rhs); // NOLINT(google-explicit-constructor) Maybe& operator=(const Maybe& rhs); @@ -64,12 +64,12 @@ class Maybe { /** * Construct a Maybe holding a value. */ - Maybe(const T& value); // NOLINT(implicit) + Maybe(const T& value); // NOLINT(google-explicit-constructor) /** * Construct a Maybe holding a value. */ - Maybe(T&& value); // NOLINT(implicit) + Maybe(T&& value); // NOLINT(google-explicit-constructor) /** * True if this holds a value, false if |