diff options
author | Sven Gothel <[email protected]> | 2015-03-09 03:09:18 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-09 03:09:18 +0100 |
commit | 9eb9403d774db0c55ea3cb2fc5bd04114b8b5feb (patch) | |
tree | 266780ea786df13e582d4ecdd0b05ef9c46bccfb /src/java/com/jogamp/gluegen/GlueGen.java | |
parent | cf9f28cf249393f42d7d2835775521dfadee6b92 (diff) |
Bug 1134 - Fix aliased typedef struct emission
- Code regarding 'aliased typedef struct' is tagged in JavaEmitter and HeaderParser:
'NOTE: Struct Name Resolution (JavaEmitter, HeaderParser)'
Prefers containing cstruct typedef pointer
if available _and_ if cstruct is _not_ a typedef!
- Removed: 'HeaderParser.resolveAnonCompound(..)' no more required,
since CompoundType always sets its name!
Commit cf9f28cf249393f42d7d2835775521dfadee6b92
- JavaEmitter.emitStruct:
- Regard above 'aliased typedef struct' NOTE
- JavaEmitter.typeToJavaType:
- Regard above 'aliased typedef struct' NOTE
- ReferencedStructs
- Drop duplicate CompoundType instances of same name.
This can happen due to const/volatile and ASTLocusTag variants.
Diffstat (limited to 'src/java/com/jogamp/gluegen/GlueGen.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/GlueGen.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index 4ef5648..c4eb1c5 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -294,8 +294,7 @@ public class GlueGen implements GlueEmitterControls { for (final FunctionSymbol sym : allFunctions) { // FIXME: this doesn't take into account the possibility that some of // the functions we send to emitMethodBindings() might not actually be - // emitted (e.g., if an Ignore directive in the JavaEmitter causes it - // to be skipped). + // emitted (e.g., if an Ignore directive in the JavaEmitter causes it to be skipped). sym.getType().visit(referencedStructs); } @@ -315,13 +314,9 @@ public class GlueGen implements GlueEmitterControls { // Lay out structs emit.beginStructLayout(); - for (final Iterator<Type> iter = referencedStructs.results(); iter.hasNext();) { - final Type t = iter.next(); - if (t.isCompound()) { - emit.layoutStruct(t.asCompound()); - } else if (t.isPointer()) { - final PointerType p = t.asPointer(); - final CompoundType c = p.getTargetType().asCompound(); + for (final Iterator<CompoundType> iter = referencedStructs.layouts(); iter.hasNext();) { + final CompoundType c = iter.next(); + if( !c.isLayouted() ) { emit.layoutStruct(c); } } |