diff options
Diffstat (limited to 'src/java/com/jogamp/gluegen/cgram')
4 files changed, 16 insertions, 12 deletions
diff --git a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java index ada34f7..03cb64d 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java @@ -111,13 +111,14 @@ public class ArrayType extends MemoryLayoutType implements Cloneable { @Override public final ArrayType asArray() { return this; } - public Type getElementType() { return elementType; } + @Override + public final Type getTargetType() { return elementType; } public int getLength() { return length; } public boolean hasLength() { return length >= 0; } @Override - public final Type getBaseElementType() { - return elementType.getBaseElementType(); + public final Type getBaseType() { + return elementType.getBaseType(); } @Override @@ -128,7 +129,7 @@ public class ArrayType extends MemoryLayoutType implements Cloneable { /** Recompute the size of this array if necessary. This needs to be done when the base element type is a compound type after layouting. */ void recomputeSize() { - final ArrayType arrayElementType = getElementType().asArray(); + final ArrayType arrayElementType = getTargetType().asArray(); if (arrayElementType != null) { arrayElementType.recomputeSize(); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java index 5707b5c..eb89500 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java @@ -124,13 +124,11 @@ public class PointerType extends Type implements Cloneable { } @Override - public final Type getTargetType() { - return targetType; - } + public final Type getTargetType() { return targetType; } @Override - public final Type getBaseElementType() { - return targetType.getBaseElementType(); + public final Type getBaseType() { + return targetType.getBaseType(); } @Override diff --git a/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java b/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java index 86f1ae1..62b0025 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java +++ b/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java @@ -103,7 +103,7 @@ public class StructLayout { } else if (ft.isArray()) { final ArrayType arrayType = ft.asArray(); if(!arrayType.isLayouted()) { - final CompoundType compoundElementType = arrayType.getBaseElementType().asCompound(); + final CompoundType compoundElementType = arrayType.getBaseType().asCompound(); if (compoundElementType != null) { if(!compoundElementType.isLayouted()) { StructLayout.layout(0, compoundElementType); diff --git a/src/java/com/jogamp/gluegen/cgram/types/Type.java b/src/java/com/jogamp/gluegen/cgram/types/Type.java index 7ff1fed..9c881c9 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/Type.java +++ b/src/java/com/jogamp/gluegen/cgram/types/Type.java @@ -428,7 +428,7 @@ public abstract class Type implements SemanticEqualityOp, ASTLocusTagProvider { * </p> */ public final boolean isBaseTypeConst() { - return getBaseElementType().isConst(); + return getBaseType().isConst(); } /** Hashcode for Types. */ @@ -568,13 +568,18 @@ public abstract class Type implements SemanticEqualityOp, ASTLocusTagProvider { * If this is a multidimensional array or pointer method returns the bottom-most element type, * otherwise this. * </p> + * @see #getTargetType() */ - public Type getBaseElementType() { + public Type getBaseType() { return this; } /** * Helper method to returns the target type of this type, in case another type is being referenced. + * <p> + * If this is an array or pointer method returns the next target element type, otherwise this. + * </p> + * @see #getBaseType() */ public Type getTargetType() { return this; |