aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-04-28 12:37:51 +0200
committerDavid 'Digit' Turner <digit@google.com>2014-04-28 12:45:16 +0200
commit88a8c6a97f1214871348afe30a5b4ef54e99a0a4 (patch)
treeca5573aa6131ff65ccda71e63fb3d83f7ccf480b /emulator/opengl/host
parent0c5d08da8a14a3ec54578270036012829de97ef2 (diff)
downloadsdk-88a8c6a97f1214871348afe30a5b4ef54e99a0a4.zip
sdk-88a8c6a97f1214871348afe30a5b4ef54e99a0a4.tar.gz
sdk-88a8c6a97f1214871348afe30a5b4ef54e99a0a4.tar.bz2
emulator/opengl: Fix GCC 4.8 warnings.
This fixes a few compiler warnings when building the GPU emulation libraries with GCC 4.8. Note that GLbyte is defined as khronos_int8_t which is signed! Change-Id: I52027cd2eb20d6162983319f22d4da150ff514ed
Diffstat (limited to 'emulator/opengl/host')
-rw-r--r--emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp7
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp10
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp37
3 files changed, 27 insertions, 27 deletions
diff --git a/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp b/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp
index c245ba5..5b48fcb 100644
--- a/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp
+++ b/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp
@@ -20,8 +20,7 @@
#include <stdio.h>
#define IS_TRUE(a) \
- if(a != true) return false;
-
+ if(a != true) return NULL;
struct DisplayInfo{
DisplayInfo():dc(NULL),hwnd(NULL),isPixelFormatSet(false){};
@@ -48,9 +47,7 @@ static TlsData *getTLS() {
class WinDisplay{
public:
- typedef enum {
- DEFAULT_DISPLAY = 0
- };
+ enum { DEFAULT_DISPLAY = 0 };
WinDisplay(){};
DisplayInfo& getInfo(int configurationIndex){ return getTLS()->m_map[configurationIndex];}
HDC getDC(int configId){return getTLS()->m_map[configId].dc;}
diff --git a/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp b/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
index 7ab177f..3443f59 100644
--- a/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
@@ -2230,10 +2230,12 @@ void glDrawTexOES (T x, T y, T z, T width, T height) {
GLint viewport[4];
z = (z>1 ? 1 : (z<0 ? 0 : z));
- T vertices[4*3] = {x , y, z,
- x , y+height, z,
- x+width, y+height, z,
- x+width, y, z};
+ T vertices[4*3] = {
+ x , y, z,
+ x , static_cast<T>(y+height), z,
+ static_cast<T>(x+width), static_cast<T>(y+height), z,
+ static_cast<T>(x+width), y, z
+ };
GLfloat texels[ctx->getMaxTexUnits()][4*2];
memset((void*)texels, 0, ctx->getMaxTexUnits()*4*2*sizeof(GLfloat));
diff --git a/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp b/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
index c0e3c5c..7b217fd 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
+++ b/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
@@ -45,25 +45,26 @@ static GL_FUNC_PTR getGLFuncAddress(const char *funcName) {
return ret;
}
-#define LOAD_GL_FUNC(name) { void * funcAddrs = NULL; \
- if(name == NULL){ \
- funcAddrs = (void *)getGLFuncAddress(#name); \
- if(funcAddrs){ \
- *(void**)(void*)(&name) = funcAddrs; \
- } else { \
- fprintf(stderr,"could not load func %s\n",#name); \
- *(void**)(void*)(&name) = (void *)dummy_##name; \
- } \
- } \
- }
+#define LOAD_GL_FUNC(name) do { \
+ if (!name) { \
+ void* funcAddress = (void *)getGLFuncAddress(#name); \
+ if (funcAddress) { \
+ name = (__typeof__(name))(funcAddress); \
+ } else { \
+ fprintf(stderr, "Could not load func %s\n", #name); \
+ name = (__typeof__(name))(dummy_##name); \
+ } \
+ } \
+ } while (0)
-#define LOAD_GLEXT_FUNC(name) { void * funcAddrs = NULL; \
- if(name == NULL){ \
- funcAddrs = (void *)getGLFuncAddress(#name); \
- if(funcAddrs) \
- *(void**)(void*)(&name) = funcAddrs; \
- } \
- }
+#define LOAD_GLEXT_FUNC(name) do { \
+ if (!name) { \
+ void* funcAddress = (void *)getGLFuncAddress(#name); \
+ if (funcAddress) { \
+ name = (__typeof__(name))(funcAddress); \
+ } \
+ } \
+ } while (0)
/* initializing static GLDispatch members*/