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() --- src/java/com/sun/gluegen/runtime/NativeLibrary.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/java/com/sun/gluegen/runtime/NativeLibrary.java') diff --git a/src/java/com/sun/gluegen/runtime/NativeLibrary.java b/src/java/com/sun/gluegen/runtime/NativeLibrary.java index c4c9f25..eb465c8 100755 --- a/src/java/com/sun/gluegen/runtime/NativeLibrary.java +++ b/src/java/com/sun/gluegen/runtime/NativeLibrary.java @@ -57,7 +57,7 @@ import java.util.*; ProcAddressTable glue code generation style without additional supporting code needed in the generated library. */ -public class NativeLibrary { +public class NativeLibrary implements DynamicLookupHelper { private static final int WINDOWS = 1; private static final int UNIX = 2; private static final int MACOSX = 3; @@ -202,10 +202,10 @@ public class NativeLibrary { } /** Looks up the given function name in this native library. */ - public long lookupFunction(String functionName) { + public long dynamicLookupFunction(String funcName) { if (libraryHandle == 0) throw new RuntimeException("Library is not open"); - return dynLink.lookupSymbol(libraryHandle, functionName); + return dynLink.lookupSymbol(libraryHandle, funcName); } /** Retrieves the low-level library handle from this NativeLibrary -- cgit v1.2.3