@@ -619,10 +619,12 @@ private ConvertedType findType(Element root, ParsingContext context) {
619619 Element child = children .get (i );
620620 String childQualName = child .getQualifiedName ();
621621 if (childQualName .equals ("array" )) {
622- //found an <array>, treat it like a pointer to its element type
622+ //found an <array>, try taking its c:type, and the name of the core type, and using that
623+ //to make a ConvertedType
623624 convType = findSimpleType (child , context );
625+ String arrayCType = child .getAttributeValue ("type" , Constants .GIR_XMLNS_C );
624626 if (convType != null ) {
625- convType = convType .pointerTypeTo ( );
627+ convType = convType .forCType ( context , arrayCType );
626628 }
627629 System .out .println ("found an array, treating it as " + convType );
628630 break ;
@@ -816,7 +818,8 @@ private void parseMethodOrFunction(Element root, ParsingContext context) {
816818
817819 if (returnsPointer ) {
818820 // Pointer.pointerToAddress(native(...), ReturnType.class)
819- JClass returnClass = (JClass )returnType .forCType (nextContext , returnType .getCtype ()).getJType ();
821+ ConvertedType returnConvType = returnType .forCType (nextContext , returnType .getCtype ());
822+ JClass returnClass = (JClass )returnConvType .getJType ();
820823
821824 JInvocation pointerToAddressCall =
822825 context
0 commit comments