summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2016-09-01 11:26:34 -0700
committer Chih-Hung Hsieh <chh@google.com> 2016-09-01 11:26:34 -0700
commite8761d60a00ec47e5ed05539881fec81935a378d (patch)
tree6d7d6c5ec1c472508526145f09b1afd95c50a608
parent0322a7176f4c432cae50c72657ad31a8c3b43016 (diff)
Fix google-explicit-constructor warnings in opengl.
* Add explicit keyword to conversion constructors, or use NOLINT for implicit converters. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I2508bb5c81e8fc7878a8ab5ee95cdf2c87729d85
-rw-r--r--opengl/libs/EGL/Loader.h2
-rw-r--r--opengl/libs/EGL/egl_object.h4
-rw-r--r--opengl/tests/hwc/hwcTestLib.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/opengl/libs/EGL/Loader.h b/opengl/libs/EGL/Loader.h
index 8cefe32764..94f680e9ea 100644
--- a/opengl/libs/EGL/Loader.h
+++ b/opengl/libs/EGL/Loader.h
@@ -46,7 +46,7 @@ class Loader : public Singleton<Loader>
GLESv2 = 0x04
};
struct driver_t {
- driver_t(void* gles);
+ explicit driver_t(void* gles);
~driver_t();
status_t set(void* hnd, int32_t api);
void* dso[3];
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index 8f3b9cb2b5..8ceba1d892 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -48,7 +48,7 @@ protected:
virtual void terminate();
public:
- egl_object_t(egl_display_t* display);
+ explicit egl_object_t(egl_display_t* display);
void destroy();
inline void incRef() { count.fetch_add(1, std::memory_order_relaxed); }
@@ -63,7 +63,7 @@ public:
class LocalRef {
egl_object_t* ref;
LocalRef();
- LocalRef(const LocalRef* rhs);
+ explicit LocalRef(const LocalRef* rhs);
public:
~LocalRef();
explicit LocalRef(egl_object_t* rhs);
diff --git a/opengl/tests/hwc/hwcTestLib.h b/opengl/tests/hwc/hwcTestLib.h
index a942c10e34..922fc1990b 100644
--- a/opengl/tests/hwc/hwcTestLib.h
+++ b/opengl/tests/hwc/hwcTestLib.h
@@ -71,7 +71,7 @@ class ColorFract {
class ColorRGB {
public:
ColorRGB(): _r(0.0), _g(0.0), _b(0.0) {};
- ColorRGB(float f): _r(f), _g(f), _b(f) {}; // Gray
+ ColorRGB(float f): _r(f), _g(f), _b(f) {}; // Gray, NOLINT(implicit)
ColorRGB(float r, float g, float b): _r(r), _g(g), _b(b) {};
float r(void) const { return _r; }
float g(void) const { return _g; }