From f4e753ff1f39be381307ffdb0fb6bb7a2d323eff Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 17 Jun 2014 08:26:36 +0200 Subject: GlueGen: Add support for 'compound array call-by-value' Completing commit c3054a01990e55ab35756ea23ab7d7c05f24dd37 by allowing passing compound arrays via 'call-by-value. - Creating linear temp heap, copying NIO values into it and passing to C function. Copy-back if not 'const', see below. - Respect 'const' qualifier to skip write-back of temp heap passed to C function - See tag: // FIXME: Compound and Compound-Arrays for code changes and validation of completeness - triggers for compound arrays are: - javaType.isArrayOfCompoundTypeWrappers() - type.isArray() - simplified const query by c-type: FunctionEmitter.isBaseTypeConst(ctype) +++ Tests: Added call-by-value to test1.[ch] binding test! --- src/java/com/jogamp/gluegen/MethodBinding.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/java/com/jogamp/gluegen/MethodBinding.java') diff --git a/src/java/com/jogamp/gluegen/MethodBinding.java b/src/java/com/jogamp/gluegen/MethodBinding.java index 5de604f..d199db1 100644 --- a/src/java/com/jogamp/gluegen/MethodBinding.java +++ b/src/java/com/jogamp/gluegen/MethodBinding.java @@ -53,9 +53,9 @@ import java.util.List; public class MethodBinding { - private FunctionSymbol sym; + private final FunctionSymbol sym; private String renamedMethodName; - private HashSet aliasedNames; + private final HashSet aliasedNames; private JavaType javaReturnType; private List javaArgumentTypes; private boolean computedSignatureProperties; @@ -266,11 +266,11 @@ public class MethodBinding { /** * Returns true if the function needs NIO-related * wrapping/unwrapping or conversion of various arguments. Currently - * this returns the logical OR of signatureUsesNIO() and - * signatureUsesCompoundTypeWrappers(). + * this returns the logical OR of signatureUsesNIO(), + * signatureUsesCompoundTypeWrappers() and signatureUsesArraysOfCompoundTypeWrappers(). */ public boolean needsNIOWrappingOrUnwrapping() { - return (signatureUsesNIO() || signatureUsesCompoundTypeWrappers()); + return (signatureUsesNIO() || signatureUsesCompoundTypeWrappers() || signatureUsesArraysOfCompoundTypeWrappers() ); } /** -- cgit v1.2.3