diff options
author | Sven Gothel <[email protected]> | 2023-08-04 11:46:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-08-04 11:46:23 +0200 |
commit | 927bbc7160a812bb29c0e7120d4a3009bfb13bbf (patch) | |
tree | c7c73d3f0ea8b59bff0c9faa4ad812e4a02b8110 /src | |
parent | 3ad38748d7ef50a3631506eabcd3ae3417faa84d (diff) |
JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode()
Method was encapsulated in commit d4e8ecc3b4f68b86d95ec951971a0fea20217988
and questioned whether it is required.
The non-userParam callback case adds no additional code requirements.
Both, callback with and without userParam shares same code path
and the respective native static fields.
Only that the non-userParam code path adds additional native static fields,
but all code sections are produced in both cases.
Passed all unit tests.
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/jogamp/gluegen/JavaConfiguration.java | 7 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/JavaEmitter.java | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java index 95e1480..107b8c3 100644 --- a/src/java/com/jogamp/gluegen/JavaConfiguration.java +++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java @@ -2517,11 +2517,4 @@ public class JavaConfiguration { /** Mapped binding name to {@link JavaCallbackInfo} */ /* pp */ final Map<String, JavaCallbackInfo> setFuncToJavaCallbackMap = new HashMap<String, JavaCallbackInfo>(); final Set<String> emittedJavaCallbackUserParamClasses = new HashSet<String>(); - - /** Returns true if a method binding requires specific java callback code */ - final boolean requiresJavaCallbackCode(final String bindingName) { - final JavaCallbackInfo jcbi = setFuncToJavaCallbackMap.get(bindingName); - return null != jcbi && !jcbi.cbUserParamIsDefined; - } - } diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java index 1f1f8af..0936536 100644 --- a/src/java/com/jogamp/gluegen/JavaEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaEmitter.java @@ -465,11 +465,9 @@ public class JavaEmitter implements GlueEmitter { final boolean isUnimplemented = cfg.isUnimplemented(cSymbol); final List<String> prologue = cfg.javaPrologueForMethod(binding, false, false); final List<String> epilogue = cfg.javaEpilogueForMethod(binding, false, false); - final boolean needsJavaCallbackCode = cfg.requiresJavaCallbackCode( binding.getName() ); final boolean needsBody = isUnimplemented || binding.needsNIOWrappingOrUnwrapping() || binding.signatureUsesJavaPrimitiveArrays() || - needsJavaCallbackCode || null != prologue || null != epilogue; @@ -533,7 +531,6 @@ public class JavaEmitter implements GlueEmitter { final boolean hasPrologueOrEpilogue = cfg.javaPrologueForMethod(binding, false, false) != null || cfg.javaEpilogueForMethod(binding, false, false) != null ; - final boolean needsJavaCallbackCode = cfg.requiresJavaCallbackCode( binding.getName() ); if ( !cfg.isUnimplemented( cSymbol ) ) { // If we already generated a public native entry point for this @@ -544,7 +541,7 @@ public class JavaEmitter implements GlueEmitter { // the private native entry point for it along with the version // taking only NIO buffers if ( !binding.signatureUsesJavaPrimitiveArrays() && - ( binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue || needsJavaCallbackCode ) + ( binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue ) ) { final CodeUnit unit = (cfg.allStatic() ? javaUnit() : javaImplUnit()); @@ -591,7 +588,7 @@ public class JavaEmitter implements GlueEmitter { cfg.implClassName(), true, // NOTE: we always disambiguate with a suffix now, so this is optional cfg.allStatic(), - (binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue || needsJavaCallbackCode), + (binding.needsNIOWrappingOrUnwrapping() || hasPrologueOrEpilogue ), !cfg.useNIODirectOnly(binding.getName()), machDescJava, getConfig()); prepCEmitter(binding.getName(), binding.getJavaReturnType(), cEmitter); |