Frameworks/native: Add pragmas to glgen headers

The code currently being generated by glgen is not the cleanest, but
we would like to get core/jni onto -Werror. Thus add pragmas turning
off warnings locally to the C headers.

Also fix signed-comparison in two functions.

Longer term TODO: Emit clean code.

Change-Id: Iee8582f8c0c1de076d64851d3b6ca467afd5bc43
This commit is contained in:
Andreas Gampe 2014-11-10 22:51:01 -08:00
parent c6f93a43d6
commit b5da0d78d2
13 changed files with 46 additions and 2 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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>