param = params_it.get ();
ellipsis = param.ellipsis;
if (!ellipsis) {
+ // g_array_new: element size
+ if (cl == garray_type && param.name == "element_size") {
+ var csizeof = new CCodeFunctionCall (new CCodeIdentifier ("sizeof"));
+ csizeof.add_argument (new CCodeIdentifier (expr.type_reference.get_type_arguments ().get (0).get_cname ()));
+ cexpr = csizeof;
+ }
+
if (!param.no_array_length && param.variable_type is ArrayType) {
var array_type = (ArrayType) param.variable_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
ellipsis = true;
break;
}
-
+
if (param.initializer == null) {
Report.error (expr.source_reference, "no default expression for argument %d".printf (i));
return;
[CCode (cname = "len")]
public uint length;
- public Array (bool zero_terminated, bool clear, ulong element_size);
+ public Array (bool zero_terminated = true, bool clear = true, ulong element_size = 0);
[CCode (cname = "g_array_sized_new")]
public Array.sized (bool zero_terminated, bool clear, ulong element_size, uint reserved_size);
public void append_val (owned G value);