2007-08-31 Jürg Billeter <j@bitron.ch>
+ * gobject/valacodegenerator.vala, gobject/valacodegeneratormethod.vala:
+ number temp variables for each function separately, don't use reserved
+ __ prefix
+
+2007-08-31 Jürg Billeter <j@bitron.ch>
+
* gobject/valacodegenerator.vala: simplify struct variable
initialization, remove unnecessary warning
}
public override void visit_property (Property! prop) {
+ int old_next_temp_var_id = next_temp_var_id;
+ next_temp_var_id = 0;
+
prop.accept_children (this);
+ next_temp_var_id = old_next_temp_var_id;
+
if (prop.parent_symbol is Class) {
prop_enum.add_value (prop.get_upper_case_cname (), null);
}
}
private VariableDeclarator get_temp_variable_declarator (TypeReference! type, bool takes_ownership = true) {
- var decl = new VariableDeclarator ("__temp%d".printf (next_temp_var_id));
+ var decl = new VariableDeclarator ("_tmp%d".printf (next_temp_var_id));
decl.type_reference = type.copy ();
decl.type_reference.is_ref = false;
decl.type_reference.is_out = false;
Method old_method = current_method;
TypeReference 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;
current_symbol = m;
current_method = m;
current_return_type = m.return_type;
current_method_inner_error = false;
+ next_temp_var_id = 0;
if (m is CreationMethod) {
in_creation_method = true;
current_method = current_method;
current_return_type = old_return_type;
current_method_inner_error = old_method_inner_error;
+ next_temp_var_id = old_next_temp_var_id;
if (current_type_symbol != null && current_type_symbol is Interface) {
var iface = (Interface) current_type_symbol;