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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:56:16 UTC 2009


The following commit has been merged in the upstream branch:
commit e2102b89c76c3dfba2c37ce55964c39a91f004d0
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Apr 2 06:59:25 2009 +1100

    Fix for negative clock return values (thanks to G. McBain)
    
    darcs-hash:20090401195925-d4795-2a77367a4db98ab072416965bc3d4b5274198beb.gz

diff --git a/src/utils.c b/src/utils.c
index a336e6e..f4b0fc7 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1496,7 +1496,7 @@ void gfs_clock_start (GfsClock * t)
   g_return_if_fail (t != NULL);
   g_return_if_fail (!t->started);
 
-  if (times (&tm) < 0)
+  if (times (&tm) == (clock_t) -1)
     g_warning ("cannot read clock");
   t->start = tm.tms_utime;
   t->started = TRUE;
@@ -1515,7 +1515,7 @@ void gfs_clock_stop (GfsClock * t)
   g_return_if_fail (t != NULL);
   g_return_if_fail (t->started);
 
-  if (times (&tm) < 0)
+  if (times (&tm) == (clock_t) -1)
     g_warning ("cannot read clock");
   t->stop = tm.tms_utime;
   t->started = FALSE;
@@ -1536,7 +1536,7 @@ gdouble gfs_clock_elapsed (GfsClock * t)
     return (t->stop - t->start)/(gdouble) sysconf (_SC_CLK_TCK);
   else {
     struct tms tm;
-    if (times (&tm) < 0)
+    if (times (&tm) == (clock_t) -1)
       g_warning ("cannot read clock");
     return (tm.tms_utime - t->start)/(gdouble) sysconf (_SC_CLK_TCK);
   }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list