vala r1820 - in trunk: . gobject vala



Author: juergbi
Date: Fri Oct  3 17:07:04 2008
New Revision: 1820
URL: http://svn.gnome.org/viewvc/vala?rev=1820&view=rev

Log:
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


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodeclassbinding.vala
   trunk/gobject/valaclassregisterfunction.vala
   trunk/vala/valaclass.vala

Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala	(original)
+++ trunk/gobject/valaccodeclassbinding.vala	Fri Oct  3 17:07:04 2008
@@ -316,7 +316,7 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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*"));

Modified: trunk/gobject/valaclassregisterfunction.vala
==============================================================================
--- trunk/gobject/valaclassregisterfunction.vala	(original)
+++ trunk/gobject/valaclassregisterfunction.vala	Fri Oct  3 17:07:04 2008
@@ -89,7 +89,7 @@
 	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 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 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 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 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 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;
 	}

Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala	(original)
+++ trunk/vala/valaclass.vala	Fri Oct  3 17:07:04 2008
@@ -695,7 +695,7 @@
 	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 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 {



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