From 223a765dbc9b6bf6a20fff842c1fdf2cbf7fe529 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 30 Oct 2014 21:32:28 +0100 Subject: opengl: Remove compiler warnings. Simply remove multiple compiler warnings about unused parameter. Note that this modifies three auto-generated files, which will require fixing the 'emugen' program in the future. Change-Id: I19edce7c6480770b893d033ed6b1c65744091d62 --- opengl/shared/OpenglCodecCommon/FixedBuffer.h | 2 +- opengl/system/GLESv1/gl.cpp | 7 ++++ opengl/system/GLESv1_enc/GLEncoder.cpp | 2 + opengl/system/GLESv1_enc/gl_client_context.h | 2 +- opengl/system/GLESv2/gl2.cpp | 8 ++++ opengl/system/GLESv2_enc/GL2Encoder.cpp | 4 ++ opengl/system/GLESv2_enc/gl2_client_context.h | 2 +- opengl/system/OpenglSystemCommon/ThreadInfo.cpp | 2 +- opengl/system/egl/egl.cpp | 45 ++++++++++++++++++++-- opengl/system/gralloc/gralloc.cpp | 7 ++++ .../renderControl_client_context.h | 2 +- 11 files changed, 74 insertions(+), 9 deletions(-) (limited to 'opengl') diff --git a/opengl/shared/OpenglCodecCommon/FixedBuffer.h b/opengl/shared/OpenglCodecCommon/FixedBuffer.h index 30b9a80..7026396 100644 --- a/opengl/shared/OpenglCodecCommon/FixedBuffer.h +++ b/opengl/shared/OpenglCodecCommon/FixedBuffer.h @@ -20,7 +20,7 @@ class FixedBuffer { public: FixedBuffer(size_t initialSize = 0) { m_buffer = NULL; - m_bufferLen = 0; + m_bufferLen = initialSize; alloc(m_bufferLen); } diff --git a/opengl/system/GLESv1/gl.cpp b/opengl/system/GLESv1/gl.cpp index c684d14..a7950eb 100644 --- a/opengl/system/GLESv1/gl.cpp +++ b/opengl/system/GLESv1/gl.cpp @@ -50,6 +50,8 @@ static EGLClient_glesInterface * s_gl = NULL; //GL extensions void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES image) { + (void)self; + DBG("glEGLImageTargetTexture2DOES v1 target=%#x image=%p", target, image); //TODO: check error - we don't have a way to set gl error android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; @@ -75,6 +77,9 @@ void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES imag void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image) { + (void)self; + (void)target; + DBG("glEGLImageTargetRenderbufferStorageOES v1 target=%#x image=%p", target, image); //TODO: check error - we don't have a way to set gl error @@ -113,6 +118,8 @@ void finish() const GLubyte *my_glGetString (void *self, GLenum name) { + (void)self; + if (s_egl) { return (const GLubyte*)s_egl->getGLString(name); } diff --git a/opengl/system/GLESv1_enc/GLEncoder.cpp b/opengl/system/GLESv1_enc/GLEncoder.cpp index ae00ca7..0fe1d8e 100644 --- a/opengl/system/GLESv1_enc/GLEncoder.cpp +++ b/opengl/system/GLESv1_enc/GLEncoder.cpp @@ -235,6 +235,8 @@ void GLEncoder::s_glFlush(void *self) const GLubyte *GLEncoder::s_glGetString(void *self, GLenum name) { + (void)self; + GLubyte *retval = (GLubyte *) ""; switch(name) { case GL_VENDOR: diff --git a/opengl/system/GLESv1_enc/gl_client_context.h b/opengl/system/GLESv1_enc/gl_client_context.h index aa058ec..35fb27a 100644 --- a/opengl/system/GLESv1_enc/gl_client_context.h +++ b/opengl/system/GLESv1_enc/gl_client_context.h @@ -304,7 +304,7 @@ struct gl_client_context_t { typedef gl_client_context_t *CONTEXT_ACCESSOR_TYPE(void); static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); - virtual void setError(unsigned int error){}; + virtual void setError(unsigned int error){ (void)error; }; virtual unsigned int getError(){ return 0; }; }; diff --git a/opengl/system/GLESv2/gl2.cpp b/opengl/system/GLESv2/gl2.cpp index e6b4d0b..e545779 100644 --- a/opengl/system/GLESv2/gl2.cpp +++ b/opengl/system/GLESv2/gl2.cpp @@ -50,6 +50,9 @@ static EGLClient_glesInterface * s_gl = NULL; //GL extensions void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES image) { + (void)self; + (void)target; + DBG("glEGLImageTargetTexture2DOES v2 target=%#x img=%p\n", target, image); //TODO: check error - we don't have a way to set gl error android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; @@ -74,6 +77,9 @@ void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES imag void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image) { + (void)self; + (void)target; + DBG("glEGLImageTargetRenderbufferStorageOES v2 image=%p\n", image); //TODO: check error - we don't have a way to set gl error android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; @@ -110,6 +116,8 @@ void finish() const GLubyte *my_glGetString (void *self, GLenum name) { + (void)self; + if (s_egl) { return (const GLubyte*)s_egl->getGLString(name); } diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp index 3b2100e..9490571 100644 --- a/opengl/system/GLESv2_enc/GL2Encoder.cpp +++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp @@ -150,6 +150,8 @@ void GL2Encoder::s_glFlush(void *self) const GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name) { + (void)self; + GLubyte *retval = (GLubyte *) ""; switch(name) { case GL_VENDOR: @@ -403,6 +405,8 @@ void GL2Encoder::s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pn GL2Encoder *ctx = (GL2Encoder *)self; if (ctx->m_state == NULL) return; + (void)pname; + const GLClientState::VertexAttribState *va_state = ctx->m_state->getState(index); if (va_state != NULL) { *pointer = va_state->data; diff --git a/opengl/system/GLESv2_enc/gl2_client_context.h b/opengl/system/GLESv2_enc/gl2_client_context.h index a92f4bb..87d62d5 100644 --- a/opengl/system/GLESv2_enc/gl2_client_context.h +++ b/opengl/system/GLESv2_enc/gl2_client_context.h @@ -221,7 +221,7 @@ struct gl2_client_context_t { typedef gl2_client_context_t *CONTEXT_ACCESSOR_TYPE(void); static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); - virtual void setError(unsigned int error){}; + virtual void setError(unsigned int error){ (void)error; }; virtual unsigned int getError(){ return 0; }; }; diff --git a/opengl/system/OpenglSystemCommon/ThreadInfo.cpp b/opengl/system/OpenglSystemCommon/ThreadInfo.cpp index f9c8521..04ce508 100644 --- a/opengl/system/OpenglSystemCommon/ThreadInfo.cpp +++ b/opengl/system/OpenglSystemCommon/ThreadInfo.cpp @@ -24,7 +24,7 @@ static void tlsDestruct(void *ptr) EGLThreadInfo *ti = (EGLThreadInfo *)ptr; delete ti->hostConn; delete ti; - ((intptr_t *)__get_tls())[TLS_SLOT_OPENGL] = NULL; + ((void **)__get_tls())[TLS_SLOT_OPENGL] = NULL; } } diff --git a/opengl/system/egl/egl.cpp b/opengl/system/egl/egl.cpp index daa52de..7ff7429 100644 --- a/opengl/system/egl/egl.cpp +++ b/opengl/system/egl/egl.cpp @@ -336,7 +336,7 @@ struct egl_pbuffer_surface_t : public egl_surface_t { virtual ~egl_pbuffer_surface_t(); - virtual void setSwapInterval(int interval) {} + virtual void setSwapInterval(int interval) { (void)interval; } virtual EGLBoolean swapBuffers() { return EGL_TRUE; } uint32_t getRcColorBuffer() { return rcColorBuffer; } @@ -542,7 +542,7 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name) EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) { - VALIDATE_DISPLAY_INIT(dpy, NULL); + VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE); if(!num_config) { RETURN_ERROR(EGL_FALSE,EGL_BAD_PARAMETER); @@ -554,7 +554,7 @@ EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, return EGL_TRUE; } - uintptr_t i=0; + EGLint i=0; for (i=0 ; i