Fix google-explicit-constructor warnings in frameworks/base
* Add explicit keyword to conversion constructors.
* Add NOLINT to implicit conversion constructors.
Bug: 28341362
Test: build with clang-tidy
Change-Id: Ie4d37072ab57d1662d18db4de1c8577247f43337
diff --git a/libs/hwui/CanvasProperty.h b/libs/hwui/CanvasProperty.h
index 6074394..56671bb 100644
--- a/libs/hwui/CanvasProperty.h
+++ b/libs/hwui/CanvasProperty.h
@@ -28,7 +28,7 @@
class CanvasPropertyPrimitive : public VirtualLightRefBase {
PREVENT_COPY_AND_ASSIGN(CanvasPropertyPrimitive);
public:
- CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}
+ explicit CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}
float value;
};
@@ -36,7 +36,7 @@
class CanvasPropertyPaint : public VirtualLightRefBase {
PREVENT_COPY_AND_ASSIGN(CanvasPropertyPaint);
public:
- CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}
+ explicit CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}
SkPaint value;
};