Use reinterpret_cast when an integer is cast to a pointer
Change-Id: I5adcd59f58c029f7b2b596f4826d8ea69fb9bba6
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
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 @@
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 @@
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));
}