summaryrefslogtreecommitdiffstats
path: root/opengl/tools
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2014-02-15 12:51:43 +0000
committerAshok Bhat <ashok.bhat@arm.com>2014-02-24 14:34:16 +0000
commitd8f096114da14f9793d4cca6022ca41b70ab9daa (patch)
tree6e2af37f3245bca88e4b988151461182581f8ddb /opengl/tools
parentd1c87d37025c49f6a47fe43328572da495ff04c1 (diff)
downloadframeworks_native-d8f096114da14f9793d4cca6022ca41b70ab9daa.zip
frameworks_native-d8f096114da14f9793d4cca6022ca41b70ab9daa.tar.gz
frameworks_native-d8f096114da14f9793d4cca6022ca41b70ab9daa.tar.bz2
Use reinterpret_cast when an integer is cast to a pointer
Change-Id: I5adcd59f58c029f7b2b596f4826d8ea69fb9bba6 Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Diffstat (limited to 'opengl/tools')
-rw-r--r--opengl/tools/glgen/src/JniCodeEmitter.java4
-rw-r--r--opengl/tools/glgen/stubs/gles11/common.cpp2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp2
-rw-r--r--opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp2
6 files changed, 8 insertions, 6 deletions
diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java
index b1bd1fd..e51b7a2 100644
--- a/opengl/tools/glgen/src/JniCodeEmitter.java
+++ b/opengl/tools/glgen/src/JniCodeEmitter.java
@@ -1283,7 +1283,7 @@ public class JniCodeEmitter {
for (int i = 0; i < numArgs; i++) {
String typecast;
if (i == numArgs - 1 && isPointerOffsetFunc) {
- typecast = "(GLvoid *)";
+ typecast = "reinterpret_cast<GLvoid *>";
} else {
typecast = "(" + cfunc.getArgType(i).getDeclaration() + ")";
}
@@ -1297,6 +1297,8 @@ public class JniCodeEmitter {
if (cfunc.getArgType(i).isEGLHandle() &&
!cfunc.getArgType(i).isPointer()){
out.print(cfunc.getArgName(i)+"_native");
+ } else if (i == numArgs - 1 && isPointerOffsetFunc){
+ out.print("("+cfunc.getArgName(i)+")");
} else {
out.print(cfunc.getArgName(i));
}
diff --git a/opengl/tools/glgen/stubs/gles11/common.cpp b/opengl/tools/glgen/stubs/gles11/common.cpp
index 75b75cb..c5a7a24 100644
--- a/opengl/tools/glgen/stubs/gles11/common.cpp
+++ b/opengl/tools/glgen/stubs/gles11/common.cpp
@@ -89,7 +89,7 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *o
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
- return (void *) (jint) pointer;
+ return reinterpret_cast<void*>(pointer);
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
diff --git a/opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp b/opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp
index 27b91fc..7d414d8 100644
--- a/opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp
@@ -157,7 +157,7 @@ android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_ni
(GLsizei *)length,
(GLint *)size,
(GLenum *)type,
- (char *)name
+ reinterpret_cast<char *>(name)
);
if (_typeArray) {
releasePointer(_env, _typeArray, type, JNI_TRUE);
diff --git a/opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp b/opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp
index 58f704c..a7376ba 100644
--- a/opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp
@@ -157,7 +157,7 @@ android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_n
(GLsizei *)length,
(GLint *)size,
(GLenum *)type,
- (char *)name
+ reinterpret_cast<char *>(name)
);
if (_typeArray) {
releasePointer(_env, _typeArray, type, JNI_TRUE);
diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp b/opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp
index a7e1cd2..c995d9c 100644
--- a/opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp
@@ -85,7 +85,7 @@ android_glGetShaderSource__IILjava_nio_IntBuffer_2B
(GLuint)shader,
(GLsizei)bufsize,
(GLsizei *)length,
- (char *)source
+ reinterpret_cast<char *>(source)
);
if (_array) {
releasePointer(_env, _array, length, JNI_TRUE);
diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
index 4743038..df11c53 100644
--- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
+++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
@@ -128,7 +128,7 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *o
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
- return (void *) (jint) pointer;
+ return reinterpret_cast<void *>(pointer);
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,