From a86abd4240622ec377bbc5773850a4593e13f7eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sun, 21 Mar 2010 19:49:28 +0100 Subject: [PATCH] Fix build with vala master --- gee/functions.vala | 6 +----- gee/linkedlist.vala | 4 ++-- gee/treeset.vala | 18 +++++++++--------- tests/testreadonlycollection.vala | 4 ++-- tests/testreadonlymap.vala | 4 ++-- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/gee/functions.vala b/gee/functions.vala index 6c7a138..b7ee46b 100644 --- a/gee/functions.vala +++ b/gee/functions.vala @@ -80,17 +80,13 @@ namespace Gee { if (t == typeof (string)) { return (CompareFunc) strcmp; } else if (t.is_a (typeof (Comparable))) { - return (CompareFunc) comparable_compare; + return (CompareFunc) Comparable.compare_to; } else { return (CompareFunc) direct_compare; } } } - internal static int comparable_compare (void* a, void* b) { - return ((Comparable) a).compare_to ((Comparable) b); - } - /** * Compares two arbitrary elements together. * diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala index 68b7840..020ef77 100644 --- a/gee/linkedlist.vala +++ b/gee/linkedlist.vala @@ -35,8 +35,8 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { private int _size = 0; private int _stamp = 0; - private Node? _head = null; - private Node? _tail = null; + private Node? _head = null; + private Node? _tail = null; /** * The elements' equality testing function. diff --git a/gee/treeset.vala b/gee/treeset.vala index 53a7848..62ff8f3 100644 --- a/gee/treeset.vala +++ b/gee/treeset.vala @@ -243,7 +243,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { fix_up (ref node); } - private bool remove_from_node (ref Node? node, G item, out weak Node? prev = null, out weak Node? next = null) { + private bool remove_from_node (ref Node? node, G item, out unowned Node? prev = null, out unowned Node? next = null) { #if DEBUG stdout.printf ("Removing %s from %s\n", (string)item, node != null ? (string)node.key : null); #endif @@ -375,7 +375,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return new SubSet (this, after, before); } - private inline weak Node? find_node (G item) { + private inline unowned Node? find_node (G item) { weak Node? cur = root; while (cur != null) { int res = compare_func (item, cur.key); @@ -398,7 +398,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return node != null ? new Iterator.pointing (this, node) : null; } - private inline weak Node? find_nearest (G item) { + private inline unowned Node? find_nearest (G item) { weak Node? cur = root; while (cur != null) { int res = compare_func (item, cur.key); @@ -417,28 +417,28 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return null; } - private inline weak Node? find_lower (G item) { + private inline unowned Node? find_lower (G item) { weak Node? node = find_nearest (item); if (node == null) return null; return compare_func (item, node.key) <= 0 ? node.prev : node; } - private inline weak Node? find_higher (G item) { + private inline unowned Node? find_higher (G item) { weak Node? node = find_nearest (item); if (node == null) return null; return compare_func (item, node.key) >= 0 ? node.next : node; } - private inline weak Node? find_floor (G item) { + private inline unowned Node? find_floor (G item) { weak Node? node = find_nearest (item); if (node == null) return null; return compare_func (item, node.key) < 0 ? node.prev : node; } - private inline weak Node? find_ceil (G item) { + private inline unowned Node? find_ceil (G item) { weak Node? node = find_nearest (item); if (node == null) return null; @@ -803,7 +803,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { } } - public weak Node? first () { + public unowned Node? first () { switch (type) { case RangeType.EMPTY: return null; @@ -814,7 +814,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { } } - public weak Node? last () { + public unowned Node? last () { switch (type) { case RangeType.EMPTY: return null; diff --git a/tests/testreadonlycollection.vala b/tests/testreadonlycollection.vala index 6c09f86..7ee6417 100644 --- a/tests/testreadonlycollection.vala +++ b/tests/testreadonlycollection.vala @@ -61,13 +61,13 @@ public class ReadOnlyCollectionTests : Gee.TestCase { assert (ro_collection == another_ro_collection); ro_collection.set_data ("marker", new Object ()); - assert (another_ro_collection.get_data ("marker") != null); + assert (another_ro_collection.get_data ("marker") != null); another_ro_collection = null; ro_collection = null; another_ro_collection = get_ro_view (test_collection); - assert (another_ro_collection.get_data ("marker") == null); + assert (another_ro_collection.get_data ("marker") == null); // Check that the read-only view of the view is itself assert (another_ro_collection == get_ro_view (another_ro_collection)); diff --git a/tests/testreadonlymap.vala b/tests/testreadonlymap.vala index 217079e..e33b509 100644 --- a/tests/testreadonlymap.vala +++ b/tests/testreadonlymap.vala @@ -52,13 +52,13 @@ public class ReadOnlyMapTests : Gee.TestCase { assert (ro_map == another_ro_map); ro_map.set_data ("marker", new Object ()); - assert (another_ro_map.get_data ("marker") != null); + assert (another_ro_map.get_data ("marker") != null); another_ro_map = null; ro_map = null; another_ro_map = test_map.read_only_view; - assert (another_ro_map.get_data ("marker") == null); + assert (another_ro_map.get_data ("marker") == null); // Check that the read-only view of the view is itself assert (another_ro_map == another_ro_map.read_only_view); -- 2.7.4