[vala] codegen: Save some block data members for captured parameters



commit 879c03a2ed8feb87004267f3db2e1d5a12674c4a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun May 8 08:54:39 2011 +0200

    codegen: Save some block data members for captured parameters

 codegen/valaccodebasemodule.vala |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 842a274..d804b39 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1643,12 +1643,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			value = copy_value (value, param);
 		}
 
-		if (param.variable_type is ArrayType) {
-			var array_type = (ArrayType) param.variable_type;
+		var array_type = param.variable_type as ArrayType;
+		var deleg_type = param.variable_type as DelegateType;
+
+		if (array_type != null && !param.no_array_length) {
 			for (int dim = 1; dim <= array_type.rank; dim++) {
 				data.add_field ("gint", get_parameter_array_length_cname (param, dim));
 			}
-		} else if (param.variable_type is DelegateType) {
+		} else if (deleg_type != null && deleg_type.delegate_symbol.has_target) {
 			data.add_field ("gpointer", get_delegate_target_cname (get_variable_cname (param.name)));
 			if (param.variable_type.value_owned) {
 				data.add_field ("GDestroyNotify", get_delegate_target_destroy_notify_cname (get_variable_cname (param.name)));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]