Commit b9e13e39 authored by Rico Tzschichholz's avatar Rico Tzschichholz

codegen: Use get_ccode_delegate_target_name() for fields

Replace get_delegate_target_destroy_notify_cname (get_ccode_name (...))
parent 780ce34e
......@@ -1119,7 +1119,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (delegate_type.is_disposable ()) {
cdecl = new CCodeDeclaration (get_ccode_name (delegate_target_destroy_type));
cdecl.add_declarator (new CCodeVariableDeclarator (get_delegate_target_destroy_notify_cname (get_ccode_name (f))));
cdecl.add_declarator (new CCodeVariableDeclarator (get_ccode_delegate_target_destroy_notify_name (f)));
if (f.is_private_symbol ()) {
cdecl.modifiers = CCodeModifiers.STATIC;
} else if (context.hide_internal && f.is_internal_symbol ()) {
......@@ -1329,7 +1329,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (delegate_type.is_disposable ()) {
var target_destroy_notify_def = new CCodeDeclaration (get_ccode_name (delegate_target_destroy_type));
target_destroy_notify_def.add_declarator (new CCodeVariableDeclarator (get_delegate_target_destroy_notify_cname (get_ccode_name (f)), new CCodeConstant ("NULL")));
target_destroy_notify_def.add_declarator (new CCodeVariableDeclarator (get_ccode_delegate_target_destroy_notify_name (f), new CCodeConstant ("NULL")));
if (!f.is_private_symbol ()) {
target_destroy_notify_def.modifiers = CCodeModifiers.EXTERN;
} else {
......
......@@ -631,7 +631,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
}
} else if (delegate_type != null && delegate_type.delegate_symbol.has_target && get_ccode_delegate_target (field)) {
string target_cname = get_ccode_delegate_target_name (field);
string target_destroy_notify_cname = get_delegate_target_destroy_notify_cname (get_ccode_name (field));
string target_destroy_notify_cname = get_ccode_delegate_target_destroy_notify_name (field);
if (((TypeSymbol) field.parent_symbol).is_reference_type ()) {
result.delegate_target_cvalue = new CCodeMemberAccess.pointer (inst, target_cname);
......@@ -698,7 +698,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
} else if (delegate_type != null && delegate_type.delegate_symbol.has_target && get_ccode_delegate_target (field)) {
result.delegate_target_cvalue = new CCodeIdentifier (get_ccode_delegate_target_name (field));
if (result.value_type.is_disposable ()) {
result.delegate_target_destroy_notify_cvalue = new CCodeIdentifier (get_delegate_target_destroy_notify_cname (get_ccode_name (field)));
result.delegate_target_destroy_notify_cvalue = new CCodeIdentifier (get_ccode_delegate_target_destroy_notify_name (field));
}
}
}
......
......@@ -107,7 +107,7 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
// create field to store delegate target
instance_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
if (delegate_type.is_disposable ()) {
instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
}
}
}
......
......@@ -438,7 +438,7 @@ public class Vala.GTypeModule : GErrorModule {
// create field to store delegate target
instance_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
if (delegate_type.is_disposable ()) {
instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
instance_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
}
}
}
......@@ -540,7 +540,7 @@ public class Vala.GTypeModule : GErrorModule {
// create field to store delegate target
instance_priv_struct.add_field (get_ccode_name (delegate_target_type), get_ccode_delegate_target_name (f));
if (delegate_type.is_disposable ()) {
instance_priv_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_delegate_target_destroy_notify_cname (get_ccode_name (f)));
instance_priv_struct.add_field (get_ccode_name (delegate_target_destroy_type), get_ccode_delegate_target_destroy_notify_name (f));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment