[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:54:46 UTC 2009


The following commit has been merged in the upstream branch:
commit 7aff27fb84ef513aeaaa2dcb4fb32a66cf78d95f
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Oct 5 12:42:04 2007 +1000

    Fix for compatibility with glib-1.2 series
    
    darcs-hash:20071005024204-d4795-4f28735eef326bbb573010bef18bd4b480f565ad.gz

diff --git a/src/domain.c b/src/domain.c
index 3aef59e..52f18dd 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -267,9 +267,9 @@ static void add_item (gpointer item, GPtrArray * a)
   g_ptr_array_add (a, item);
 }
 
-static gint compare_boxes (const GfsBox ** b1, const GfsBox ** b2)
+static int compare_boxes (const void * b1, const void * b2)
 {
-  return (*b1)->id < (*b2)->id ? -1 : 1;
+  return (*(GfsBox **)b1)->id < (*(GfsBox **)b2)->id ? -1 : 1;
 }
 
 static void domain_foreach (GtsContainer * c, 
@@ -279,8 +279,10 @@ static void domain_foreach (GtsContainer * c,
   GPtrArray * a = g_ptr_array_new ();
   (* GTS_CONTAINER_CLASS (GTS_OBJECT_CLASS (gfs_domain_class ())->parent_class)->foreach)
     (c, (GtsFunc) add_item, a);
-  g_ptr_array_sort (a, (GCompareFunc) compare_boxes);
-  g_ptr_array_foreach (a, (GFunc) func, data);
+  qsort (a->pdata, a->len, sizeof (gpointer), compare_boxes);
+  guint i;
+  for (i = 0; i < a->len; i++)
+    (* func) (a->pdata[i], data);
   g_ptr_array_free (a, TRUE);
 }
 

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list