diff options
author | 2016-09-01 11:34:16 -0700 | |
---|---|---|
committer | 2016-09-01 11:34:16 -0700 | |
commit | 342b760763300593cd20b01dac8cef61e7b25b86 (patch) | |
tree | 4a5c15af0d0d43965c2d9079f4a6e1292b291584 | |
parent | 0322a7176f4c432cae50c72657ad31a8c3b43016 (diff) |
Fix google-explicit-constructor warnings in surfaceflinger.
* Add explicit keyword to conversion constructors,
or use NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1
Change-Id: I94f511c3be31dc22022db6466ee9ed0c6be2bc8e
-rw-r--r-- | services/surfaceflinger/Client.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/Colorizer.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DispSync.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/FloatRect.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWC2.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h | 4 | ||||
-rw-r--r-- | services/surfaceflinger/EventControlThread.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/EventLog/EventLog.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/EventThread.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/MessageQueue.h | 2 |
11 files changed, 12 insertions, 12 deletions
diff --git a/services/surfaceflinger/Client.h b/services/surfaceflinger/Client.h index b6d738125a..c77651fa43 100644 --- a/services/surfaceflinger/Client.h +++ b/services/surfaceflinger/Client.h @@ -38,7 +38,7 @@ class SurfaceFlinger; class Client : public BnSurfaceComposerClient { public: - Client(const sp<SurfaceFlinger>& flinger); + explicit Client(const sp<SurfaceFlinger>& flinger); ~Client(); status_t initCheck() const; diff --git a/services/surfaceflinger/Colorizer.h b/services/surfaceflinger/Colorizer.h index 652448159f..f2e6491368 100644 --- a/services/surfaceflinger/Colorizer.h +++ b/services/surfaceflinger/Colorizer.h @@ -34,7 +34,7 @@ public: WHITE = 37 }; - Colorizer(bool enabled) + explicit Colorizer(bool enabled) : mEnabled(enabled) { } diff --git a/services/surfaceflinger/DispSync.h b/services/surfaceflinger/DispSync.h index 537c81bc2c..2763e59559 100644 --- a/services/surfaceflinger/DispSync.h +++ b/services/surfaceflinger/DispSync.h @@ -61,7 +61,7 @@ public: virtual void onDispSyncEvent(nsecs_t when) = 0; }; - DispSync(const char* name); + explicit DispSync(const char* name); ~DispSync(); // reset clears the resync samples and error value. diff --git a/services/surfaceflinger/DisplayHardware/FloatRect.h b/services/surfaceflinger/DisplayHardware/FloatRect.h index 9ad1040cd2..151eaaa622 100644 --- a/services/surfaceflinger/DisplayHardware/FloatRect.h +++ b/services/surfaceflinger/DisplayHardware/FloatRect.h @@ -32,7 +32,7 @@ public: inline FloatRect() : left(0), top(0), right(0), bottom(0) { } - inline FloatRect(const Rect& other) + inline FloatRect(const Rect& other) // NOLINT(implicit) : left(other.left), top(other.top), right(other.right), bottom(other.bottom) { } inline float getWidth() const { return right - left; } diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h index 8ab61e9ced..1aa4205838 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2.h +++ b/services/surfaceflinger/DisplayHardware/HWC2.h @@ -56,7 +56,7 @@ typedef std::function<void(std::shared_ptr<Display>, nsecs_t)> VsyncCallback; class Device { public: - Device(hwc2_device_t* device); + explicit Device(hwc2_device_t* device); ~Device(); friend class HWC2::Display; diff --git a/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h b/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h index dc7c355617..5debb9ad3a 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h +++ b/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h @@ -43,7 +43,7 @@ namespace android { class HWC2On1Adapter : public hwc2_device_t { public: - HWC2On1Adapter(struct hwc_composer_device_1* hwc1Device); + explicit HWC2On1Adapter(struct hwc_composer_device_1* hwc1Device); ~HWC2On1Adapter(); struct hwc_composer_device_1* getHwc1Device() const { return mHwc1Device; } @@ -488,7 +488,7 @@ private: class Layer { public: - Layer(Display& display); + explicit Layer(Display& display); bool operator==(const Layer& other) { return mId == other.mId; } bool operator!=(const Layer& other) { return !(*this == other); } diff --git a/services/surfaceflinger/EventControlThread.h b/services/surfaceflinger/EventControlThread.h index be6c53aa32..9368db6fc8 100644 --- a/services/surfaceflinger/EventControlThread.h +++ b/services/surfaceflinger/EventControlThread.h @@ -29,7 +29,7 @@ class SurfaceFlinger; class EventControlThread: public Thread { public: - EventControlThread(const sp<SurfaceFlinger>& flinger); + explicit EventControlThread(const sp<SurfaceFlinger>& flinger); virtual ~EventControlThread() {} void setVsyncEnabled(bool enabled); diff --git a/services/surfaceflinger/EventLog/EventLog.h b/services/surfaceflinger/EventLog/EventLog.h index 52075147ef..efc5d70cd3 100644 --- a/services/surfaceflinger/EventLog/EventLog.h +++ b/services/surfaceflinger/EventLog/EventLog.h @@ -52,7 +52,7 @@ private: bool mOverflow; char mStorage[STORAGE_MAX_SIZE]; public: - TagBuffer(int32_t tag); + explicit TagBuffer(int32_t tag); // starts list of items void startList(int8_t count); diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h index 34654fa941..b6351150d7 100644 --- a/services/surfaceflinger/EventThread.h +++ b/services/surfaceflinger/EventThread.h @@ -57,7 +57,7 @@ public: class EventThread : public Thread, private VSyncSource::Callback { class Connection : public BnDisplayEventConnection { public: - Connection(const sp<EventThread>& eventThread); + explicit Connection(const sp<EventThread>& eventThread); status_t postEvent(const DisplayEventReceiver::Event& event); // count >= 1 : continuous event. count is the vsync rate diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index ba7184f8e7..55e3b5461b 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -456,7 +456,7 @@ private: class SyncPoint { public: - SyncPoint(uint64_t frameNumber) : mFrameNumber(frameNumber), + explicit SyncPoint(uint64_t frameNumber) : mFrameNumber(frameNumber), mFrameIsAvailable(false), mTransactionIsApplied(false) {} uint64_t getFrameNumber() const { diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h index 1004f4c0c6..aed0aa90f2 100644 --- a/services/surfaceflinger/MessageQueue.h +++ b/services/surfaceflinger/MessageQueue.h @@ -69,7 +69,7 @@ class MessageQueue { MessageQueue& mQueue; int32_t mEventMask; public: - Handler(MessageQueue& queue) : mQueue(queue), mEventMask(0) { } + explicit Handler(MessageQueue& queue) : mQueue(queue), mEventMask(0) { } virtual void handleMessage(const Message& message); void dispatchRefresh(); void dispatchInvalidate(); |