Fix compilation with vala master
authorMaciej Piechotka <uzytkownik2@gmail.com>
Fri, 20 Jan 2012 14:45:03 +0000 (14:45 +0000)
committerMaciej Piechotka <uzytkownik2@gmail.com>
Fri, 20 Jan 2012 16:21:24 +0000 (16:21 +0000)
gee/abstractcollection.vala
gee/concurrentlist.vala
tests/testarraylist.vala

index b114be1..e130fac 100644 (file)
@@ -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;
index e33deb1..e57c7ec 100644 (file)
@@ -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 ();
index b13ec30..381740e 100644 (file)
@@ -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++]);