summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-02-25 22:50:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-25 22:50:10 +0000
commit797498450cbcb87c28636e775ada942005436909 (patch)
tree503ba150654fd02a90b75f8aaea6598d1a4d972b /opengl
parentd80268ba19f9217c5459a2952580090ef84a7b78 (diff)
parentad0f52fc2be6161f61fd95e4f12739c65661673a (diff)
downloadframeworks_native-797498450cbcb87c28636e775ada942005436909.zip
frameworks_native-797498450cbcb87c28636e775ada942005436909.tar.gz
frameworks_native-797498450cbcb87c28636e775ada942005436909.tar.bz2
Merge "Fix pointer-to-int and int-to-pointer warnings."
Diffstat (limited to 'opengl')
-rwxr-xr-xopengl/tools/glgen/stubs/egl/eglGetDisplay.cpp3
-rw-r--r--opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp6
3 files changed, 8 insertions, 3 deletions
diff --git a/opengl/tools/glgen/stubs/egl/eglGetDisplay.cpp b/opengl/tools/glgen/stubs/egl/eglGetDisplay.cpp
index 003efd3..2abc916 100755
--- a/opengl/tools/glgen/stubs/egl/eglGetDisplay.cpp
+++ b/opengl/tools/glgen/stubs/egl/eglGetDisplay.cpp
@@ -14,7 +14,8 @@ static jobject
android_eglGetDisplayInt
(JNIEnv *_env, jobject _this, jint display_id) {
- if ((EGLNativeDisplayType)display_id != EGL_DEFAULT_DISPLAY) {
+ if (static_cast<uintptr_t>(display_id) !=
+ reinterpret_cast<uintptr_t>(EGL_DEFAULT_DISPLAY)) {
jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglGetDisplay");
return 0;
}
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp
index 41df486..d844152 100644
--- a/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp
@@ -32,7 +32,7 @@ android_glDrawElementsInstanced__IIIII
(GLenum)mode,
(GLsizei)count,
(GLenum)type,
- (GLvoid *)indicesOffset,
+ (GLvoid *)static_cast<uintptr_t>(indicesOffset),
(GLsizei)instanceCount
);
}
diff --git a/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp
index 0514fe9..a977693 100644
--- a/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp
@@ -157,7 +157,11 @@ android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuff
(GLsizei *)length,
(GLint *)size,
(GLenum *)type,
- (char *)name
+ // The cast below is incorrect. The driver will end up writing to the
+ // address specified by name, which will always crash the process since
+ // it is guaranteed to be in low memory. The additional static_cast
+ // suppresses the warning for now. http://b/19478262
+ (char *)static_cast<uintptr_t>(name)
);
if (_typeArray) {
releasePointer(_env, _typeArray, type, JNI_TRUE);