diff options
author | Chih-Hung Hsieh <chh@google.com> | 2018-12-20 13:48:02 -0800 |
---|---|---|
committer | Chih-hung Hsieh <chh@google.com> | 2019-01-09 19:50:30 +0000 |
commit | f21b0b6d3668dcbe25b7e4c00c38c68964850b4c (patch) | |
tree | 45c4bfe327bb132af75f75842b485731eea85446 /libs/hwui/service/GraphicsStatsService.cpp | |
parent | 9fbe48172748ce030e58c53cbefa3f3ecfbdf525 (diff) |
Fix/suppress hwui google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I8c6ebb99679b0a71251024d70a13f8164e67db5e
Diffstat (limited to 'libs/hwui/service/GraphicsStatsService.cpp')
-rw-r--r-- | libs/hwui/service/GraphicsStatsService.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/service/GraphicsStatsService.cpp b/libs/hwui/service/GraphicsStatsService.cpp index 29e4256e2ab7..8a16b2077f6f 100644 --- a/libs/hwui/service/GraphicsStatsService.cpp +++ b/libs/hwui/service/GraphicsStatsService.cpp @@ -48,7 +48,7 @@ static void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int outFd); class FileDescriptor { public: - FileDescriptor(int fd) : mFd(fd) {} + explicit FileDescriptor(int fd) : mFd(fd) {} ~FileDescriptor() { if (mFd != -1) { close(mFd); @@ -56,7 +56,7 @@ public: } } bool valid() { return mFd != -1; } - operator int() { return mFd; } + operator int() { return mFd; } // NOLINT(google-explicit-constructor) private: int mFd; @@ -64,7 +64,7 @@ private: class FileOutputStreamLite : public io::ZeroCopyOutputStream { public: - FileOutputStreamLite(int fd) : mCopyAdapter(fd), mImpl(&mCopyAdapter) {} + explicit FileOutputStreamLite(int fd) : mCopyAdapter(fd), mImpl(&mCopyAdapter) {} virtual ~FileOutputStreamLite() {} int GetErrno() { return mCopyAdapter.mErrno; } @@ -82,7 +82,7 @@ private: int mFd; int mErrno = 0; - FDAdapter(int fd) : mFd(fd) {} + explicit FDAdapter(int fd) : mFd(fd) {} virtual ~FDAdapter() {} virtual bool Write(const void* buffer, int size) override { |