Commit 84a682dd authored by Colomban Wendling's avatar Colomban Wendling
Browse files

Tighten dependency on Vala to 0.11.1

This is needed to allow null arguments as output variables without
crashing. It also improves the HashTable API.
parent 19b2dd3b
......@@ -18,7 +18,7 @@ AC_SUBST(ovccincludedir)
# Checks for programs.
AC_PROG_CC
AM_PROG_VALAC([0.8])
AM_PROG_VALAC([0.11.1])
AC_PROG_LIBTOOL
# check for gtk-doc
......
......@@ -175,7 +175,7 @@ namespace OVCC
height = (topedge - bottomedge).abs() + 1;
}
private static uint position_hash (void *key)
private static uint position_hash (Position? key)
{
/* from g_str_hash, do a direct in-memory hash */
char *p = (char *) key;
......@@ -188,9 +188,10 @@ namespace OVCC
return (uint) h;
}
private static bool position_equals (void *a, void *b)
private static bool position_equals (Position? a,
Position? b)
{
return (*((Position*) a)).equals (*((Position*) b));
return a.equals (b);
}
public delegate bool BoardForeachFunc (Board board,
......@@ -210,7 +211,7 @@ namespace OVCC
bool keep_going = true;
this._board.foreach ((k, v) => {
if (keep_going) {
keep_going = f (this, *((Position *)k), v as Tile);
keep_going = f (this, k, v);
}
});
return keep_going;
......
......@@ -72,7 +72,7 @@ namespace OVCC
{
debug ("Dumping tiles definitions [%p]", this);
this._tiles.foreach ((k, v) => {
debug ("ID #%u", (v as Tile).id);
debug ("ID #%u", v.id);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment