diff options
author | 2017-10-26 15:18:12 -0700 | |
---|---|---|
committer | 2017-10-26 15:20:53 -0700 | |
commit | 1e02a62b7b88273b087c056af5d46896233a3e9d (patch) | |
tree | ba73d1ee23a522420a6229b6165dc979525ed646 | |
parent | 263921f53cdddc6becac4bfa07e3fb27764adc12 (diff) |
Use -Werror in frameworks/native/opengl/libagl
* Remove unused local variables and functions.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ib8e3ee6e3c1ee3cf1e26f265fc87890f1690c6a2
-rw-r--r-- | opengl/libagl/Android.mk | 2 | ||||
-rw-r--r-- | opengl/libagl/array.cpp | 4 | ||||
-rw-r--r-- | opengl/libagl/egl.cpp | 3 | ||||
-rw-r--r-- | opengl/libagl/light.cpp | 1 | ||||
-rw-r--r-- | opengl/libagl/matrix.cpp | 11 | ||||
-rw-r--r-- | opengl/libagl/primitives.cpp | 1 | ||||
-rw-r--r-- | opengl/libagl/texture.cpp | 6 |
7 files changed, 6 insertions, 22 deletions
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index c7635e27c7..15a12e458d 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -38,6 +38,8 @@ LOCAL_CFLAGS_mips += -fstrict-aliasing # The graphics code can generate division by zero LOCAL_CFLAGS_mips += -mno-check-zero-division +LOCAL_CFLAGS += -Wall -Werror + # we need to access the private Bionic header <bionic_tls.h> LOCAL_C_INCLUDES += bionic/libc/private diff --git a/opengl/libagl/array.cpp b/opengl/libagl/array.cpp index 54207fa212..2d36c6194e 100644 --- a/opengl/libagl/array.cpp +++ b/opengl/libagl/array.cpp @@ -136,9 +136,6 @@ void ogles_uninit_array(ogles_context_t* c) static void currentColor(ogles_context_t* c, GLfixed* v, const GLvoid*) { memcpy(v, c->current.color.v, sizeof(vec4_t)); } -static void currentColor_clamp(ogles_context_t* c, GLfixed* v, const GLvoid*) { - memcpy(v, c->currentColorClamped.v, sizeof(vec4_t)); -} static void currentNormal(ogles_context_t* c, GLfixed* v, const GLvoid*) { memcpy(v, c->currentNormal.v, sizeof(vec3_t)); } @@ -349,6 +346,7 @@ void vertex_cache_t::init() { // make sure the size of vertex_t allows cache-line alignment CTA<(sizeof(vertex_t) & 0x1F) == 0> assertAlignedSize; + (void)assertAlignedSize; // suppress unused warning. const int align = 32; const size_t s = VERTEX_BUFFER_SIZE + VERTEX_CACHE_SIZE; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index b79051c499..be437054ce 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -81,7 +81,9 @@ namespace android { const unsigned int NUM_DISPLAYS = 1; +#ifndef __ANDROID__ static pthread_mutex_t gInitMutex = PTHREAD_MUTEX_INITIALIZER; +#endif static pthread_mutex_t gErrorKeyMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t gEGLErrorKey = -1; #ifndef __ANDROID__ @@ -1776,7 +1778,6 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, // if we're detaching, we need the current context current_ctx = (EGLContext)getGlThreadSpecific(); } else { - egl_context_t* c = egl_context_t::context(ctx); egl_surface_t* d = (egl_surface_t*)draw; egl_surface_t* r = (egl_surface_t*)read; if ((d && d->ctx && d->ctx != ctx) || diff --git a/opengl/libagl/light.cpp b/opengl/libagl/light.cpp index e7fe9d71a3..216c725128 100644 --- a/opengl/libagl/light.cpp +++ b/opengl/libagl/light.cpp @@ -467,7 +467,6 @@ static void lightx(GLenum i, GLenum pname, GLfixed param, ogles_context_t* c) } light_t& light = c->lighting.lights[i-GL_LIGHT0]; - const GLfixed kDegToRad = GLfixed((M_PI * gglIntToFixed(1)) / 180.0f); switch (pname) { case GL_SPOT_EXPONENT: if (GGLfixed(param) >= gglIntToFixed(128)) { diff --git a/opengl/libagl/matrix.cpp b/opengl/libagl/matrix.cpp index 034c857fa7..edd474d30c 100644 --- a/opengl/libagl/matrix.cpp +++ b/opengl/libagl/matrix.cpp @@ -51,7 +51,6 @@ static const matrixx_t gIdentityx = { static void point2__nop(transform_t const*, vec4_t* c, vec4_t const* o); static void point3__nop(transform_t const*, vec4_t* c, vec4_t const* o); static void point4__nop(transform_t const*, vec4_t* c, vec4_t const* o); -static void normal__nop(transform_t const*, vec4_t* c, vec4_t const* o); static void point2__generic(transform_t const*, vec4_t* c, vec4_t const* o); static void point3__generic(transform_t const*, vec4_t* c, vec4_t const* o); static void point4__generic(transform_t const*, vec4_t* c, vec4_t const* o); @@ -524,16 +523,6 @@ void transform_state_t::update_mvp() } } -static inline -GLfloat det22(GLfloat a, GLfloat b, GLfloat c, GLfloat d) { - return a*d - b*c; -} - -static inline -GLfloat ndet22(GLfloat a, GLfloat b, GLfloat c, GLfloat d) { - return b*c - a*d; -} - static __attribute__((noinline)) void invert(GLfloat* inverse, const GLfloat* src) { diff --git a/opengl/libagl/primitives.cpp b/opengl/libagl/primitives.cpp index 57a798deb3..d3b19e8e6d 100644 --- a/opengl/libagl/primitives.cpp +++ b/opengl/libagl/primitives.cpp @@ -241,6 +241,7 @@ void compute_iterators_t::initTriangle( m_dx20 = v0->window.x - v2->window.x; m_dy02 = v2->window.y - v0->window.y; m_area = m_dx01*m_dy02 + (-m_dy10)*m_dx20; + (void)m_reserved; // suppress unused warning } void compute_iterators_t::initLine( diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 3fe5ed0630..aae8e058bf 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -356,10 +356,6 @@ int createTextureSurface(ogles_context_t* c, GLenum format, GLenum type, GLsizei width, GLsizei height, GLenum compressedFormat = 0) { - // find out which texture is bound to the current unit - const int active = c->textures.active; - const GLuint name = c->textures.tmu[active].name; - // convert the pixelformat to one we can handle const int32_t formatIdx = convertGLPixelFormat(format, type); if (formatIdx == 0) { // we don't know what to do with this @@ -1192,7 +1188,6 @@ void glTexImage2D( const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]); const int32_t align = c->textures.unpackAlignment-1; const int32_t bpr = ((width * pixelFormat.size) + align) & ~align; - const size_t size = bpr * height; const int32_t stride = bpr / pixelFormat.size; GGLSurface userSurface; @@ -1276,7 +1271,6 @@ void glTexSubImage2D( const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]); const int32_t align = c->textures.unpackAlignment-1; const int32_t bpr = ((width * pixelFormat.size) + align) & ~align; - const size_t size = bpr * height; const int32_t stride = bpr / pixelFormat.size; GGLSurface userSurface; userSurface.version = sizeof(userSurface); |