Commit e5c3ddd2 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Fix cname of GValue helper functions for fundamental classes

2008-10-03  Jürg Billeter  <j@bitron.ch>

	* vala/valaclass.vala:
	* gobject/valaccodeclassbinding.vala:
	* gobject/valaclassregisterfunction.vala:

	Fix cname of GValue helper functions for fundamental classes

svn path=/trunk/; revision=1820
parent 728566f2
2008-10-03 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaclassregisterfunction.vala:
Fix cname of GValue helper functions for fundamental classes
2008-10-03 Jürg Billeter <j@bitron.ch>
* vala/valasignal.vala:
......
......@@ -316,7 +316,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_init_function (Class cl) {
var function = new CCodeFunction ("%svalue_%s_init".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down() ), "void");
var function = new CCodeFunction ("%s_init".printf (cl.get_lower_case_cname ("value_")), "void");
function.add_parameter (new CCodeFormalParameter ("value", "GValue*"));
function.modifiers = CCodeModifiers.STATIC;
......@@ -328,7 +328,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_free_function (Class cl) {
var function = new CCodeFunction ("%svalue_%s_free_value".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down()), "void");
var function = new CCodeFunction ("%s_free_value".printf (cl.get_lower_case_cname ("value_")), "void");
function.add_parameter (new CCodeFormalParameter ("value", "GValue*"));
function.modifiers = CCodeModifiers.STATIC;
......@@ -347,7 +347,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_copy_function (Class cl) {
var function = new CCodeFunction ("%svalue_%s_copy_value".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down()), "void");
var function = new CCodeFunction ("%s_copy_value".printf (cl.get_lower_case_cname ("value_")), "void");
function.add_parameter (new CCodeFormalParameter ("src_value", "const GValue*"));
function.add_parameter (new CCodeFormalParameter ("dest_value", "GValue*"));
function.modifiers = CCodeModifiers.STATIC;
......@@ -374,7 +374,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_peek_pointer_function (Class cl) {
var function = new CCodeFunction ("%svalue_%s_peek_pointer".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down()), "gpointer");
var function = new CCodeFunction ("%s_peek_pointer".printf (cl.get_lower_case_cname ("value_")), "gpointer");
function.add_parameter (new CCodeFormalParameter ("value", "const GValue*"));
function.modifiers = CCodeModifiers.STATIC;
......@@ -389,7 +389,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_lcopy_value_function ( Class cl ) {
var function = new CCodeFunction ("%svalue_%s_lcopy_value".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down()), "gchar*");
var function = new CCodeFunction ("%s_lcopy_value".printf (cl.get_lower_case_cname ("value_")), "gchar*");
function.add_parameter (new CCodeFormalParameter ("value", "const GValue*"));
function.add_parameter (new CCodeFormalParameter ("n_collect_values", "guint"));
function.add_parameter (new CCodeFormalParameter ("collect_values", "GTypeCValue*"));
......@@ -434,7 +434,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_type_value_table_collect_value_function (Class cl) {
var function = new CCodeFunction ("%svalue_%s_collect_value".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down()), "gchar*");
var function = new CCodeFunction ("%s_collect_value".printf (cl.get_lower_case_cname ("value_")), "gchar*");
function.add_parameter (new CCodeFormalParameter ("value", "GValue*"));
function.add_parameter (new CCodeFormalParameter ("n_collect_values", "guint"));
function.add_parameter (new CCodeFormalParameter ("collect_values", "GTypeCValue*"));
......@@ -504,7 +504,7 @@ public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
}
private void add_g_param_spec_type_function (Class cl) {
var function_name = "%sparam_spec_%s".printf (cl.parent_symbol.get_lower_case_cprefix (), cl.name.down());
var function_name = cl.get_lower_case_cname ("param_spec_");
var function = new CCodeFunction (function_name, "GParamSpec*");
function.add_parameter (new CCodeFormalParameter ("name", "const gchar*"));
......
......@@ -89,7 +89,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_init_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_init".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_init".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......@@ -97,7 +97,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_free_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_free_value".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_free_value".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......@@ -105,7 +105,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_copy_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_copy_value".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_copy_value".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......@@ -113,7 +113,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_peek_pointer_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_peek_pointer".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_peek_pointer".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......@@ -121,7 +121,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_collect_value_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_collect_value".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_collect_value".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......@@ -129,7 +129,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
public override string? get_gtype_value_table_lcopy_value_function_name () {
bool is_fundamental = !class_reference.is_compact && !class_reference.is_static && class_reference.base_class == null;
if ( is_fundamental )
return "%svalue_%s_lcopy_value".printf(class_reference.parent_symbol.get_lower_case_cprefix (), class_reference.name.down() );
return "%s_lcopy_value".printf (class_reference.get_lower_case_cname ("value_"));
return null;
}
......
......@@ -695,7 +695,7 @@ public class Vala.Class : ObjectTypeSymbol {
public override string? get_get_value_function () {
if (get_value_function == null) {
if (is_fundamental()) {
get_value_function = "%svalue_get_%s".printf(parent_symbol.get_lower_case_cprefix (), name.down());
get_value_function = get_lower_case_cname ("value_get_");
} else if (base_class != null) {
get_value_function = base_class.get_get_value_function ();
} else {
......@@ -709,7 +709,7 @@ public class Vala.Class : ObjectTypeSymbol {
public override string? get_set_value_function () {
if (set_value_function == null) {
if (is_fundamental()) {
set_value_function = "%svalue_set_%s".printf(parent_symbol.get_lower_case_cprefix (), name.down());
set_value_function = get_lower_case_cname ("value_set_");
} else if (base_class != null) {
set_value_function = base_class.get_set_value_function ();
} else {
......
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