From 0114c6a1cf1804caa9175bbb5ed3de385cc3d7a0 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Mon, 15 Aug 2016 12:29:41 -0700 Subject: [PATCH] Fix google-explicit-constructor warnings in minikin * Add explicit keyword to conversion constructors, or add NOLINT(implicit) for implicit converters. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I0c7b90f9bb953a9f2e4f0fb2032fa65ac604b9ca Merged-In: I0c7b90f9bb953a9f2e4f0fb2032fa65ac604b9ca --- include/minikin/FontFamily.h | 4 ++-- include/minikin/MinikinFont.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/minikin/FontFamily.h b/include/minikin/FontFamily.h index 7bdff6eb4ff..4d7d08378aa 100644 --- a/include/minikin/FontFamily.h +++ b/include/minikin/FontFamily.h @@ -65,10 +65,10 @@ private: // so it can be efficiently copied, embedded in other objects, etc. class FontStyle { public: - FontStyle(int weight = 4, bool italic = false) { + explicit FontStyle(int weight = 4, bool italic = false) { bits = (weight & kWeightMask) | (italic ? kItalicMask : 0); } - FontStyle(FontLanguage lang, int variant = 0, int weight = 4, bool italic = false) { + explicit FontStyle(FontLanguage lang, int variant = 0, int weight = 4, bool italic = false) { bits = (weight & kWeightMask) | (italic ? kItalicMask : 0) | (variant << kVariantShift) | (lang.bits() << kLangShift); } diff --git a/include/minikin/MinikinFont.h b/include/minikin/MinikinFont.h index 7f65cd7b0aa..b7e6f87f782 100644 --- a/include/minikin/MinikinFont.h +++ b/include/minikin/MinikinFont.h @@ -33,7 +33,7 @@ namespace android { class HyphenEdit { public: HyphenEdit() : hyphen(0) { } - HyphenEdit(uint32_t hyphenInt) : hyphen(hyphenInt) { } + HyphenEdit(uint32_t hyphenInt) : hyphen(hyphenInt) { } // NOLINT(implicit) bool hasHyphen() const { return hyphen != 0; } bool operator==(const HyphenEdit &other) const { return hyphen == other.hyphen; } private: