提交 47b905f6 编写于 作者: C Chih-Hung Hsieh

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
上级 b8301022
......@@ -37,7 +37,7 @@ class FontStyle {
public:
FontStyle() : FontStyle(0 /* variant */, 4 /* weight */, false /* italic */) {}
FontStyle(int weight, bool italic) : FontStyle(0 /* variant */, weight, italic) {}
FontStyle(uint32_t langListId)
FontStyle(uint32_t langListId) // NOLINT(implicit)
: FontStyle(langListId, 0 /* variant */, 4 /* weight */, false /* italic */) {}
FontStyle(int variant, int weight, bool italic);
......@@ -102,7 +102,7 @@ class FontFamily : public MinikinRefCounted {
public:
FontFamily();
FontFamily(int variant);
explicit FontFamily(int variant);
FontFamily(uint32_t langId, int variant)
: mLangId(langId),
......
......@@ -33,7 +33,7 @@ namespace minikin {
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:
......@@ -99,7 +99,7 @@ typedef void (*MinikinDestroyFunc) (void* data);
class MinikinFont : public MinikinRefCounted {
public:
MinikinFont(int32_t uniqueId) : mUniqueId(uniqueId) {}
explicit MinikinFont(int32_t uniqueId) : mUniqueId(uniqueId) {}
virtual ~MinikinFont();
......
......@@ -42,7 +42,7 @@ private:
template <typename T>
class MinikinAutoUnref {
public:
MinikinAutoUnref(T* obj) : mObj(obj) {
explicit MinikinAutoUnref(T* obj) : mObj(obj) {
}
~MinikinAutoUnref() {
mObj->Unref();
......
......@@ -98,7 +98,7 @@ private:
// An immutable list of languages.
class FontLanguages {
public:
FontLanguages(std::vector<FontLanguage>&& languages);
explicit FontLanguages(std::vector<FontLanguage>&& languages);
FontLanguages() : mUnionOfSubScriptBits(0), mIsAllTheSameLanguage(false) {}
FontLanguages(FontLanguages&&) = default;
......
......@@ -52,7 +52,7 @@ class HbBlob {
public:
// Takes ownership of hb_blob_t object, caller is no longer
// responsible for calling hb_blob_destroy().
HbBlob(hb_blob_t* blob) : mBlob(blob) {
explicit HbBlob(hb_blob_t* blob) : mBlob(blob) {
}
~HbBlob() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册