diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-03-01 21:36:12 +0100 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-03-03 22:07:45 +0100 |
commit | 50dfb465658a5c1705cac51a31f145fee8b6b168 (patch) | |
tree | c5ebae7ac13589e4ef74138076792faa25ba46ec /tests | |
parent | 7e41a4c31acf729cba6e071692d03779eba77eea (diff) | |
download | gobject-introspection-50dfb465658a5c1705cac51a31f145fee8b6b168.tar.gz |
scanner: allow (array zero-terminated) instead of (array zero-terminated=1)
What we already had:
- (array zero-terminated=1) > array which is NULL terminated
- (array zero-terminated=0) > array which is not NULL terminated
- (array) > array which is not NULL terminated
- (array zero-terminated=X) > array which is not NULL terminated
where X can be anything
What this patch adds:
- (array zero-terminated) > array which is NULL terminated
https://bugzilla.gnome.org/show_bug.cgi?id=657754
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gimarshallingtests.c | 32 | ||||
-rw-r--r-- | tests/gimarshallingtests.h | 2 | ||||
-rw-r--r-- | tests/scanner/annotation.c | 2 | ||||
-rw-r--r-- | tests/scanner/annotationparser/gi/annotation_array.xml | 8 | ||||
-rw-r--r-- | tests/warn/invalid-array.h | 9 |
5 files changed, 25 insertions, 28 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index c8f97740..76beb92e 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -1332,7 +1332,7 @@ gi_marshalling_tests_array_in_len_before (gint length, const gint *ints) /** * gi_marshalling_tests_array_in_len_zero_terminated: - * @ints: (array length=length zero-terminated=1): + * @ints: (array length=length zero-terminated): * @length: */ void @@ -1584,7 +1584,7 @@ gi_marshalling_tests_array_in_nonzero_nonlen (gint first, const guint8 *chars) /** * gi_marshalling_tests_array_zero_terminated_return: * - * Returns: (array zero-terminated=1) (transfer none): + * Returns: (array zero-terminated) (transfer none): */ gchar ** gi_marshalling_tests_array_zero_terminated_return (void) @@ -1596,7 +1596,7 @@ gi_marshalling_tests_array_zero_terminated_return (void) /** * gi_marshalling_tests_array_zero_terminated_return_null: * - * Returns: (array zero-terminated=1) (transfer none): + * Returns: (array zero-terminated) (transfer none): */ gchar ** gi_marshalling_tests_array_zero_terminated_return_null (void) @@ -1607,7 +1607,7 @@ gi_marshalling_tests_array_zero_terminated_return_null (void) /** * gi_marshalling_tests_array_zero_terminated_return_struct: * - * Returns: (array zero-terminated=1) (transfer full): + * Returns: (array zero-terminated) (transfer full): */ GIMarshallingTestsBoxedStruct ** gi_marshalling_tests_array_zero_terminated_return_struct (void) @@ -1630,7 +1630,7 @@ gi_marshalling_tests_array_zero_terminated_return_struct (void) /** * gi_marshalling_tests_array_zero_terminated_in: - * @utf8s: (array zero-terminated=1) (transfer none): + * @utf8s: (array zero-terminated) (transfer none): */ void gi_marshalling_tests_array_zero_terminated_in (gchar **utf8s) @@ -1643,7 +1643,7 @@ gi_marshalling_tests_array_zero_terminated_in (gchar **utf8s) /** * gi_marshalling_tests_array_zero_terminated_out: - * @utf8s: (out) (array zero-terminated=1) (transfer none): + * @utf8s: (out) (array zero-terminated) (transfer none): */ void gi_marshalling_tests_array_zero_terminated_out (gchar *** utf8s) @@ -1654,7 +1654,7 @@ gi_marshalling_tests_array_zero_terminated_out (gchar *** utf8s) /** * gi_marshalling_tests_array_zero_terminated_inout: - * @utf8s: (inout) (array zero-terminated=1) (transfer none): + * @utf8s: (inout) (array zero-terminated) (transfer none): */ void gi_marshalling_tests_array_zero_terminated_inout (gchar *** utf8s) @@ -1671,9 +1671,9 @@ gi_marshalling_tests_array_zero_terminated_inout (gchar *** utf8s) /** * gi_marshalling_tests_array_gvariant_none_in: - * @variants: (array zero-terminated=1) (transfer none): + * @variants: (array zero-terminated) (transfer none): * - * Returns: (array zero-terminated=1) (transfer none): + * Returns: (array zero-terminated) (transfer none): */ GVariant ** gi_marshalling_tests_array_gvariant_none_in (GVariant **variants) @@ -1697,9 +1697,9 @@ gi_marshalling_tests_array_gvariant_none_in (GVariant **variants) /** * gi_marshalling_tests_array_gvariant_container_in: - * @variants: (array zero-terminated=1) (transfer container): + * @variants: (array zero-terminated) (transfer container): * - * Returns: (array zero-terminated=1) (transfer container): + * Returns: (array zero-terminated) (transfer container): */ GVariant ** gi_marshalling_tests_array_gvariant_container_in (GVariant **variants) @@ -1721,9 +1721,9 @@ gi_marshalling_tests_array_gvariant_container_in (GVariant **variants) /** * gi_marshalling_tests_array_gvariant_full_in: - * @variants: (array zero-terminated=1) (transfer full): + * @variants: (array zero-terminated) (transfer full): * - * Returns: (array zero-terminated=1) (transfer full): + * Returns: (array zero-terminated) (transfer full): */ GVariant ** gi_marshalling_tests_array_gvariant_full_in (GVariant **variants) @@ -3333,7 +3333,7 @@ _marshal_INT__VOID (GClosure *closure, /** * gi_marshalling_tests_gclosure_return: - * + * * Return: a #GClosure */ GClosure * @@ -4340,7 +4340,7 @@ void gi_marshalling_tests_object_vfunc_caller_allocated_out_parameter (GIMarshal /** * gi_marshalling_tests_object_vfunc_array_out_parameter: - * @a: (out) (array zero-terminated=1): + * @a: (out) (array zero-terminated): */ void gi_marshalling_tests_object_vfunc_array_out_parameter (GIMarshallingTestsObject *self, gfloat **a) { @@ -4909,7 +4909,7 @@ gi_marshalling_tests_gerror (GError **error) /** * gi_marshalling_tests_gerror_array_in: - * @in_ints: (array zero-terminated=1): + * @in_ints: (array zero-terminated): */ void gi_marshalling_tests_gerror_array_in (gint *in_ints, GError **error) diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 3fb9c949..fc20fd72 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -1378,7 +1378,7 @@ struct _GIMarshallingTestsObjectClass /** * GIMarshallingTestsObjectClass::vfunc_array_out_parameter: - * @a: (out) (array zero-terminated=1): + * @a: (out) (array zero-terminated): */ void (* vfunc_array_out_parameter) (GIMarshallingTestsObject *self, gfloat **a); diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index 173db974..da364e16 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -449,7 +449,7 @@ regress_annotation_object_compute_sum_n(RegressAnnotationObject *object, /** * regress_annotation_object_compute_sum_nz: * @object: a #RegressAnnotationObject - * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers that + * @nums: (array length=n_nums zero-terminated): Sequence of numbers that * are zero-terminated * @n_nums: Length of number array * diff --git a/tests/scanner/annotationparser/gi/annotation_array.xml b/tests/scanner/annotationparser/gi/annotation_array.xml index 3a7cbc0b..8b7a62df 100644 --- a/tests/scanner/annotationparser/gi/annotation_array.xml +++ b/tests/scanner/annotationparser/gi/annotation_array.xml @@ -159,7 +159,7 @@ are zero-terminated</description> * annotation_object_parse_args: * @object: a #AnnotationObject * @argc: (inout): Length of the argument vector - * @argv: (inout) (array length=argc zero-terminated=1): Argument vector + * @argv: (inout) (array length=argc zero-terminated): Argument vector * * Test taking a zero-terminated array with length parameter **/</input> @@ -197,7 +197,6 @@ are zero-terminated</description> </option> <option> <name>zero-terminated</name> - <value>1</value> </option> </options> </annotation> @@ -212,7 +211,7 @@ are zero-terminated</description> * annotation_object_parse_args: * @object: a #AnnotationObject * @argc: (inout): Length of the argument vector - * @argv: (inout) (array length=argc zero-terminated=1): Argument vector + * @argv: (inout) (array length=argc zero-terminated): Argument vector * * Test taking a zero-terminated array with length parameter */</output> @@ -466,9 +465,8 @@ are zero-terminated</description> </tags> </docblock> <messages> - <message>3: Warning: Test: "array" annotation option "zero-terminated" needs a value</message> <message>4: Warning: Test: "array" annotation option "length" needs a value</message> - <message>6: Warning: Test: invalid "array" annotation option "zero-terminated" value "yes", must be an integer</message> + <message>6: Warning: Test: invalid "array" annotation option "zero-terminated" value "yes", must be 0 or 1</message> </messages> </parser> <output>/** diff --git a/tests/warn/invalid-array.h b/tests/warn/invalid-array.h index b9b828cf..97ad3e9f 100644 --- a/tests/warn/invalid-array.h +++ b/tests/warn/invalid-array.h @@ -18,8 +18,7 @@ void test_invalid_array_zero_terminated (char ***out1, char ***out2); -// EXPECT:14: Warning: Test: "array" annotation option "zero-terminated" needs a value -// EXPECT:15: Warning: Test: invalid "array" annotation option "zero-terminated" value "foobar", must be an integer +// EXPECT:15: Warning: Test: invalid "array" annotation option "zero-terminated" value "foobar", must be 0 or 1 /** * test_invalid_array_fixed_size: @@ -30,8 +29,8 @@ void test_invalid_array_fixed_size (char ***out1, char ***out2); -// EXPECT:26: Warning: Test: "array" annotation option "fixed-size" needs a value -// EXPECT:27: Warning: Test: invalid "array" annotation option "fixed-size" value "foobar", must be an integer +// EXPECT:25: Warning: Test: "array" annotation option "fixed-size" needs a value +// EXPECT:26: Warning: Test: invalid "array" annotation option "fixed-size" value "foobar", must be an integer /** * test_invalid_array_length: @@ -41,4 +40,4 @@ void test_invalid_array_length (char ***out1, char ***out2); -// EXPECT:38: Warning: Test: "array" annotation option "length" needs a value +// EXPECT:37: Warning: Test: "array" annotation option "length" needs a value |