diff options
author | Sven Gothel <[email protected]> | 2012-03-22 17:36:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-22 17:36:03 +0100 |
commit | 5fb327c8e6e065b6caf2db788a1762e3c696dfbc (patch) | |
tree | fd7bd150fc0dcc15ba5ee60e6feaea0e427fb6d8 /src/jogl/classes/com/jogamp/gluegen/opengl | |
parent | 6b8c90ea679f93924b105932c40590c01c5dc4fd (diff) |
Mark JOGL/GlueGen NativeSignature*Emitter 'to be reviewed' and adapt it to GlueGen commit 3d527ea538c9e9897f86a0f6bdae0cab44d239c3
Diffstat (limited to 'src/jogl/classes/com/jogamp/gluegen/opengl')
2 files changed, 12 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java index bfaf7ac89..adb1c2ae0 100755 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java @@ -55,6 +55,8 @@ import java.util.Set; /** * Emitter producing NativeSignature attributes. + * + * Review: This Package/Class is not used and subject to be deleted. */ public class NativeSignatureEmitter extends GLEmitter { diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java index b4cab2885..e98478b6e 100755 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java @@ -50,6 +50,7 @@ import com.jogamp.gluegen.procaddress.ProcAddressJavaMethodBindingEmitter; import java.io.PrintWriter; +/** Review: This Package/Class is not used and subject to be deleted. */ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBindingEmitter { public NativeSignatureJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) { @@ -106,7 +107,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding } else if (type.isPrimitiveArray()) { writer.print("MO"); } else if (type.isPrimitive()) { - Class clazz = type.getJavaClass(); + Class<?> clazz = type.getJavaClass(); if (clazz == Byte.TYPE) { writer.print("B"); } else if (clazz == Character.TYPE) { writer.print("C"); } else if (clazz == Double.TYPE) { writer.print("D"); } @@ -145,7 +146,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding super.emitPreCallSetup(binding, writer); for (int i = 0; i < binding.getNumArguments(); i++) { JavaType type = binding.getJavaArgumentType(i); - if (type.isNIOBuffer() && !directNIOOnly) { + if (type.isNIOBuffer() && !useNIODirectOnly ) { // Emit declarations for variables holding primitive arrays as type Object // We don't know 100% sure we're going to use these at this point in the code, though writer.println(" Object " + getNIOBufferArrayName(i) + " = (_direct ? null : Buffers.getArray(" + @@ -245,29 +246,31 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding writer.print(" "); JavaType returnType = binding.getJavaReturnType(); boolean needsResultAssignment = false; - + if (!returnType.isVoid()) { if (returnType.isCompoundTypeWrapper() || returnType.isNIOByteBuffer()) { - writer.println("java.nio.ByteBuffer _res;"); + writer.println("final java.nio.ByteBuffer _res;"); needsResultAssignment = true; } else if (returnType.isArrayOfCompoundTypeWrappers()) { - writer.println("java.nio.ByteBuffer[] _res;"); + writer.println("final java.nio.ByteBuffer[] _res;"); needsResultAssignment = true; } else if (returnType.isString() || returnType.isNIOByteBuffer()) { + writer.print("final "); writer.print(returnType); writer.println(" _res;"); needsResultAssignment = true; } else { // Always assign to "_res" variable so we can clean up // outgoing String arguments, for example + writer.print("final "); emitReturnType(writer); writer.println(" _res;"); needsResultAssignment = true; } } - if (binding.signatureCanUseIndirectNIO() && !directNIOOnly) { + if (binding.signatureCanUseIndirectNIO() && !useNIODirectOnly) { // Must generate two calls for this gated on whether the NIO // buffers coming in are all direct or indirect writer.println("if (_direct) {"); @@ -310,7 +313,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding writer.print(";"); } - if (binding.signatureCanUseIndirectNIO() && !directNIOOnly) { + if (binding.signatureCanUseIndirectNIO() && !useNIODirectOnly) { // Must generate two calls for this gated on whether the NIO // buffers coming in are all direct or indirect writer.println(); |