private void write_params_and_return (List<Parameter> params, DataType? return_type, bool return_array_length, string? return_comment = null, bool constructor = false, DataType? instance_type = null, bool user_data = false) {
int last_index = 0;
bool ret_is_struct = return_type != null && return_type.is_real_non_null_struct_type ();
+
+ if (return_type != null && !ret_is_struct) {
+ write_param_or_return (return_type, false, ref last_index, return_array_length, null, return_comment, ParameterDirection.IN, constructor);
+ } else if (ret_is_struct) {
+ write_param_or_return (new VoidType (), false, ref last_index, false, null, return_comment, ParameterDirection.IN);
+ }
+
if (params.size != 0 || instance_type != null || (return_type is ArrayType && return_array_length) || (return_type is DelegateType) || ret_is_struct) {
write_indent ();
buffer.append_printf ("<parameters>\n");
write_indent ();
buffer.append_printf ("</parameters>\n");
}
-
- if (return_type != null && !ret_is_struct) {
- write_param_or_return (return_type, false, ref last_index, return_array_length, null, return_comment, ParameterDirection.IN, constructor);
- } else if (ret_is_struct) {
- write_param_or_return (new VoidType (), false, ref last_index, false, null, return_comment, ParameterDirection.IN);
- }
}
public override void visit_delegate (Delegate cb) {