diff options
Diffstat (limited to 'opengl/tools/glgen')
16 files changed, 60 insertions, 15 deletions
diff --git a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp index a372362..f6813fd 100644 --- a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp +++ b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp @@ -16,6 +16,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include "jni.h" #include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> diff --git a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp index b5c19df..4df61d3 100644 --- a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp @@ -16,6 +16,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include "jni.h" #include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> @@ -81,23 +85,19 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); - jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); - eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); - jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); - eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); - jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); - eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); - jclass eglClass = _env->FindClass("android/opengl/EGL14"); jfieldID noContextFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_CONTEXT", "Landroid/opengl/EGLContext;"); - _env->SetStaticObjectField(eglClass, noContextFieldID, eglNoContextObject); + jobject localeglNoContextObject = _env->GetStaticObjectField(eglClass, noContextFieldID); + eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jfieldID noDisplayFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_DISPLAY", "Landroid/opengl/EGLDisplay;"); - _env->SetStaticObjectField(eglClass, noDisplayFieldID, eglNoDisplayObject); + jobject localeglNoDisplayObject = _env->GetStaticObjectField(eglClass, noDisplayFieldID); + eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jfieldID noSurfaceFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_SURFACE", "Landroid/opengl/EGLSurface;"); - _env->SetStaticObjectField(eglClass, noSurfaceFieldID, eglNoSurfaceObject); + jobject localeglNoSurfaceObject = _env->GetStaticObjectField(eglClass, noSurfaceFieldID); + eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); } static void * 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/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp index 8a1d5ed..1fa9275 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES/gl.h> #include <GLES/glext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp index 8a1d5ed..1fa9275 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES/gl.h> #include <GLES/glext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp index 8a1d5ed..1fa9275 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES/gl.h> #include <GLES/glext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp index 8a1d5ed..1fa9275 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES/gl.h> #include <GLES/glext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp index 2389563..4004a7d 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp index f5ec455..c5bdf32 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp @@ -17,6 +17,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES3/gl3.h> #include <GLES3/gl3ext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp index e7e3561..2260a80 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp @@ -16,6 +16,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <GLES3/gl31.h> #include <GLES2/gl2ext.h> diff --git a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp index c48ec7c..130612d 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp @@ -16,5 +16,9 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include <stdint.h> #include <GLES3/gl31.h> diff --git a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp index ce3bc8f..eda2e46 100644 --- a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp +++ b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp @@ -3,7 +3,7 @@ static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, jlong // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer. // GL checks for too-large values. Here we only need to check for successful signed 64-bit // to unsigned 32-bit conversion. - if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) { + if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) { jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large"); return; } diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp index 1833ee9..a091dc9 100644 --- a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp +++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp @@ -3,7 +3,7 @@ static void android_glDrawElementsIndirect(JNIEnv *_env, jobject, jint mode, jin // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer. // GL checks for too-large values. Here we only need to check for successful signed 64-bit // to unsigned 32-bit conversion. - if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) { + if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) { jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large"); return; } 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); diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp index df11c53..f5506ba 100644 --- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp +++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp @@ -16,6 +16,10 @@ // This source file is automatically generated +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-function" + #include "jni.h" #include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> |