@@ -780,7 +780,7 @@ private static String getParams(NodeList<Parameter> parameters, ArrayList<IDLPar
780
780
Parameter parameter = parameters .get (i );
781
781
IDLParameter idlParameter = idParameters .get (i );
782
782
Type type = parameter .getType ();
783
- String paramName = getParam (idlParameter . idlFile , type , idlParameter . name , idlParameter . getCPPType (), idlParameter . isAny , idlParameter . isRef , idlParameter . isValue , idlParameter . isArray );
783
+ String paramName = getParam (idlParameter , type );
784
784
if (i > 0 ) {
785
785
param += ", " ;
786
786
}
@@ -789,21 +789,34 @@ private static String getParams(NodeList<Parameter> parameters, ArrayList<IDLPar
789
789
return param ;
790
790
}
791
791
792
- private static String getParam (IDLFile idlFile , Type type , String paramName , String classType , boolean isAny , boolean isRef , boolean isValue , boolean isArray ) {
792
+ private static String getParam (IDLParameter idlParameter , Type type ) {
793
+ IDLFile idlFile = idlParameter .idlFile ;
794
+ String paramName = idlParameter .name ;
795
+ String cppType = idlParameter .getCPPType ();
796
+ String classType = cppType ;
797
+ boolean isAny = idlParameter .isAny ;
798
+ boolean isRef = idlParameter .isRef ;
799
+ boolean isValue = idlParameter .isValue ;
800
+ boolean isArray = idlParameter .isArray ;
793
801
boolean isObject = type .isClassOrInterfaceType ();
802
+
794
803
if (isObject && !classType .equals ("char*" )) {
795
- String idlArrayOrNull = IDLHelper .getIDLArrayOrNull (classType );
804
+ String idlArrayOrNull = IDLHelper .getIDLArrayClassOrNull (classType );
796
805
if (idlArrayOrNull != null ) {
797
806
classType = idlArrayOrNull ;
798
807
}
799
808
800
809
paramName += "_addr" ;
801
- IDLClass paramClass = idlFile .getClass (classType );
802
- String cArray = IDLHelper .getCArray (classType );
803
- if (isArray && cArray != null ) {
804
- paramName = "(" + cArray + ")" + paramName ;
810
+ if (isArray ) {
811
+ String idlType = cppType .replace ("[]" , "*" );
812
+ if (idlParameter .idlClassOrEnum != null && !isRef ) {
813
+ // Is a class object and pointer of pointer
814
+ idlType += "*" ;
815
+ }
816
+ paramName = "(" + idlType + ")" + paramName ;
805
817
}
806
818
else {
819
+ IDLClass paramClass = idlFile .getClass (classType );
807
820
if (paramClass != null ) {
808
821
classType = paramClass .getCPPName ();
809
822
}
0 commit comments