diff options
| author | David 'Digit' Turner <digit@android.com> | 2014-01-14 11:57:18 +0100 |
|---|---|---|
| committer | David 'Digit' Turner <digit@google.com> | 2014-01-18 16:56:31 +0100 |
| commit | b81cc7bbd7baa35042af6c6b71edcfe94004bbcd (patch) | |
| tree | 409c961afb25f6768f38f76110dcf4466d39a4ca /emulator/opengl/host/libs/GLESv1_dec | |
| parent | 4a218a8b31d712290dce83cc65fc0a529fb10823 (diff) | |
| download | sdk-b81cc7bbd7baa35042af6c6b71edcfe94004bbcd.zip sdk-b81cc7bbd7baa35042af6c6b71edcfe94004bbcd.tar.gz sdk-b81cc7bbd7baa35042af6c6b71edcfe94004bbcd.tar.bz2 | |
emulator/opengl: Get rid of all compiler warnings (Linux).
This patch gets rid of all compiler warnings for the
GPU emulation libraries when building on a Linux host.
Note that GLcommon/GLutils.h now provides two new functions
to perform 'safe' type casts between unsigned integers and
pointers: SafePointerFromUInt() and SafeUIntFromPointer().
Change-Id: I01c48bbd72f925d70eb9831f57e15815e687121f
Diffstat (limited to 'emulator/opengl/host/libs/GLESv1_dec')
| -rw-r--r-- | emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp b/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp index 5399445..3c5bd70 100644 --- a/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp +++ b/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp @@ -21,6 +21,10 @@ #include <GLES/gl.h> #include <GLES/glext.h> +static inline void* SafePointerFromUInt(GLuint value) { + return (void*)(uintptr_t)value; +} + GLDecoder::GLDecoder() { m_contextData = NULL; @@ -88,43 +92,43 @@ int GLDecoder::s_glFinishRoundTrip(void *self) void GLDecoder::s_glVertexPointerOffset(void *self, GLint size, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glVertexPointer(size, type, stride, (void *)offset); + ctx->glVertexPointer(size, type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glColorPointerOffset(void *self, GLint size, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glColorPointer(size, type, stride, (void *)offset); + ctx->glColorPointer(size, type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glTexCoordPointerOffset(void *self, GLint size, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glTexCoordPointer(size, type, stride, (void *) offset); + ctx->glTexCoordPointer(size, type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glNormalPointerOffset(void *self, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glNormalPointer(type, stride, (void *)offset); + ctx->glNormalPointer(type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glPointSizePointerOffset(void *self, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glPointSizePointerOES(type, stride, (void *)offset); + ctx->glPointSizePointerOES(type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glWeightPointerOffset(void * self, GLint size, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glWeightPointerOES(size, type, stride, (void*)offset); + ctx->glWeightPointerOES(size, type, stride, SafePointerFromUInt(offset)); } void GLDecoder::s_glMatrixIndexPointerOffset(void * self, GLint size, GLenum type, GLsizei stride, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glMatrixIndexPointerOES(size, type, stride, (void*)offset); + ctx->glMatrixIndexPointerOES(size, type, stride, SafePointerFromUInt(offset)); } @@ -204,7 +208,7 @@ void GLDecoder::s_glMatrixIndexPointerData(void * self, GLint size, GLenum type, void GLDecoder::s_glDrawElementsOffset(void *self, GLenum mode, GLsizei count, GLenum type, GLuint offset) { GLDecoder *ctx = (GLDecoder *)self; - ctx->glDrawElements(mode, count, type, (void *)offset); + ctx->glDrawElements(mode, count, type, SafePointerFromUInt(offset)); } void GLDecoder::s_glDrawElementsData(void *self, GLenum mode, GLsizei count, GLenum type, void * data, GLuint datalen) |
