From 72d3635279ffc8ad88e47dff9bbe95d211226d11 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 5 Mar 2015 07:14:04 +0100 Subject: Bug 1134 - Enhance GlueGen Compiler: Minimal GL Header Changes _and_ Typesafety - We shall be able to import 'most' vanilla GL header, i.e. only change the typedef part using our GlueGen types - Type Safety: - GlueGen now detects '#define' and 'enum' redefines and throw an exception in this case. This helps detecting wrongly renamed GL extensions into core! - GlueGen now detects function redefines (overloading) and throw an exception in this case. Hence the semantics of duplicate functions has to be equal! This helps detecting wrongly renamed GL extensions into core! - Semantic equality for all types is provided via interface TypeComparator.SemanticEqualityOp, i.e. 'boolean equalSemantics(..)' implemented by com.jogamp.gluegen.cgram.types.Type. Semantic equality can be relaxed via config "RelaxedEqualSemanticsTest true", i.e. ignoring integer size, and const / volatile qualifiers. - All equality/hash methods of 'com.jogamp.gluegen.cgram.types.*' are restructured. - Track and simplify renamed 'symbol', i.e. use a common sub-interface for all renamed symbols (ConstantDefinition, FunctionSymbol, ..) - This is provided in a unified manner via interface com.jogamp.gluegen.cgram.types.AliasedSymbol and its common implementation AliasedSymbolImpl - All JavaConfiguration.shouldIgnore* methods operate w/ 'AliasedSymbol' trying to match all aliases. - Support 'struct NAME [ { ... } ]' w/o typedef's - New GL / CL headers do not use typedef's for anonymous opaque types - Opaque Type handling - JavaConfiguration.typeInfo(..), identifying opaque types, no more back references from target-type -> typedef. Hence the following is possible now: typedef void * Opaque01; // Opaque typedef void * APointerBuffer; // A Buffer - All Logger instances are no more static and derive their warning level from the package's root Logger via Logging.getLogger(..). --- src/java/com/jogamp/gluegen/MethodBinding.java | 32 ++------------------------ 1 file changed, 2 insertions(+), 30 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 93c55d5..56b4fc8 100644 --- a/src/java/com/jogamp/gluegen/MethodBinding.java +++ b/src/java/com/jogamp/gluegen/MethodBinding.java @@ -44,7 +44,6 @@ import com.jogamp.gluegen.cgram.types.Type; import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; import java.util.List; /** Represents the binding of a C function to a Java method. Also used @@ -54,8 +53,6 @@ import java.util.List; public class MethodBinding { private final FunctionSymbol sym; - private String renamedMethodName; - private final HashSet aliasedNames; private JavaType javaReturnType; private List javaArgumentTypes; private boolean computedSignatureProperties; @@ -81,8 +78,6 @@ public class MethodBinding { public MethodBinding(final MethodBinding bindingToCopy) { this.sym = bindingToCopy.sym; - this.renamedMethodName = bindingToCopy.renamedMethodName; - this.aliasedNames = new HashSet(bindingToCopy.aliasedNames); this.containingType = bindingToCopy.containingType; this.containingCType = bindingToCopy.containingCType; this.javaReturnType = bindingToCopy.javaReturnType; @@ -104,7 +99,6 @@ public class MethodBinding { /** Constructor for calling a C function. */ public MethodBinding(final FunctionSymbol sym) { this.sym = sym; - this.aliasedNames = new HashSet(); } /** Constructor for calling a function pointer contained in a @@ -113,7 +107,6 @@ public class MethodBinding { this.sym = sym; this.containingType = containingType; this.containingCType = containingCType; - this.aliasedNames = new HashSet(); } public void setJavaReturnType(final JavaType type) { @@ -166,34 +159,13 @@ public class MethodBinding { return "arg" + i; } - public String getOrigName() { - return sym.getName(); + public Collection getAliasedNames() { + return sym.getAliasedNames(); } - public String getName() { - // Defaults to same as C symbol unless renamed - if (renamedMethodName != null) { - return renamedMethodName; - } return sym.getName(); } - /** Supports renaming C function in Java binding. */ - public void renameMethodName(final String name) { - if (null != name) { - renamedMethodName = name; - aliasedNames.add(sym.getName()); - } - } - - public void addAliasedName(final String name) { - aliasedNames.add(name); - } - - public Collection getAliasedNames() { - return aliasedNames; - } - /** Creates a new MethodBinding replacing the specified Java argument type with a new argument type. If argumentNumber is less than 0 then replaces the return type. */ -- cgit v1.2.3