[vala] Clear array ouptut parameters
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Clear array ouptut parameters
- Date: Tue, 23 Feb 2010 19:14:05 +0000 (UTC)
commit f23f243cf2a250a01666aa7a88b5d21d7073cb29
Author: Jürg Billeter <j bitron ch>
Date: Tue Feb 23 20:13:26 2010 +0100
Clear array ouptut parameters
codegen/valaccodemethodmodule.vala | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index e83eb84..f7b30ae 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -531,15 +531,18 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
break;
}
- var t = param.parameter_type.data_type;
- if (t != null && t.is_reference_type ()) {
- if (param.direction != ParameterDirection.OUT) {
+ if (param.direction != ParameterDirection.OUT) {
+ var t = param.parameter_type.data_type;
+ if (t != null && t.is_reference_type ()) {
var type_check = create_method_type_check_statement (m, creturn_type, t, !param.parameter_type.nullable, get_variable_cname (param.name));
if (type_check != null) {
type_check.line = function.line;
cinit.append (type_check);
}
- } else if (!m.coroutine) {
+ }
+ } else if (!m.coroutine) {
+ var t = param.parameter_type.data_type;
+ if ((t != null && t.is_reference_type ()) || param.parameter_type is ArrayType) {
// ensure that the passed reference for output parameter is cleared
var a = new CCodeAssignment (new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, get_variable_cexpression (param.name)), new CCodeConstant ("NULL"));
var cblock = new CCodeBlock ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]