[libgee/0.6] Fix compilation with vala master
- From: Maciej Marcin Piechotka <mpiechotka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee/0.6] Fix compilation with vala master
- Date: Fri, 20 Jan 2012 16:20:49 +0000 (UTC)
commit f76f6eb694106b701e73f6f2302427bf6d047111
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Mon Dec 19 04:16:32 2011 +0100
Fix compilation with vala master
gee/abstractcollection.vala | 10 ++++++++++
gee/priorityqueue.vala | 8 ++++++++
tests/testarraylist.vala | 4 ++++
3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gee/abstractcollection.vala b/gee/abstractcollection.vala
index e7ef6be..9ba4a25 100644
--- a/gee/abstractcollection.vala
+++ b/gee/abstractcollection.vala
@@ -182,8 +182,13 @@ public abstract class Gee.AbstractCollection<G> : Object, Iterable<G>, Collectio
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;
@@ -191,8 +196,13 @@ public abstract class Gee.AbstractCollection<G> : Object, Iterable<G>, Collectio
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/priorityqueue.vala b/gee/priorityqueue.vala
index 6c45238..029a2f1 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -53,7 +53,11 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
private Type2Node<G>? _lm_head = null;
private Type2Node<G>? _lm_tail = null;
private Type1Node<G>? _p = null;
+#if VALA_0_16
+ private Type1Node<G>?[] _a = new Type1Node<G>?[0];
+#else
private Type1Node<G>?[] _a = new Type1Node<G>[0];
+#endif
private NodePair<G>? _lp_head = null;
private NodePair<G>? _lp_tail = null;
private bool[] _b = new bool[0];
@@ -316,7 +320,11 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
_lm_head = null;
_lm_tail = null;
_p = null;
+#if VALA_0_16
+ _a = new Type1Node<G>?[0];
+#else
_a = new Type1Node<G>[0];
+#endif
_lp_head = null;
_lp_tail = null;
_b = new bool[0];
diff --git a/tests/testarraylist.vala b/tests/testarraylist.vala
index e5340c5..9537f79 100644
--- a/tests/testarraylist.vala
+++ b/tests/testarraylist.vala
@@ -148,7 +148,11 @@ public class ArrayListTests : ListTests {
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]