[libgee] Fix compilation with vala master
- From: Maciej Marcin Piechotka <mpiechotka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee] Fix compilation with vala master
- Date: Fri, 20 Jan 2012 16:22:47 +0000 (UTC)
commit e25a061501fc224d6667e9ebdbe8a0e569a8b5ba
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Fri Jan 20 14:45:03 2012 +0000
Fix compilation with vala master
gee/abstractcollection.vala | 10 ++++++++++
gee/concurrentlist.vala | 2 +-
tests/testarraylist.vala | 4 ++++
3 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/gee/abstractcollection.vala b/gee/abstractcollection.vala
index b114be1..e130fac 100644
--- a/gee/abstractcollection.vala
+++ b/gee/abstractcollection.vala
@@ -187,8 +187,13 @@ public abstract class Gee.AbstractCollection<G> : Object, Traversable<G>, Iterab
return array;
}
+#if VALA_0_16
+ private static float?[] to_float_array(Collection<float?> coll) {
+ float?[] array = new float?[coll.size];
+#else
private static float[] to_float_array(Collection<float?> coll) {
float[] array = new float[coll.size];
+#endif
int index = 0;
foreach (float element in coll) {
array[index++] = element;
@@ -196,8 +201,13 @@ public abstract class Gee.AbstractCollection<G> : Object, Traversable<G>, Iterab
return array;
}
+#if VALA_0_16
+ private static double?[] to_double_array(Collection<double?> coll) {
+ double?[] array = new double?[coll.size];
+#else
private static double[] to_double_array(Collection<double?> coll) {
double[] array = new double[coll.size];
+#endif
int index = 0;
foreach (double element in coll) {
array[index++] = element;
diff --git a/gee/concurrentlist.vala b/gee/concurrentlist.vala
index e33deb1..e57c7ec 100644
--- a/gee/concurrentlist.vala
+++ b/gee/concurrentlist.vala
@@ -408,7 +408,7 @@ public class Gee.ConcurrentList<G> : AbstractList<G> {
#endif
}
- public static inline bool proceed<G> (ref Node<G> prev, ref Node<G> curr, bool force = false) {
+ public static inline bool proceed<G> (ref Node<G>? prev, ref Node<G> curr, bool force = false) {
Node<G> next = curr.get_next ();
while (next != null) {
State next_state = next.get_state ();
diff --git a/tests/testarraylist.vala b/tests/testarraylist.vala
index b13ec30..381740e 100644
--- a/tests/testarraylist.vala
+++ b/tests/testarraylist.vala
@@ -131,7 +131,11 @@ public class ArrayListTests : BidirListTests {
assert (double_list.add (1.5d));
assert (double_list.add (2.0d));
+#if VALA_0_16
+ double?[] double_array = double_list.to_array ();
+#else
double[] double_array = double_list.to_array ();
+#endif
index = 0;
foreach (double element in double_list) {
assert (element == double_array[index++]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]