summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh2016-07-12 15:50:44 -0500
committerChih-Hung Hsieh2016-07-26 13:26:01 -0500
commit034c475931e8e4da54b499c0056121490f029865 (patch)
treed07eac290b1d3744cd60ebe76486e0c2c937ea3d /libpixelflinger
parent02ccdc5db9bb39488a3fe22a907b3211c3a464b9 (diff)
downloadplatform-system-core-034c475931e8e4da54b499c0056121490f029865.tar.gz
platform-system-core-034c475931e8e4da54b499c0056121490f029865.tar.xz
platform-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.h2
-rw-r--r--libpixelflinger/codeflinger/ARMAssemblerProxy.h2
-rw-r--r--libpixelflinger/codeflinger/Arm64Assembler.h4
-rw-r--r--libpixelflinger/codeflinger/CodeCache.h18
-rw-r--r--libpixelflinger/codeflinger/GGLAssembler.h16
-rw-r--r--libpixelflinger/codeflinger/tinyutils/smartpointer.h6
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 {
35class ARMAssembler : public ARMAssemblerInterface 35class ARMAssembler : public ARMAssemblerInterface
36{ 36{
37public: 37public:
38 ARMAssembler(const sp<Assembly>& assembly); 38 explicit ARMAssembler(const sp<Assembly>& assembly);
39 virtual ~ARMAssembler(); 39 virtual ~ARMAssembler();
40 40
41 uint32_t* base() const; 41 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:
34 // ARMAssemblerProxy take ownership of the target 34 // ARMAssemblerProxy take ownership of the target
35 35
36 ARMAssemblerProxy(); 36 ARMAssemblerProxy();
37 ARMAssemblerProxy(ARMAssemblerInterface* target); 37 explicit ARMAssemblerProxy(ARMAssemblerInterface* target);
38 virtual ~ARMAssemblerProxy(); 38 virtual ~ARMAssemblerProxy();
39 39
40 void setTarget(ARMAssemblerInterface* target); 40 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 {
47class ArmToArm64Assembler : public ARMAssemblerInterface 47class ArmToArm64Assembler : public ARMAssemblerInterface
48{ 48{
49public: 49public:
50 ArmToArm64Assembler(const sp<Assembly>& assembly); 50 explicit ArmToArm64Assembler(const sp<Assembly>& assembly);
51 ArmToArm64Assembler(void *base); 51 explicit ArmToArm64Assembler(void *base);
52 virtual ~ArmToArm64Assembler(); 52 virtual ~ArmToArm64Assembler();
53 53
54 uint32_t* base() const; 54 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>
42class AssemblyKey : public AssemblyKeyBase 42class AssemblyKey : public AssemblyKeyBase
43{ 43{
44public: 44public:
45 AssemblyKey(const T& rhs) : mKey(rhs) { } 45 explicit AssemblyKey(const T& rhs) : mKey(rhs) { }
46 virtual int compare_type(const AssemblyKeyBase& key) const { 46 virtual int compare_type(const AssemblyKeyBase& key) const {
47 const T& rhs = static_cast<const AssemblyKey&>(key).mKey; 47 const T& rhs = static_cast<const AssemblyKey&>(key).mKey;
48 return android::compare_type(mKey, rhs); 48 return android::compare_type(mKey, rhs);
@@ -56,7 +56,7 @@ private:
56class Assembly 56class Assembly
57{ 57{
58public: 58public:
59 Assembly(size_t size); 59 explicit Assembly(size_t size);
60 virtual ~Assembly(); 60 virtual ~Assembly();
61 61
62 ssize_t size() const; 62 ssize_t size() const;
@@ -80,13 +80,13 @@ class CodeCache
80{ 80{
81public: 81public:
82// pretty simple cache API... 82// pretty simple cache API...
83 CodeCache(size_t size); 83 explicit CodeCache(size_t size);
84 ~CodeCache(); 84 ~CodeCache();
85
86 sp<Assembly> lookup(const AssemblyKeyBase& key) const;
87 85
88 int cache( const AssemblyKeyBase& key, 86 sp<Assembly> lookup(const AssemblyKeyBase& key) const;
89 const sp<Assembly>& assembly); 87
88 int cache(const AssemblyKeyBase& key,
89 const sp<Assembly>& assembly);
90 90
91private: 91private:
92 // nothing to see here... 92 // nothing to see here...
@@ -105,7 +105,7 @@ private:
105 const AssemblyKeyBase* mKey; 105 const AssemblyKeyBase* mKey;
106 public: 106 public:
107 key_t() { }; 107 key_t() { };
108 key_t(const AssemblyKeyBase& k) : mKey(&k) { } 108 explicit key_t(const AssemblyKeyBase& k) : mKey(&k) { }
109 }; 109 };
110 110
111 mutable pthread_mutex_t mLock; 111 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
49public: 49public:
50 class RegisterFile; 50 class RegisterFile;
51 51
52 RegisterAllocator(int arch); 52 RegisterAllocator(int arch); // NOLINT, implicit
53 RegisterFile& registerFile(); 53 RegisterFile& registerFile();
54 int reserveReg(int reg); 54 int reserveReg(int reg);
55 int obtainReg(); 55 int obtainReg();
@@ -59,7 +59,7 @@ public:
59 class RegisterFile 59 class RegisterFile
60 { 60 {
61 public: 61 public:
62 RegisterFile(int arch); 62 RegisterFile(int arch); // NOLINT, implicit
63 RegisterFile(const RegisterFile& rhs, int arch); 63 RegisterFile(const RegisterFile& rhs, int arch);
64 ~RegisterFile(); 64 ~RegisterFile();
65 65
@@ -101,7 +101,7 @@ public:
101 class Scratch 101 class Scratch
102 { 102 {
103 public: 103 public:
104 Scratch(RegisterFile& regFile) 104 explicit Scratch(RegisterFile& regFile)
105 : mRegFile(regFile), mScratch(0) { 105 : mRegFile(regFile), mScratch(0) {
106 } 106 }
107 ~Scratch() { 107 ~Scratch() {
@@ -177,8 +177,8 @@ class GGLAssembler : public ARMAssemblerProxy, public RegisterAllocator
177{ 177{
178public: 178public:
179 179
180 GGLAssembler(ARMAssemblerInterface* target); 180 explicit GGLAssembler(ARMAssemblerInterface* target);
181 virtual ~GGLAssembler(); 181 virtual ~GGLAssembler();
182 182
183 uint32_t* base() const { return 0; } // XXX 183 uint32_t* base() const { return 0; } // XXX
184 uint32_t* pc() const { return 0; } // XXX 184 uint32_t* pc() const { return 0; } // XXX
@@ -206,7 +206,7 @@ public:
206 struct reg_t { 206 struct reg_t {
207 reg_t() : reg(-1), flags(0) { 207 reg_t() : reg(-1), flags(0) {
208 } 208 }
209 reg_t(int r, int f=0) 209 reg_t(int r, int f=0) // NOLINT, implicit
210 : reg(r), flags(f) { 210 : reg(r), flags(f) {
211 } 211 }
212 void setTo(int r, int f=0) { 212 void setTo(int r, int f=0) {
@@ -219,7 +219,7 @@ public:
219 struct integer_t : public reg_t { 219 struct integer_t : public reg_t {
220 integer_t() : reg_t(), s(0) { 220 integer_t() : reg_t(), s(0) {
221 } 221 }
222 integer_t(int r, int sz=32, int f=0) 222 integer_t(int r, int sz=32, int f=0) // NOLINT, implicit
223 : reg_t(r, f), s(sz) { 223 : reg_t(r, f), s(sz) {
224 } 224 }
225 void setTo(int r, int sz=32, int f=0) { 225 void setTo(int r, int sz=32, int f=0) {
@@ -251,7 +251,7 @@ public:
251 struct component_t : public reg_t { 251 struct component_t : public reg_t {
252 component_t() : reg_t(), h(0), l(0) { 252 component_t() : reg_t(), h(0), l(0) {
253 } 253 }
254 component_t(int r, int f=0) 254 component_t(int r, int f=0) // NOLINT, implicit
255 : reg_t(r, f), h(0), l(0) { 255 : reg_t(r, f), h(0), l(0) {
256 } 256 }
257 component_t(int r, int lo, int hi, int f=0) 257 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
51public: 51public:
52 inline sp() : m_ptr(0) { } 52 inline sp() : m_ptr(0) { }
53 53
54 sp(T* other); 54 sp(T* other); // NOLINT, implicit
55 sp(const sp<T>& other); 55 sp(const sp<T>& other);
56 template<typename U> sp(U* other); 56 template<typename U> sp(U* other); // NOLINT, implicit
57 template<typename U> sp(const sp<U>& other); 57 template<typename U> sp(const sp<U>& other); // NOLINT, implicit
58 58
59 ~sp(); 59 ~sp();
60 60