From 32252e357f3898baec85bafe076debefd915adfe 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 --- engine/src/flutter/include/minikin/FontFamily.h | 4 ++-- engine/src/flutter/include/minikin/MinikinFont.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/include/minikin/FontFamily.h b/engine/src/flutter/include/minikin/FontFamily.h index 7bdff6eb4f..4d7d08378a 100644 --- a/engine/src/flutter/include/minikin/FontFamily.h +++ b/engine/src/flutter/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/engine/src/flutter/include/minikin/MinikinFont.h b/engine/src/flutter/include/minikin/MinikinFont.h index 7f65cd7b0a..b7e6f87f78 100644 --- a/engine/src/flutter/include/minikin/MinikinFont.h +++ b/engine/src/flutter/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: