]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support empty ref_function and unref_function attributes, fix
authorJürg Billeter <j@bitron.ch>
Sun, 14 Dec 2008 23:47:17 +0000 (23:47 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 14 Dec 2008 23:47:17 +0000 (23:47 +0000)
2008-12-15  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodebasemodule.vala:
* vapi/glib-2.0.vapi:

Support empty ref_function and unref_function attributes,
fix GSequenceIter binding

svn path=/trunk/; revision=2150

ChangeLog
gobject/valaccodebasemodule.vala
vapi/glib-2.0.vapi

index 43278472f71b0f5b4c34e3ff114dc127d8b1b750..366626161ef744503c4bd6cefd4107939867cbf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-15  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodebasemodule.vala:
+       * vapi/glib-2.0.vapi:
+
+       Support empty ref_function and unref_function attributes,
+       fix GSequenceIter binding
+
 2008-12-15  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodebasemodule.vala:
index 40ceed6fbae839887f09b2887c0eceff9c51b010..2353f60e94f46b9fa1b4490ef139ab57886aed7e 100644 (file)
@@ -2306,6 +2306,13 @@ public class Vala.CCodeBaseModule : CCodeModule {
                        return false;
                }
 
+               var cl = type.data_type as Class;
+               if (cl != null && cl.is_reference_counting ()
+                   && cl.get_ref_function () == "") {
+                       // empty ref_function => no ref necessary
+                       return false;
+               }
+
                if (type.type_parameter != null) {
                        if (!(current_type_symbol is Class) || current_class.is_compact) {
                                return false;
@@ -2320,6 +2327,13 @@ public class Vala.CCodeBaseModule : CCodeModule {
                        return false;
                }
 
+               var cl = type.data_type as Class;
+               if (cl != null && cl.is_reference_counting ()
+                   && cl.get_unref_function () == "") {
+                       // empty unref_function => no unref necessary
+                       return false;
+               }
+
                if (type.type_parameter != null) {
                        if (!(current_type_symbol is Class) || current_class.is_compact) {
                                return false;
index 5157d6de177b308f575df68bee7e0b4c2c73b8f6..cc3744d22273f1848f6b1cde0c22c7dcd23aa3d6 100644 (file)
@@ -2862,9 +2862,9 @@ namespace GLib {
                public static SequenceIter<G> range_get_midpoint (SequenceIter<G> begin, SequenceIter<G> end);
        }
 
-       [SimpleType]
-       [CCode (cname = "GSequenceIter*", type_id = "G_TYPE_POINTER")]
-       public struct SequenceIter<G> {
+       [Compact]
+       [CCode (ref_function = "", unref_function = "")]
+       public class SequenceIter<G> {
                public bool is_begin ();
                public bool is_end ();
                public SequenceIter<G> next ();