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
This commit is contained in:
Chih-Hung Hsieh
2016-08-15 12:29:41 -07:00
committed by Chih-hung Hsieh
parent d166b937e4
commit 32252e357f
2 changed files with 3 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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: