diff options
author | Chih-Hung Hsieh <chh@google.com> | 2016-07-12 13:50:44 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2016-07-26 11:26:01 -0700 |
commit | 034c475931e8e4da54b499c0056121490f029865 (patch) | |
tree | d07eac290b1d3744cd60ebe76486e0c2c937ea3d /libpixelflinger | |
parent | 02ccdc5db9bb39488a3fe22a907b3211c3a464b9 (diff) | |
download | system_core-034c475931e8e4da54b499c0056121490f029865.tar.gz system_core-034c475931e8e4da54b499c0056121490f029865.tar.bz2 system_core-034c475931e8e4da54b499c0056121490f029865.zip |
Fix google-explicit-constructor warnings in system/core.
* Declare explicit conversion constructors.
* Add NOLINT for implicit conversion constructors.
* Fix also some misaligned indendations.
Bug: 28341362
Change-Id: Idf911f35923b408d92285cc1a053f382ba08c63e
Test: build with clang-tidy
Diffstat (limited to 'libpixelflinger')
-rw-r--r-- | libpixelflinger/codeflinger/ARMAssembler.h | 2 | ||||
-rw-r--r-- | libpixelflinger/codeflinger/ARMAssemblerProxy.h | 2 | ||||
-rw-r--r-- | libpixelflinger/codeflinger/Arm64Assembler.h | 4 | ||||
-rw-r--r-- | libpixelflinger/codeflinger/CodeCache.h | 18 | ||||
-rw-r--r-- | libpixelflinger/codeflinger/GGLAssembler.h | 16 | ||||
-rw-r--r-- | libpixelflinger/codeflinger/tinyutils/smartpointer.h | 6 |
6 files changed, 24 insertions, 24 deletions
diff --git a/libpixelflinger/codeflinger/ARMAssembler.h b/libpixelflinger/codeflinger/ARMAssembler.h index 7178c65df..76acf7e3a 100644 --- a/libpixelflinger/codeflinger/ARMAssembler.h +++ b/libpixelflinger/codeflinger/ARMAssembler.h @@ -35,7 +35,7 @@ namespace android { class ARMAssembler : public ARMAssemblerInterface { public: - ARMAssembler(const sp<Assembly>& assembly); + explicit ARMAssembler(const sp<Assembly>& assembly); virtual ~ARMAssembler(); uint32_t* base() const; diff --git a/libpixelflinger/codeflinger/ARMAssemblerProxy.h b/libpixelflinger/codeflinger/ARMAssemblerProxy.h index b85279485..10d039085 100644 --- a/libpixelflinger/codeflinger/ARMAssemblerProxy.h +++ b/libpixelflinger/codeflinger/ARMAssemblerProxy.h @@ -34,7 +34,7 @@ public: // ARMAssemblerProxy take ownership of the target ARMAssemblerProxy(); - ARMAssemblerProxy(ARMAssemblerInterface* target); + explicit ARMAssemblerProxy(ARMAssemblerInterface* target); virtual ~ARMAssemblerProxy(); void setTarget(ARMAssemblerInterface* target); diff --git a/libpixelflinger/codeflinger/Arm64Assembler.h b/libpixelflinger/codeflinger/Arm64Assembler.h index c9be11614..527c757aa 100644 --- a/libpixelflinger/codeflinger/Arm64Assembler.h +++ b/libpixelflinger/codeflinger/Arm64Assembler.h @@ -47,8 +47,8 @@ namespace android { class ArmToArm64Assembler : public ARMAssemblerInterface { public: - ArmToArm64Assembler(const sp<Assembly>& assembly); - ArmToArm64Assembler(void *base); + explicit ArmToArm64Assembler(const sp<Assembly>& assembly); + explicit ArmToArm64Assembler(void *base); virtual ~ArmToArm64Assembler(); uint32_t* base() const; diff --git a/libpixelflinger/codeflinger/CodeCache.h b/libpixelflinger/codeflinger/CodeCache.h index 0fb6fd5fe..c0e0684ef 100644 --- a/libpixelflinger/codeflinger/CodeCache.h +++ b/libpixelflinger/codeflinger/CodeCache.h @@ -42,7 +42,7 @@ template <typename T> class AssemblyKey : public AssemblyKeyBase { public: - AssemblyKey(const T& rhs) : mKey(rhs) { } + explicit AssemblyKey(const T& rhs) : mKey(rhs) { } virtual int compare_type(const AssemblyKeyBase& key) const { const T& rhs = static_cast<const AssemblyKey&>(key).mKey; return android::compare_type(mKey, rhs); @@ -56,7 +56,7 @@ private: class Assembly { public: - Assembly(size_t size); + explicit Assembly(size_t size); virtual ~Assembly(); ssize_t size() const; @@ -80,13 +80,13 @@ class CodeCache { public: // pretty simple cache API... - CodeCache(size_t size); - ~CodeCache(); - - sp<Assembly> lookup(const AssemblyKeyBase& key) const; + explicit CodeCache(size_t size); + ~CodeCache(); - int cache( const AssemblyKeyBase& key, - const sp<Assembly>& assembly); + sp<Assembly> lookup(const AssemblyKeyBase& key) const; + + int cache(const AssemblyKeyBase& key, + const sp<Assembly>& assembly); private: // nothing to see here... @@ -105,7 +105,7 @@ private: const AssemblyKeyBase* mKey; public: key_t() { }; - key_t(const AssemblyKeyBase& k) : mKey(&k) { } + explicit key_t(const AssemblyKeyBase& k) : mKey(&k) { } }; mutable pthread_mutex_t mLock; diff --git a/libpixelflinger/codeflinger/GGLAssembler.h b/libpixelflinger/codeflinger/GGLAssembler.h index ecc242a50..47dbf3a33 100644 --- a/libpixelflinger/codeflinger/GGLAssembler.h +++ b/libpixelflinger/codeflinger/GGLAssembler.h @@ -49,7 +49,7 @@ class RegisterAllocator public: class RegisterFile; - RegisterAllocator(int arch); + RegisterAllocator(int arch); // NOLINT, implicit RegisterFile& registerFile(); int reserveReg(int reg); int obtainReg(); @@ -59,7 +59,7 @@ public: class RegisterFile { public: - RegisterFile(int arch); + RegisterFile(int arch); // NOLINT, implicit RegisterFile(const RegisterFile& rhs, int arch); ~RegisterFile(); @@ -101,7 +101,7 @@ public: class Scratch { public: - Scratch(RegisterFile& regFile) + explicit Scratch(RegisterFile& regFile) : mRegFile(regFile), mScratch(0) { } ~Scratch() { @@ -177,8 +177,8 @@ class GGLAssembler : public ARMAssemblerProxy, public RegisterAllocator { public: - GGLAssembler(ARMAssemblerInterface* target); - virtual ~GGLAssembler(); + explicit GGLAssembler(ARMAssemblerInterface* target); + virtual ~GGLAssembler(); uint32_t* base() const { return 0; } // XXX uint32_t* pc() const { return 0; } // XXX @@ -206,7 +206,7 @@ public: struct reg_t { reg_t() : reg(-1), flags(0) { } - reg_t(int r, int f=0) + reg_t(int r, int f=0) // NOLINT, implicit : reg(r), flags(f) { } void setTo(int r, int f=0) { @@ -219,7 +219,7 @@ public: struct integer_t : public reg_t { integer_t() : reg_t(), s(0) { } - integer_t(int r, int sz=32, int f=0) + integer_t(int r, int sz=32, int f=0) // NOLINT, implicit : reg_t(r, f), s(sz) { } void setTo(int r, int sz=32, int f=0) { @@ -251,7 +251,7 @@ public: struct component_t : public reg_t { component_t() : reg_t(), h(0), l(0) { } - component_t(int r, int f=0) + component_t(int r, int f=0) // NOLINT, implicit : reg_t(r, f), h(0), l(0) { } component_t(int r, int lo, int hi, int f=0) diff --git a/libpixelflinger/codeflinger/tinyutils/smartpointer.h b/libpixelflinger/codeflinger/tinyutils/smartpointer.h index 9d0a16e5c..23a5f7e54 100644 --- a/libpixelflinger/codeflinger/tinyutils/smartpointer.h +++ b/libpixelflinger/codeflinger/tinyutils/smartpointer.h @@ -51,10 +51,10 @@ class sp public: inline sp() : m_ptr(0) { } - sp(T* other); + sp(T* other); // NOLINT, implicit sp(const sp<T>& other); - template<typename U> sp(U* other); - template<typename U> sp(const sp<U>& other); + template<typename U> sp(U* other); // NOLINT, implicit + template<typename U> sp(const sp<U>& other); // NOLINT, implicit ~sp(); |