--- a/RANSAC.c
+++ b/RANSAC.c
@@ -114,7 +114,7 @@
 	Random_delete(rand);
 
 	IComparator cmp;
-	cmp.compareTo = model->compareTo;
+	cmp.compareTo = (int ( *)(IComparator *,const void *,const void *)) model->compareTo;
 	ArrayList_Sort( result, &cmp);
 	//WriteLine ("got %d modelfits", ArrayList_Count(result));