2008-11-13 Andreas Rottmann <a.rottmann@gmx.at>
+ Bug 560708 – Don't treat arrays that have a length specified as
+ zero-terminated by default
+
+ * giscanner/transformer.py: Default to non zero terminated for
+ arrays with length.
+ * tests/*: Update, add test for zero vs not.
+
+2008-11-13 Andreas Rottmann <a.rottmann@gmx.at>
+
Bug 557788 - Return types for constructors in generated typelib bogus
* girepository/girnode.c: Namespace-qualify XREFs; not doing so is
for opt in options.get('array', [])])
if 'length' in array_opts:
rettype.length_param_name = array_opts['length']
+ rettype.zeroterminated = False
if 'fixed-size' in array_opts:
rettype.size = array_opts['fixed-size']
rettype.zeroterminated = False
+ if 'zero-terminated' in array_opts:
+ rettype.zeroterminated = array_opts['zero-terminated'] != '0'
else:
derefed_name = self.parse_ctype(ctype)
rettype = Type(derefed_name, ctype)
</return-value>
<parameters>
<parameter name="nums" transfer-ownership="none">
+ <array zero-terminated="0" length="2" c:type="int*">
+ <type name="int"/>
+ </array>
+ </parameter>
+ <parameter name="n_nums" transfer-ownership="none">
+ <type name="int" c:type="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="compute_sum_nz"
+ c:identifier="annotation_object_compute_sum_nz">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="nums" transfer-ownership="none">
<array length="2" c:type="int*">
<type name="int"/>
</array>
</return-value>
<parameters>
<parameter name="nums" transfer-ownership="none">
+ <array length="2">
+ <type name="int"/>
+ </array>
+ </parameter>
+ <parameter name="n_nums" transfer-ownership="none">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="compute_sum_nz" c:identifier="annotation_object_compute_sum_nz">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="nums" transfer-ownership="none">
<array length="2" zero-terminated="1">
<type name="int"/>
</array>
}
/**
+ * annotation_object_compute_sum_nz:
+ * @object: a #AnnotationObject
+ * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers
+ * @n_nums: Length of number array
+ *
+ * Test taking a zero-terminated array with length parameter
+ **/
+void
+annotation_object_compute_sum_nz(AnnotationObject *object,
+ int *nums,
+ int n_nums)
+{
+
+}
+
+/**
* annotation_object_allow_none:
* @object: a #GObject
* @somearg: (allow-none):
void annotation_object_compute_sum_n(AnnotationObject *object,
int *nums,
int n_nums);
+void annotation_object_compute_sum_nz(AnnotationObject *object,
+ int *nums,
+ int n_nums);
GObject* annotation_object_do_not_use (AnnotationObject *object);