[vala/0.48] girwriter: Fix position of "result" parameter for struct constructor
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] girwriter: Fix position of "result" parameter for struct constructor
- Date: Sun, 22 Aug 2021 09:11:13 +0000 (UTC)
commit 12baa6ed0e7d9fa9506b2c86553f921422d2cb9c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Aug 5 17:14:48 2021 +0200
girwriter: Fix position of "result" parameter for struct constructor
Thanks to Princeton Ferro
codegen/valagirwriter.vala | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 2f75b9f63..d2129f432 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -1192,6 +1192,11 @@ public class Vala.GIRWriter : CodeVisitor {
}
}
+ if (constructor && ret_is_struct) {
+ // struct constructor has its result as first parameter
+ write_param_or_return (return_type, "parameter", ref index, false, "result",
return_comment, ParameterDirection.OUT, constructor, true);
+ }
+
if (type_params != null) {
foreach (var p in type_params) {
write_type_parameter (p, "parameter");
@@ -1205,10 +1210,10 @@ public class Vala.GIRWriter : CodeVisitor {
write_implicit_params (param.variable_type, ref index, get_ccode_array_length
(param), get_ccode_name (param), param.direction);
}
- if (ret_is_struct) {
+ if (!constructor && ret_is_struct) {
// struct returns are converted to parameters
write_param_or_return (return_type, "parameter", ref index, false, "result",
return_comment, ParameterDirection.OUT, constructor, true);
- } else {
+ } else if (!constructor) {
write_implicit_params (return_type, ref index, return_array_length, "result",
ParameterDirection.OUT);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]