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/thread/Barrier.h b/libs/hwui/thread/Barrier.h
index 6cb23e5..bf10704 100644
--- a/libs/hwui/thread/Barrier.h
+++ b/libs/hwui/thread/Barrier.h
@@ -24,7 +24,7 @@
class Barrier {
public:
- Barrier(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mOpened(false) { }
+ explicit Barrier(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mOpened(false) { }
~Barrier() { }
void open() {
diff --git a/libs/hwui/thread/Future.h b/libs/hwui/thread/Future.h
index a3ff3bc..177eebd 100644
--- a/libs/hwui/thread/Future.h
+++ b/libs/hwui/thread/Future.h
@@ -27,7 +27,7 @@
template<typename T>
class Future: public LightRefBase<Future<T> > {
public:
- Future(Condition::WakeUpType type = Condition::WAKE_UP_ONE): mBarrier(type), mResult() { }
+ explicit Future(Condition::WakeUpType type = Condition::WAKE_UP_ONE): mBarrier(type), mResult() { }
~Future() { }
/**
diff --git a/libs/hwui/thread/Signal.h b/libs/hwui/thread/Signal.h
index d4cfeeb..93e6f4c 100644
--- a/libs/hwui/thread/Signal.h
+++ b/libs/hwui/thread/Signal.h
@@ -26,7 +26,7 @@
class Signal {
public:
- Signal(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mSignaled(false) { }
+ explicit Signal(Condition::WakeUpType type = Condition::WAKE_UP_ALL) : mType(type), mSignaled(false) { }
~Signal() { }
void signal() {
diff --git a/libs/hwui/thread/TaskManager.h b/libs/hwui/thread/TaskManager.h
index 10e8b9e..4d3b8f0 100644
--- a/libs/hwui/thread/TaskManager.h
+++ b/libs/hwui/thread/TaskManager.h
@@ -77,7 +77,7 @@
class WorkerThread: public Thread {
public:
- WorkerThread(const String8 name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
+ explicit WorkerThread(const String8 name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
bool addTask(TaskWrapper task);
size_t getTaskCount() const;
diff --git a/libs/hwui/thread/TaskProcessor.h b/libs/hwui/thread/TaskProcessor.h
index 82538e9..5867450 100644
--- a/libs/hwui/thread/TaskProcessor.h
+++ b/libs/hwui/thread/TaskProcessor.h
@@ -36,7 +36,7 @@
template<typename T>
class TaskProcessor: public TaskProcessorBase {
public:
- TaskProcessor(TaskManager* manager): mManager(manager) { }
+ explicit TaskProcessor(TaskManager* manager): mManager(manager) { }
virtual ~TaskProcessor() { }
void add(const sp<Task<T> >& task) {