From e25a061501fc224d6667e9ebdbe8a0e569a8b5ba Mon Sep 17 00:00:00 2001 From: Maciej Piechotka Date: Fri, 20 Jan 2012 14:45:03 +0000 Subject: [PATCH] Fix compilation with vala master --- gee/abstractcollection.vala | 10 ++++++++++ gee/concurrentlist.vala | 2 +- tests/testarraylist.vala | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) 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 : Object, Traversable, Iterab return array; } +#if VALA_0_16 + private static float?[] to_float_array(Collection coll) { + float?[] array = new float?[coll.size]; +#else private static float[] to_float_array(Collection 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 : Object, Traversable, Iterab return array; } +#if VALA_0_16 + private static double?[] to_double_array(Collection coll) { + double?[] array = new double?[coll.size]; +#else private static double[] to_double_array(Collection 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 : AbstractList { #endif } - public static inline bool proceed (ref Node prev, ref Node curr, bool force = false) { + public static inline bool proceed (ref Node? prev, ref Node curr, bool force = false) { Node 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++]); -- 2.7.4