From a41f4d504d2f8cf58114d570d23f757ab2659cfc Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 28 Mar 2010 01:27:01 +0100 Subject: http://www.jogamp.org/bugzilla/show_bug.cgi?id=389 Mixed types in generated code are functioning now, even though not all permutations are generated - still. However, this patch merges the indirect object passing, wheather it is a primitive array or an indirect NIO buffer, incl. PointerBuffer. This allows the usage of only one JNI functions for all combinations. Only in case of NIODirectOnly, the simplified direct only '0' variation is created - otherwise the parametrized '1' variant. The junit tests proves the implementation and almost completes the gluegen junit tests coverage for JavaEmitter and ProcAddressEmitter. Impact/Result: - Working mixed array types - JOGL GL2 native library shrunk around 30% - Simplified gluegen code - Almost complete gluegen junit tests TODO: Complete permutations of array/NIO arguments, if desired. ++++ Misc changes: - NativeLibrary implements DynamicLookupHelper: lookupFunction() -> dynamicLookupFunction() --- .../sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java') diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java index 54263a5..b7fac1b 100755 --- a/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java +++ b/src/java/com/sun/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java @@ -140,12 +140,10 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter { super.emitBodyVariableDeclarations(writer); } - protected void emitBodyVariablePreCallSetup(PrintWriter writer, - boolean emittingPrimitiveArrayCritical) { - super.emitBodyVariablePreCallSetup(writer, emittingPrimitiveArrayCritical); + protected void emitBodyVariablePreCallSetup(PrintWriter writer) { + super.emitBodyVariablePreCallSetup(writer); if (callThroughProcAddress) { - if (!emittingPrimitiveArrayCritical) { // set the function pointer to the value of the passed-in procAddress FunctionSymbol cSym = getBinding().getCSymbol(); String funcPointerTypedefName = emitter.getFunctionPointerTypedefName(cSym); @@ -162,7 +160,6 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter { writer.println(") (intptr_t) procAddress;"); writer.println(" assert(" + ptrVarName + " != NULL);"); - } } } -- cgit v1.2.3