summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Piechotka <uzytkownik2@gmail.com>2013-12-16 00:37:34 +0100
committerMaciej Piechotka <uzytkownik2@gmail.com>2013-12-16 00:37:34 +0100
commit5cdd8edbeff52480768d4dd6d42310438426a92d (patch)
tree01d7c023f4d8f2d6865394b44d0df59fd5494354
parent95c6a736eccbdd3fe5b6387453f6638e59ca38ea (diff)
downloadlibgee-5cdd8edbeff52480768d4dd6d42310438426a92d.tar.gz
Fix various warnings
-rw-r--r--gee/collection.vala1
-rw-r--r--gee/concurrentset.vala2
-rw-r--r--gee/hashmap.vala37
-rw-r--r--gee/lazy.vala1
-rw-r--r--gee/lightmapfuture.vala1
-rw-r--r--gee/promise.vala1
-rw-r--r--gee/readonlybidirsortedmap.vala2
-rw-r--r--gee/readonlysortedmap.vala2
-rw-r--r--gee/traversable.vala4
-rw-r--r--gee/treemap.vala2
10 files changed, 12 insertions, 41 deletions
diff --git a/gee/collection.vala b/gee/collection.vala
index f748504..a67f944 100644
--- a/gee/collection.vala
+++ b/gee/collection.vala
@@ -342,7 +342,6 @@ public interface Gee.Collection<G> : Iterable<G> {
changed |= remove (val);
return true;
});
- return changed;
}
/**
diff --git a/gee/concurrentset.vala b/gee/concurrentset.vala
index 747e579..c0b7b80 100644
--- a/gee/concurrentset.vala
+++ b/gee/concurrentset.vala
@@ -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
diff --git a/gee/hashmap.vala b/gee/hashmap.vala
index 805d075..b66a2f4 100644
--- a/gee/hashmap.vala
+++ b/gee/hashmap.vala
@@ -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 {
diff --git a/gee/lazy.vala b/gee/lazy.vala
index fde93bd..00c34ba 100644
--- a/gee/lazy.vala
+++ b/gee/lazy.vala
@@ -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 {
diff --git a/gee/lightmapfuture.vala b/gee/lightmapfuture.vala
index 60c888b..86daf5e 100644
--- a/gee/lightmapfuture.vala
+++ b/gee/lightmapfuture.vala
@@ -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);
}
diff --git a/gee/promise.vala b/gee/promise.vala
index cb92196..74d4de0 100644
--- a/gee/promise.vala
+++ b/gee/promise.vala
@@ -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");
diff --git a/gee/readonlybidirsortedmap.vala b/gee/readonlybidirsortedmap.vala
index e621ee6..66f32ba 100644
--- a/gee/readonlybidirsortedmap.vala
+++ b/gee/readonlybidirsortedmap.vala
@@ -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;
}
diff --git a/gee/readonlysortedmap.vala b/gee/readonlysortedmap.vala
index d6e7b2b..136022f 100644
--- a/gee/readonlysortedmap.vala
+++ b/gee/readonlysortedmap.vala
@@ -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;
}
diff --git a/gee/traversable.vala b/gee/traversable.vala
index f98e933..58aba5a 100644
--- a/gee/traversable.vala
+++ b/gee/traversable.vala
@@ -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 ();
diff --git a/gee/treemap.vala b/gee/treemap.vala
index c3ef896..bd67adb 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -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;