[libgee] Fix warnings and bump requirements to GLib 2.32



commit cbc209bf496e6245ba1c24cc669a602744177140
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Sun Dec 2 14:04:30 2012 +0000

    Fix warnings and bump requirements to GLib 2.32

 configure.ac           |    6 ++++--
 gee/hashmultimap.vala  |    2 +-
 gee/hazardpointer.vala |   22 +++++++---------------
 gee/readonlymap.vala   |    2 +-
 gee/treemultimap.vala  |    2 +-
 5 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 91f2fb6..7037052 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,9 +14,13 @@ AC_PROG_LIBTOOL
 LIBGEE_LT_VERSION="2:0:0"
 AC_SUBST(LIBGEE_LT_VERSION)
 
+GLIB_REQUIRED=2.32
+
 AM_PROG_VALAC([0.17.5])
 AC_SUBST(VALAC)
 
+VALAFLAGS=--target-glib=$GLIB_REQUIRED
+
 AC_SUBST(VALAFLAGS)
 
 AC_ARG_ENABLE(doc, AS_HELP_STRING([--enable-doc], [Enable documentation generation]), enable_doc=$enableval, enable_doc=no)
@@ -50,8 +54,6 @@ AS_IF([test "x$enable_coverage" != xno],
 AC_ARG_ENABLE(benchmark, AS_HELP_STRING([--enable-benchmark], [Enable benchmark]), enable_benchmark=$enableval, enable_benchmark=no)
 AM_CONDITIONAL(ENABLE_BENCHMARK, test x$enable_benchmark = xyes)
 
-GLIB_REQUIRED=2.12.0
-
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
diff --git a/gee/hashmultimap.vala b/gee/hashmultimap.vala
index 7719d3a..b82be5b 100644
--- a/gee/hashmultimap.vala
+++ b/gee/hashmultimap.vala
@@ -51,7 +51,7 @@ public class Gee.HashMultiMap<K,V> : AbstractMultiMap<K,V> {
 	 */
 	public HashMultiMap (owned HashDataFunc? key_hash_func = null, owned EqualDataFunc? key_equal_func = null,
 	                     owned HashDataFunc? value_hash_func = null, owned EqualDataFunc? value_equal_func = null) {
-		base (new HashMap<K, Set<V>> (key_hash_func, key_equal_func, Functions.get_equal_func_for (typeof (Set<V>))));
+		base (new HashMap<K, Set<V>> (key_hash_func, key_equal_func, Functions.get_equal_func_for (typeof (Set))));
 		if (value_hash_func == null) {
 			value_hash_func = Functions.get_hash_func_for (typeof (V));
 		}
diff --git a/gee/hazardpointer.vala b/gee/hazardpointer.vala
index 7de9b01..1436d26 100644
--- a/gee/hazardpointer.vala
+++ b/gee/hazardpointer.vala
@@ -451,17 +451,13 @@ public class Gee.HazardPointer<G> { // FIXME: Make it a struct
 		private static void start (ReleasePolicy self) { // FIXME: Make it non-static [bug 659778]
 			switch (self) {
 			case HELPER_THREAD:
-				try {
-					Thread.create<bool> (() => {
-						Thread.self<bool> ().set_priority (ThreadPriority.LOW);
-						while (true) {
-							Thread.yield ();
-							attempt_free ();
-						}
-					}, false);
-				} catch (ThreadError error) {
-					assert_not_reached ();
-				}
+				new Thread<bool> ("<<Gee.HazardPointer.Executor>>", () => {
+					Thread.self<bool> ().set_priority (ThreadPriority.LOW);
+					while (true) {
+						Thread.yield ();
+						attempt_free ();
+					}
+				});
 				break;
 			case MAIN_LOOP:
 				Idle.add (() => {
@@ -622,10 +618,6 @@ public class Gee.HazardPointer<G> { // FIXME: Make it a struct
 			return _current_context.get ();
 		}
 
-		private inline bool _should_free () {
-			return (_parent == null && _to_free.size > 0) || _to_free.size >= THRESHOLD;
-		}
-
 		internal Context *_parent;
 		internal ArrayList<FreeNode *> _to_free;
 		internal Policy? _policy;
diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala
index 4f126cc..7d2e7bf 100644
--- a/gee/readonlymap.vala
+++ b/gee/readonlymap.vala
@@ -212,7 +212,7 @@ internal class Gee.ReadOnlyMap<K,V> : Object, Traversable<Map.Entry<K,V>>, Itera
 	 * { inheritDoc}
 	 */
 	public Type element_type {
-		get { return typeof (Map.Entry<K,V>); }
+		get { return typeof (Map.Entry); }
 	}
 
 	/**
diff --git a/gee/treemultimap.vala b/gee/treemultimap.vala
index 51f1f43..eb7c245 100644
--- a/gee/treemultimap.vala
+++ b/gee/treemultimap.vala
@@ -42,7 +42,7 @@ public class Gee.TreeMultiMap<K,V> : AbstractMultiMap<K,V> {
 	 * @param value_compare_func an optional value comparator function
 	 */
 	public TreeMultiMap (owned CompareDataFunc<K>? key_compare_func = null, owned CompareDataFunc<V>? value_compare_func = null) {
-		base (new TreeMap<K, Set<V>> (key_compare_func, Functions.get_equal_func_for (typeof (Set<V>))));
+		base (new TreeMap<K, Set<V>> (key_compare_func, Functions.get_equal_func_for (typeof (Set))));
 		if (value_compare_func == null) {
 			value_compare_func = Functions.get_compare_func_for (typeof (V));
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]