vala r2192 - in trunk: . gobject



Author: juergbi
Date: Tue Dec 16 22:12:04 2008
New Revision: 2192
URL: http://svn.gnome.org/viewvc/vala?rev=2192&view=rev

Log:
2008-12-16  JÃrg Billeter  <j bitron ch>

	* gobject/valaccodebasemodule.vala:
	* gobject/valaccodemethodmodule.vala:

	Fix temporary variable handling when using methods defined in
	VAPI files


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodebasemodule.vala
   trunk/gobject/valaccodemethodmodule.vala

Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala	(original)
+++ trunk/gobject/valaccodebasemodule.vala	Tue Dec 16 22:12:04 2008
@@ -139,7 +139,7 @@
 
 	public Set<string> wrappers;
 
-	Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
+	public Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
 	public CCodeBaseModule (CCodeGenerator codegen, CCodeModule? next) {
 		base (codegen, next);
@@ -282,6 +282,7 @@
 		user_marshal_set = new HashSet<string> (str_hash, str_equal);
 		
 		next_temp_var_id = 0;
+		variable_name_map.clear ();
 		
 		string_h_needed = false;
 		gvaluecollector_h_needed = false;
@@ -1032,11 +1033,14 @@
 		check_type (prop.property_type);
 
 		int old_next_temp_var_id = next_temp_var_id;
+		var old_variable_name_map = variable_name_map;
 		next_temp_var_id = 0;
+		variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
 		prop.accept_children (codegen);
 
 		next_temp_var_id = old_next_temp_var_id;
+		variable_name_map = old_variable_name_map;
 
 		var cl = prop.parent_symbol as Class;
 		if (cl != null && cl.is_subtype_of (gobject_type)

Modified: trunk/gobject/valaccodemethodmodule.vala
==============================================================================
--- trunk/gobject/valaccodemethodmodule.vala	(original)
+++ trunk/gobject/valaccodemethodmodule.vala	Tue Dec 16 22:12:04 2008
@@ -62,6 +62,7 @@
 		DataType old_return_type = current_return_type;
 		bool old_method_inner_error = current_method_inner_error;
 		int old_next_temp_var_id = next_temp_var_id;
+		var old_variable_name_map = variable_name_map;
 		if (m.parent_symbol is TypeSymbol) {
 			current_type_symbol = (TypeSymbol) m.parent_symbol;
 		}
@@ -70,6 +71,7 @@
 		current_return_type = m.return_type;
 		current_method_inner_error = false;
 		next_temp_var_id = 0;
+		variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
 		bool in_gtypeinstance_creation_method = false;
 		bool in_gobject_creation_method = false;
@@ -160,6 +162,7 @@
 		current_return_type = old_return_type;
 		current_method_inner_error = old_method_inner_error;
 		next_temp_var_id = old_next_temp_var_id;
+		variable_name_map = old_variable_name_map;
 
 		function = new CCodeFunction (m.get_real_cname (), get_creturn_type (m, creturn_type.get_cname ()));
 		m.ccodenode = function;



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