[vala/wip/attributes: 78/100] Drop Method.vfunc_name



commit dcdc542400ff1d224f23a96ed879e6493e687ffa
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jun 30 09:44:55 2011 +0200

    Drop Method.vfunc_name

 codegen/valadovaobjectmodule.vala |    6 +++---
 vala/valagirparser.vala           |    6 +++---
 vala/valamethod.vala              |   18 ------------------
 vala/valasignal.vala              |    1 -
 vapigen/valagidlparser.vala       |    2 +-
 5 files changed, 7 insertions(+), 26 deletions(-)
---
diff --git a/codegen/valadovaobjectmodule.vala b/codegen/valadovaobjectmodule.vala
index 2eeb6d8..5e308ba 100644
--- a/codegen/valadovaobjectmodule.vala
+++ b/codegen/valadovaobjectmodule.vala
@@ -101,7 +101,7 @@ public class Vala.DovaObjectModule : DovaArrayModule {
 		}
 
 		// add vfunc field to the type struct
-		var vdeclarator = new CCodeFunctionDeclarator (m.vfunc_name);
+		var vdeclarator = new CCodeFunctionDeclarator (get_ccode_vfunc_name (m));
 
 		generate_cparameters (m, decl_space, new CCodeFunction ("fake"), vdeclarator);
 
@@ -1557,7 +1557,7 @@ public class Vala.DovaObjectModule : DovaArrayModule {
 
 			var vcast = get_type_private_from_type ((ObjectTypeSymbol) m.parent_symbol, get_type_from_instance (new CCodeIdentifier ("this")));
 
-			var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.vfunc_name));
+			var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, get_ccode_vfunc_name (m)));
 			vcall.add_argument (new CCodeIdentifier ("this"));
 			foreach (TypeParameter type_param in m.get_type_parameters ()) {
 				vcall.add_argument (new CCodeIdentifier ("%s_type".printf (type_param.name.down ())));
@@ -1601,7 +1601,7 @@ public class Vala.DovaObjectModule : DovaArrayModule {
 
 			vcast = get_type_private_from_type ((ObjectTypeSymbol) m.parent_symbol, base_type);
 
-			vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.vfunc_name));
+			vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, get_ccode_vfunc_name (m)));
 			vcall.add_argument (new CCodeIdentifier ("this"));
 			foreach (TypeParameter type_param in m.get_type_parameters ()) {
 				vcall.add_argument (new CCodeIdentifier ("%s_type".printf (type_param.name.down ())));
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index b8054a0..faeb515 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -684,7 +684,7 @@ public class Vala.GirParser : CodeVisitor {
 										   and g-ir-scanner missed it */
 										var invoker = parser.find_invoker (this);
 										if (invoker != null) {
-											m.vfunc_name = m.name;
+											m.set_attribute_string ("CCode", "vfunc_name", m.name);
 											m.name = invoker.symbol.name;
 											m.attributes.remove (attr);
 											invoker.merged = true;
@@ -2474,7 +2474,7 @@ public class Vala.GirParser : CodeVisitor {
 					s.attributes.append (new Attribute ("NoWrapper", s.source_reference));
 				} else {
 					if (current.girdata["name"] != name) {
-						m.vfunc_name = current.girdata["name"];
+						m.set_attribute_string ("CCode", "vfunc_name", current.girdata["name"]);
 					}
 				}
 			} else if (element_name == "function") {
@@ -2492,7 +2492,7 @@ public class Vala.GirParser : CodeVisitor {
 				method.is_virtual = false;
 			}
 			if (metadata.has_argument (ArgumentType.VFUNC_NAME)) {
-				method.vfunc_name = metadata.get_string (ArgumentType.VFUNC_NAME);
+				method.set_attribute_string ("CCode", "vfunc_name", metadata.get_string (ArgumentType.VFUNC_NAME));
 				method.is_virtual = true;
 			}
 		}
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index ac0c6b3..3cae883 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -54,21 +54,6 @@ public class Vala.Method : Subroutine {
 	public MemberBinding binding { get; set; default = MemberBinding.INSTANCE; }
 
 	/**
-	 * The name of the vfunc of this method as it is used in C code.
-	 */
-	public string vfunc_name {
-		get {
-			if (_vfunc_name == null) {
-				_vfunc_name = this.name;
-			}
-			return _vfunc_name;
-		}
-		set {
-			_vfunc_name = value;
-		}
-	}
-
-	/**
 	 * The sentinel to use for terminating variable length argument lists.
 	 */
 	public string sentinel {
@@ -416,9 +401,6 @@ public class Vala.Method : Subroutine {
 		if (a.has_argument ("cname")) {
 			set_cname (a.get_string ("cname"));
 		}
-		if (a.has_argument ("vfunc_name")) {
-			this.vfunc_name = a.get_string ("vfunc_name");
-		}
 		if (a.has_argument ("finish_name")) {
 			this.finish_name = a.get_string ("finish_name");
 		}
diff --git a/vala/valasignal.vala b/vala/valasignal.vala
index ea4b767..bfff34e 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -319,7 +319,6 @@ public class Vala.Signal : Symbol, Lockable {
 			default_handler.external = external;
 			default_handler.hides = hides;
 			default_handler.is_virtual = true;
-			default_handler.vfunc_name = name;
 			default_handler.signal_reference = this;
 			default_handler.body = body;
 
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 0c6056c..d146a3d 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -2204,7 +2204,7 @@ public class Vala.GIdlParser : CodeVisitor {
 						m.is_virtual = true;
 					}
 				} else if (nv[0] == "vfunc_name") {
-					m.vfunc_name = eval (nv[1]);
+					m.set_attribute_string ("CCode", "vfunc_name", eval (nv[1]));
 				} else if (nv[0] == "finish_name") {
 					m.set_attribute_string ("CCode", "finish_name", eval (nv[1]));
 				} else if (nv[0] == "async") {



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