After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758019 - girwriter: Missing length-parameters of arrays with rank > 1
girwriter: Missing length-parameters of arrays with rank > 1
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: GObject Introspection
0.30.x
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-12 17:49 UTC by brian g
Modified: 2017-06-22 06:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
girwriter: Write length-parameters of arrays with rank > 1 (1.95 KB, patch)
2017-06-21 16:33 UTC, Rico Tzschichholz
committed Details | Review

Description brian g 2015-11-12 17:49:36 UTC
Other places in the GIR file, if a variable is an array, the <array length="x"> tag uses x to indicate the number of dimensions of that variable.  In this case, the input parameter for a method only get a tag where x=1, even for 2D and higher arrays.  Furthermore, it lists the incorrect number of input parameters, "a_length2" is not present, nor is "result_length2" for the return value.


Vala code from an object:

public float[,] nd_test(float[,] a){
    return a;
}



Function def in header file:

gfloat* foo_input_buffer_nd_test (fooInputBuffer* self, gfloat* a, int a_length1, int a_length2, int* result_length1, int* result_length2);



GIR entry:

<method name="nd_test" c:identifier="foo_input_buffer_nd_test">
	<return-value transfer-ownership="full">
		<array length="2">
			<type name="gfloat" c:type="gfloat"/>
		</array>
	</return-value>
	<parameters>
		<parameter name="a" transfer-ownership="none">
			<array length="1">
				<type name="gfloat" c:type="gfloat"/>
			</array>
		</parameter>
		<parameter name="a_length1" transfer-ownership="none">
			<type name="gint" c:type="gint"/>
		</parameter>
		<parameter name="result_length1" direction="out" transfer-ownership="none">
			<type name="gint" c:type="gint*"/>
		</parameter>
	</parameters>
</method>

I believe the parameter should read <array length="2"> (as it does for the return-value) and there should be additional parameters a_length2 and return_length2.
Comment 1 Rico Tzschichholz 2017-06-21 16:33:41 UTC
Created attachment 354170 [details] [review]
girwriter: Write length-parameters of arrays with rank > 1
Comment 2 Rico Tzschichholz 2017-06-22 06:49:27 UTC
Attachment 354170 [details] pushed as 7b7f67c - girwriter: Write length-parameters of arrays with rank > 1