Fix various warnings
authorMaciej Piechotka <uzytkownik2@gmail.com>
Sun, 15 Dec 2013 23:37:34 +0000 (00:37 +0100)
committerMaciej Piechotka <uzytkownik2@gmail.com>
Sun, 15 Dec 2013 23:37:34 +0000 (00:37 +0100)
gee/collection.vala
gee/concurrentset.vala
gee/hashmap.vala
gee/lazy.vala
gee/lightmapfuture.vala
gee/promise.vala
gee/readonlybidirsortedmap.vala
gee/readonlysortedmap.vala
gee/traversable.vala
gee/treemap.vala

index f748504..a67f944 100644 (file)
@@ -342,7 +342,6 @@ public interface Gee.Collection<G> : Iterable<G> {
                        changed |= remove (val);
                        return true;
                });
-               return changed;
        }
 
        /**
index 747e579..c0b7b80 100644 (file)
@@ -897,6 +897,7 @@ public class Gee.ConcurrentSet<G> : AbstractSortedSet<G> {
 
                public static void improve_bookmark<G> (Range<G> range, out Tower<G>? out_curr = null, out TowerIter<G> prev = null) {
                        prev = TowerIter<G>();
+                       out_curr = null;
                        switch (range._type) {
                        case RangeType.HEAD:
                                if (&out_curr != null) {
@@ -1098,6 +1099,7 @@ public class Gee.ConcurrentSet<G> : AbstractSortedSet<G> {
 
                public static inline bool search_from_bookmark<G> (CompareDataFunc<G>? cmp, G key, ref TowerIter<G> prev, out TowerIter<G> next = null, uint8 to_level = 0, uint8 from_level = (uint8)_MAX_HEIGHT - 1) {
                        assert (from_level >= to_level);
+                       next = TowerIter<G>();
                        bool res = false;
                        for (int i = from_level; i >= to_level; i--) {
                                unowned Tower<G> tmp_prev = prev._iter[i]; // Should be treated as NULL-like value
index 805d075..b66a2f4 100644 (file)
@@ -403,19 +403,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
                public override bool contains (K key) {
                        return _map.has_key (key);
                }
-
-               public bool add_all (Collection<K> collection) {
-                       assert_not_reached ();
-               }
-
-               public bool remove_all (Collection<K> collection) {
-                       assert_not_reached ();
-               }
-
-               public bool retain_all (Collection<K> collection) {
-                       assert_not_reached ();
-               }
-
        }
 
        private class ValueCollection<K,V> : AbstractCollection<V> {
@@ -458,18 +445,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
                        }
                        return false;
                }
-
-               public bool add_all (Collection<V> collection) {
-                       assert_not_reached ();
-               }
-
-               public bool remove_all (Collection<V> collection) {
-                       assert_not_reached ();
-               }
-
-               public bool retain_all (Collection<V> collection) {
-                       assert_not_reached ();
-               }
        }
 
        private class EntrySet<K,V> : AbstractSet<Map.Entry<K, V>> {
@@ -506,18 +481,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
                public override bool contains (Map.Entry<K, V> entry) {
                        return _map.has (entry.key, entry.value);
                }
-
-               public bool add_all (Collection<Map.Entry<K, V>> entries) {
-                       assert_not_reached ();
-               }
-
-               public bool remove_all (Collection<Map.Entry<K, V>> entries) {
-                       assert_not_reached ();
-               }
-
-               public bool retain_all (Collection<Map.Entry<K, V>> entries) {
-                       assert_not_reached ();
-               }
        }
 
        private abstract class NodeIterator<K,V> : Object {
index fde93bd..00c34ba 100644 (file)
@@ -110,6 +110,7 @@ public class Gee.Lazy<G> {
                                        bool res = _eval.wait_until (_mutex, end_time);
                                        _mutex.unlock ();
                                        if (!res) {
+                                               value = null;
                                                return false;
                                        }
                                } else {
index 60c888b..86daf5e 100644 (file)
@@ -44,6 +44,7 @@ internal class Gee.LightMapFuture<A, G> : Object, Future<A> {
        public bool wait_until (int64 end_time, out unowned G? value = null) throws Gee.FutureError {
                unowned A arg;
                bool result;
+               value = null;
                if ((result = _base.wait_until (end_time, out arg))) {
                        value = _func (arg);
                }
index cb92196..74d4de0 100644 (file)
@@ -112,6 +112,7 @@ public class Gee.Promise<G> {
                        _mutex.unlock ();
                        switch (state) {
                        case State.INIT:
+                               value = null;
                                return false;
                        case State.ABANDON:
                                throw new FutureError.ABANDON_PROMISE ("Promise has been abandon");
index e621ee6..66f32ba 100644 (file)
@@ -49,7 +49,7 @@ internal class Gee.ReadOnlyBidirSortedMap<K,V> : ReadOnlySortedMap<K,V>, BidirSo
        /**
         * {@inheritDoc}
         */
-       public BidirSortedMap<K,V> read_only_view {
+       public new BidirSortedMap<K,V> read_only_view {
                owned get {
                        return this;
                }
index d6e7b2b..136022f 100644 (file)
@@ -81,7 +81,7 @@ internal class Gee.ReadOnlySortedMap<K,V> : ReadOnlyMap<K,V>, SortedMap<K,V> {
        /**
         * {@inheritDoc}
         */
-       public SortedMap<K, V> read_only_view {
+       public new SortedMap<K, V> read_only_view {
                owned get {
                        return this;
                }
index f98e933..58aba5a 100644 (file)
@@ -356,6 +356,7 @@ public interface Gee.Traversable<G> : Object {
                        switch (state) {
                        case Stream.YIELD:
                                if (current == null || !current.next ()) {
+                                       val = null;
                                        return Stream.CONTINUE;
                                } else {
                                        val = new Lazy<A> (() => {return current.get ();});
@@ -367,6 +368,7 @@ public interface Gee.Traversable<G> : Object {
                                        val = new Lazy<A> (() => {return current.get ();});
                                        return Stream.YIELD;
                                } else {
+                                       val = null;
                                        return Stream.WAIT;
                                }
                        case Stream.WAIT:
@@ -374,9 +376,11 @@ public interface Gee.Traversable<G> : Object {
                                        val = new Lazy<A> (() => {return current.get ();});
                                        return Stream.YIELD;
                                } else {
+                                       val = null;
                                        return Stream.CONTINUE;
                                }
                        case Stream.END:
+                               val = null;
                                return Stream.END;
                        default:
                                assert_not_reached ();
index c3ef896..bd67adb 100644 (file)
@@ -280,7 +280,7 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
                }
        }
 
-       private void fix_removal (ref Node<K,V> node, out K? key = null, out V? value) {
+       private void fix_removal (ref Node<K,V> node, out K? key = null, out V? value = null) {
                Node<K,V> n = (owned) node;
                key = (owned) n.key;
                value = (owned) n.value;