summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java4
-rw-r--r--src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java17
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java2
3 files changed, 17 insertions, 6 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 9665182..7ffa88d 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -1151,9 +1151,11 @@ public class JavaEmitter implements GlueEmitter {
System.err.printf("SE.ac.%02d: %s / %s, %s%n", (i+1), field, cfgFieldName1, fieldType.getDebugString());
}
if (fieldType.isFunctionPointer()) {
+ final FunctionSymbol func = new FunctionSymbol(field.getName(), fieldType.asPointer().getTargetType().asFunction());
+ func.rename(renamed); // null is OK
generateFunctionPointerCode(methodBindingSet, javaWriter, jniWriter, structCTypeName, structClassPkgName,
containingCType, containingJType, i,
- new FunctionSymbol(fieldName, fieldType.asPointer().getTargetType().asFunction()), cfgFieldName1);
+ func, cfgFieldName1);
} else if (fieldType.isCompound()) {
// FIXME: will need to support this at least in order to
// handle the union in jawt_Win32DrawingSurfaceInfo (fabricate a name?)
diff --git a/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java b/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
index 18477c1..679d44d 100644
--- a/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
+++ b/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
@@ -42,13 +42,19 @@ public interface AliasedSymbol {
* to the list of {@link #getAliasedNames() aliases}.
* while the given {@code newName} will be removed.
* </p>
- * @param newName the new {@link #getName() current-name}
+ * <p>
+ * Operation will be ignored if {@code newName} is {@code null}.
+ * </p>
+ * @param newName the new {@link #getName() current-name}, maybe {@code null}
*/
void rename(final String newName);
/**
* Add the given {@code origName} to the list of {@link #getAliasedNames() aliases}
* if not equal {@link #getName() current-name}.
- * @param origName the new alias to be added
+ * <p>
+ * Operation will be ignored if {@code newName} is {@code null}.
+ * </p>
+ * @param origName the new alias to be added, maybe {@code null}
*/
void addAliasedName(final String origName);
/**
@@ -94,13 +100,16 @@ public interface AliasedSymbol {
private String name;
public AliasedSymbolImpl(final String origName) {
+ if( null == origName ) {
+ throw new IllegalArgumentException("Null origName not allowed");
+ }
this.origName = origName;
this.aliasedNames=new HashSet<String>();
this.name = origName;
}
@Override
public void rename(final String newName) {
- if( !name.equals(newName) ) {
+ if( null != newName && !name.equals(newName) ) {
aliasedNames.add(name);
aliasedNames.remove(newName);
name = newName;
@@ -108,7 +117,7 @@ public interface AliasedSymbol {
}
@Override
public void addAliasedName(final String origName) {
- if( !name.equals(origName) ) {
+ if( null != origName && !name.equals(origName) ) {
aliasedNames.add(origName);
}
}
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
index a7739df..23c7fb5 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
@@ -178,7 +178,7 @@ public class ProcAddressEmitter extends JavaEmitter {
* whether or not the typedef is actually defined.
*/
protected String getFunctionPointerTypedefName(final FunctionSymbol sym) {
- return getProcAddressConfig().convertToFunctionPointerName(sym.getName());
+ return getProcAddressConfig().convertToFunctionPointerName(sym.getOrigName());
}
//----------------------------------------------------------------------